Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Exp on client?


Dawntide
 Share

Recommended Posts

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

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. :P

Just 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

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.
Link to comment
Share on other sites

@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

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 = Nothing
End Sub
```
Please fix my mistakes, thanks
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...