Dawntide Posted August 17, 2012 Author Share Posted August 17, 2012 Hey,i want to award the player with exp when he does a few things like pushing a button or gathering a resource. I know there is a sendrequest.playerlevelup, but how to give a player EXP when he does something on the client?thanks in advance! Link to comment Share on other sites More sharing options...
Guest Posted August 17, 2012 Share Posted August 17, 2012 If your using event system 2.3 or higher, there is a "Give XP" command in the event editor! Link to comment Share on other sites More sharing options...
Dawntide Posted August 17, 2012 Author Share Posted August 17, 2012 Yeah but i guess i can not use the event system, because the action takes place in a new form, not frmMain. Link to comment Share on other sites More sharing options...
Joyce Posted August 17, 2012 Share Posted August 17, 2012 Send a packet to the server, let the server decide if it's a legitimate action(If they should be able to have the screen open) and assign the experience, send a message back and close the screen. Problem solved. :PJust make sure to check if it's a legitimate action, or someone could endlessly spam the packet to get experience. Link to comment Share on other sites More sharing options...
Dawntide Posted August 17, 2012 Author Share Posted August 17, 2012 This would help good coders, but i do not know everything about vb6, sohow to make a packet?how to send a packet to the server?how to decide if its a legitimate action or not?Maybe you could give me more help if i am more specific.i want to create a little game inside of my game, if the player wins the game he gain exp, when he loses, he will not gain exp. Link to comment Share on other sites More sharing options...
Vus Posted August 17, 2012 Share Posted August 17, 2012 @Dawntide:> This would help good coders, but i do not know everything about vb6, so> > how to make a packet?> how to send a packet to the server?> how to decide if its a legitimate action or not?> > Maybe you could give me more help if i am more specific.> > i want to create a little game inside of my game, if the player wins the game he gain exp, when he loses, he will not gain exp.This could help you understand packets little more:http://www.touchofdeathforums.com/smf2/index.php/topic,69393.msg746513.html#msg746513 Link to comment Share on other sites More sharing options...
Dawntide Posted August 17, 2012 Author Share Posted August 17, 2012 client side:```Public Sub WinEXP(ByVal index As Long, ByVal EXP As Long)Dim Buffer As clsBuffer ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Set Buffer = New clsBuffer Buffer.WriteLong CWinEXPPacket Buffer.WriteLong index Buffer.WriteLong EXP SendData Buffer.ToArray() Set Buffer = Nothing``````Call WinEXP(index, Player(index).EXP, EXPAMOUNT)```server side:```HandleDataSub(CWinEXPPacket) = GetAddress(AddressOf HandleWinEXPPacket)``````Private Sub HandleWinEXPPacket(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddR As Long, ByVal ExtraVar As Long) ' the variables we store our information in Dim player As Long Dim EXP As Long Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteBytes Data() player = buffer.ReadLong EXP = buffer.ReadLong GivePlayerEXP index, EXP Set Buffer = NothingEnd Sub```Please fix my mistakes, thanks Link to comment Share on other sites More sharing options...
Guest Posted August 17, 2012 Share Posted August 17, 2012 Wouldent it be easier to just dl event system; Not to sound lazy but everything is advancing now. Link to comment Share on other sites More sharing options...
Dawntide Posted August 17, 2012 Author Share Posted August 17, 2012 Do you even read my posts?"Yeah but i guess i can not use the event system, because the action takes place in a new form, not frmMain."I am using Event System 2.3, but I am using a seperate form, it has nothing to do with frmMain, so the even system will probably not work. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now