zdearborn Posted February 3, 2011 Author Share Posted February 3, 2011 Hey, I'm trying to find a way to have the player's name color drawn according to their current HP.Here's my code (inside Sub DrawPlayerName):``` ' Set color of name based on amount of HP Dim hpPercent As Double hpPercent = GetPlayerVital(Index, Vitals.HP) / GetPlayerMaxVital(Index, Vitals.HP) If hpPercent > 0.75 Then color = QBColor(BrightGreen) ElseIf hpPercent > 0.5 And hpPercent <= 0.75 Then color = QBColor(Yellow) ElseIf hpPercent > 0.25 And hpPercent <= 0.5 Then color = RGB(255, 165, 0) ElseIf hpPercent > 0 And hpPercent <= 0.25 Then color = QBColor(BrightRed) End If```Here's the problem:I logged into my character (admin), and the color is displayed as intended, but as I logged into another character and saw admin on screen, admin's name appeared completely black, and admin's client crashed in Debug with runtime error 6: Overflow highlighting the following line:```hpPercent = GetPlayerVital(Index, Vitals.HP) / GetPlayerMaxVital(Index, Vitals.HP)```The second character's client was fine and did not crash.No, I am not a proficient VB6 programmer so please avoid ridiculing my skills or any overlooked solutions :PAny help appreciated, thanks. Link to comment Share on other sites More sharing options...
Robin Posted February 3, 2011 Share Posted February 3, 2011 I don't think the client even stores information on other player's health. Link to comment Share on other sites More sharing options...
zdearborn Posted February 3, 2011 Author Share Posted February 3, 2011 Haha oops- thanks for the info.. time for some serious trial and error now 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