Jacquelinett Posted August 29, 2011 Author Share Posted August 29, 2011 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 = CurrentTitleEnd SubFunction 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 FunctionSub SetPlayerTitle(ByVal Index As Long, ByVal CurrentTitle As String) If Index > MAX_PLAYERS Then Exit Sub Player(Index).CurrentTitle = CurrentTitleEnd 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 More sharing options...
new riklex Posted September 3, 2011 Share Posted September 3, 2011 0_0 i cant help, sorry but i still suck at coding :P Link to comment Share on other sites More sharing options...
Geek Posted September 3, 2011 Share Posted September 3, 2011 @new:> 0_0 i cant help, sorry but i still suck at coding :P Link to comment Share on other sites More sharing options...
Rithy58 Posted September 4, 2011 Share Posted September 4, 2011 Run the server and client in IDE and tell me what line it highlight and error on.Sincerely,Rithy 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