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

Some help


Jacquelinett
 Share

Recommended Posts

Hi, I am trying to make a title system for my game. I declared CurrentTitle as string in modType (playerrec section) and now i come accross some problem.

In the Server:
modDatabase, sub loadPlayer

```
Player(Index).CurrentTitle = GetVar(filename, "ACCOUNT", "CurrentTitle")
```Sub SavePlayer:
```
PutVar filename, "ACCOUNT", "CurrentTitle", Trim$(Player(Index).CurrentTitle)
```ModServerTCP, function PlayerData:
```
Buffer.WriteString GetPlayerTitle(Index)
```modPlayer:
```
Sub SetPlayerTitle(ByVal Index As Long, ByVal CurrentTitle As String)
    Player(Index).CurrentTitle = CurrentTitle
End Sub

Function GetPlayerTitle(ByVal Index As Long) As Long
    If Index > MAX_PLAYERS Then Exit Function
    GetPlayerTitle = Trim$(Player(Index).CurrentTitle)
End Function

```Client side: modPlayer
```
Function GetPlayerTitle(ByVal Index As Long) As Long
    If Index > MAX_PLAYERS Then Exit Function
    GetPlayerTitle = Trim$(Player(Index).CurrentTitle)
End Function

Sub SetPlayerTitle(ByVal Index As Long, ByVal CurrentTitle As String)
    If Index > MAX_PLAYERS Then Exit Sub
    Player(Index).CurrentTitle = CurrentTitle
End Sub
```
ModHandleData, sub HandlePLayerData
```
Call SetPlayerTitle(i, Buffer.ReadString)

```Now everytime the player log in to the game, the server crashed, saying type mismatch. Some help?
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...