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

Packet - Subscript out of range


Sealbreaker
 Share

Recommended Posts

I get subscript out of range and can't figure out why… idk if it helps, but i'll post the client-sided packet-sending-code aswell...

```
Public Sub SendGravity(ByVal Index As Long)
    Dim Buffer As clsBuffer
    Set Buffer = New clsBuffer
    Buffer.WriteLong CGravity
    SendData Buffer.ToArray()
    Set Buffer = Nothing
End Sub
```
and the code in which i get the error (server-sided) (I get it at the first point where i use Index)

```
Sub HandleGravity(ByVal Index As Long)
    Dim n As Long
    Dim Buffer As clsBuffer
    Set Buffer = New clsBuffer
      If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type <> TILE_TYPE_PLATFORM Then
  Call SetPLayerY(index, GetPLayerY(index) + 1)
  SendPlayerXY (Index)
  End If
    Set Buffer = Nothing

End Sub
```
I don't get what's wrong and i hope you can help me.

-seal
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...