DarkDino Posted May 11, 2013 Author Share Posted May 11, 2013 Client-Side```Sub SetPlayerStat(ByVal Index As Long, Stat As Stats, ByVal Value As Long) ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If Index > MAX_PLAYERS Then Exit Sub If Value <= 0 Then Value = 1 If Value > MAX_BYTE Then Value = MAX_BYTE Player(Index).Stat(Stat) = Value ' Error handler Exit Suberrorhandler: HandleError "SetPlayerStat", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub``````Function GetPlayerStat(ByVal Index As Long, Stat As Stats) As Long ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If Index > MAX_PLAYERS Then Exit Function GetPlayerStat = Player(Index).Stat(Stat) ' Error handler Exit Functionerrorhandler: HandleError "GetPlayerStat", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit FunctionEnd Function```Server-Side```Public Sub SetPlayerStat(ByVal index As Long, ByVal stat As Stats, ByVal Value As Long) Player(index).stat(stat) = ValueEnd Sub``````Public Function GetPlayerStat(ByVal index As Long, ByVal stat As Stats) As Long Dim x As Long, i As Long If index > MAX_PLAYERS Then Exit Function x = Player(index).stat(stat) For i = 1 To Equipment.Equipment_Count - 1 If Player(index).Equipment(i) > 0 Then If Item(Player(index).Equipment(i)).Add_Stat(stat) > 0 Then x = x + Item(Player(index).Equipment(i)).Add_Stat(stat) End If End If Next Select Case stat Case Stats.Strength For i = 1 To 10 If TempPlayer(index).Buffs(i) = BUFF_ADD_STR Then x = x + TempPlayer(index).BuffValue(i) End If If TempPlayer(index).Buffs(i) = BUFF_SUB_STR Then x = x - TempPlayer(index).BuffValue(i) End If Next Case Stats.Endurance For i = 1 To 10 If TempPlayer(index).Buffs(i) = BUFF_ADD_END Then x = x + TempPlayer(index).BuffValue(i) End If If TempPlayer(index).Buffs(i) = BUFF_SUB_END Then x = x - TempPlayer(index).BuffValue(i) End If Next Case Stats.Agility For i = 1 To 10 If TempPlayer(index).Buffs(i) = BUFF_ADD_AGI Then x = x + TempPlayer(index).BuffValue(i) End If If TempPlayer(index).Buffs(i) = BUFF_SUB_AGI Then x = x - TempPlayer(index).BuffValue(i) End If Next Case Stats.Intelligence For i = 1 To 10 If TempPlayer(index).Buffs(i) = BUFF_ADD_INT Then x = x + TempPlayer(index).BuffValue(i) End If If TempPlayer(index).Buffs(i) = BUFF_SUB_INT Then x = x - TempPlayer(index).BuffValue(i) End If Next Case Stats.Willpower For i = 1 To 10 If TempPlayer(index).Buffs(i) = BUFF_ADD_WILL Then x = x + TempPlayer(index).BuffValue(i) End If If TempPlayer(index).Buffs(i) = BUFF_SUB_WILL Then x = x - TempPlayer(index).BuffValue(i) End If Next End Select GetPlayerStat = xEnd Function```This D:? Link to comment Share on other sites More sharing options...
escfoe2 Posted May 11, 2013 Share Posted May 11, 2013 Do you have Team Viewer? >.< Link to comment Share on other sites More sharing options...
DarkDino Posted May 11, 2013 Author Share Posted May 11, 2013 I download D:, i send a MP now ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)! Link to comment Share on other sites More sharing options...
Zeno Posted May 11, 2013 Share Posted May 11, 2013 > In handleplayerstats, try using index instead of myindex when setting the caption. Edit: I guess too in handleplayerdata.Have you tried this? It might not fix your error, (it might?) but it will fix other bugs when you have more than one person on. From my understanding, in most Sub Handle***, index is the tcp address, not the index of your player's array. For your player's index use MyIndex. Link to comment Share on other sites More sharing options...
DarkDino Posted May 11, 2013 Author Share Posted May 11, 2013 > Have you tried this? It might not fix your error, (it might?) but it will fix other bugs when you have more than one person on. From my understanding, in most Sub Handle***, index is the tcp address, not the index of your player's array. For your player's index use MyIndex.Yes, i use Index D: Link to comment Share on other sites More sharing options...
escfoe2 Posted May 11, 2013 Share Posted May 11, 2013 > Have you tried this? It might not fix your error, (it might?) but it will fix other bugs when you have more than one person on. From my understanding, in most Sub Handle***, index is the tcp address, not the index of your player's array. For your player's index use MyIndex.Incorrect. The index CAN and almost always is YOUR player's "array" (Client-Side)Index only refers to the temporary placement of you and your socket. If you log out, someone else logs in, and you log in after them, your index will be different from last time.DarkDino, PM me your ID and Pass. Link to comment Share on other sites More sharing options...
DarkDino Posted May 11, 2013 Author Share Posted May 11, 2013 > Incorrect. The index CAN and almost always is YOUR player's "array" (Client-Side)> > DarkDino, PM me your ID and Pass.Check you'r messages, i send you ![:o](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/ohmy.png) Link to comment Share on other sites More sharing options...
escfoe2 Posted May 11, 2013 Share Posted May 11, 2013 I Team Viewer'd him and found that the problem was in Function PlayerData (Server-Side) and in Sub HandlePlayerData (Client-Side).There was one variable the client tried to retrieve that the server wasn't sending. This caused a mix up of every other variable below it.Took me a while to find it, but problem solved ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) Link to comment Share on other sites More sharing options...
DarkDino Posted May 11, 2013 Author Share Posted May 11, 2013 escfoe2 is the best ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)! this solved! ![:poonbox:](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/AddEmoticons0091.gif) ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png) 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