Kazako Posted December 25, 2015 Author Share Posted December 25, 2015 Hey guys, I need some help with two systems in my game that aren't quite working as they should.First up is my guild system, after a guild is created and a player logs in, the server crashes.Secondly, I need help with my hunger/thirst system- where would I put the code to make a player die when vitals.Hunger =< 0 ?Let me know if you need screenshots and of what, etc. Link to comment Share on other sites More sharing options...
PD Posted December 25, 2015 Share Posted December 25, 2015 What error do you get when the server crashes? Can't help without seeing the code or you providing any real information. Link to comment Share on other sites More sharing options...
Kazako Posted December 25, 2015 Author Share Posted December 25, 2015 I can't replicate the server crashing right now- I will make a note of it next time it happens/if it happens.Now I just have two problems with the grey area on my client and the hunger/thirst not killing the player at 0.* * *```Private Sub HandlePlayerHp(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim Buffer As clsBuffer ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Set Buffer = New clsBuffer Buffer.WriteBytes Data() Player(MyIndex).MaxVital(Vitals.HP) = Buffer.ReadLong Call SetPlayerVital(MyIndex, Vitals.HP, Buffer.ReadLong) If GetPlayerMaxVital(MyIndex, Vitals.HP) > 0 Then 'frmMain.lblHP.Caption = Int(GetPlayerVital(MyIndex, Vitals.HP) / GetPlayerMaxVital(MyIndex, Vitals.HP) * 100) & "%" frmMain.lblHP.Caption = GetPlayerVital(MyIndex, Vitals.HP) & "/" & GetPlayerMaxVital(MyIndex, Vitals.HP) ' hp bar frmMain.imgHPBar.width = ((GetPlayerVital(MyIndex, Vitals.HP) / HPBar_Width) / (GetPlayerMaxVital(MyIndex, Vitals.HP) / HPBar_Width)) * HPBar_Width End If ' Error handler Exit Suberrorhandler: HandleError "HandlePlayerHP", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```Can someone highlight the code that kills the player when HP reaches 0? Link to comment Share on other sites More sharing options...
Kazako Posted December 25, 2015 Author Share Posted December 25, 2015 Solved, Thanks PD. 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