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

Exp & money packet


Dawntide
 Share

Recommended Posts

What part "doesn't work"? What steps have you followed to add this packet?

Also try this:

```

Sub HandleCheckCurrency(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)

Dim Buffer As clsBuffer

Dim itemamount As Long

Set Buffer = New clsBuffer

Buffer.WriteBytes Data()

itemamount = Buffer.ReadLong

' check gold

If itemamount > HasItem(index, 1) Then

PlayerMsg index, "Not enough gold.", BrightRed

Exit Sub

End If

Set Buffer = Nothing

End Sub
```

Now:

```

Call CheckCurrency(x)

```
will check if they have more than x currency.
Link to comment
Share on other sites

Uhhh…? What? Exit Sub exits the subroutine it is currently in. It does not send a message to the client telling it to Exit Sub, or stop something. You can have the server send that message back to the client with another packet, and then the new packet could hide the form from the client.
Link to comment
Share on other sites

> I have a minigame, you just need to click 1 button, its random if you win or lose. If you win you get 50 gold, if you lose you lose 50 gold.
>
> i want it to exit the minigame button click Sub when the player has less than X gold.

It can't. The server cannot and does not send the "Exit Sub" to the client. The "Exit Sub" exits the current sub the server is in. You will need to send a packet back to the client, which the client could then use to determine whether or not to continue.
Link to comment
Share on other sites

> And how to send packets from server to client? I only know client to server

I thought I covered this? It's the exact same process, except you're using a different Enum list..

And if it's ONE button with a 50/50 chance, why not send a query from the client to the server for the minigame, and let the server randomize it? And just close the form client-side as soon as you click it. Saves a loooot of your trouble, and plugs a major security hole you're creating right now. I was under the assumption you made an actual minigame.
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...