erkro1 Posted January 23, 2011 Author Share Posted January 23, 2011 Hey,Im trying to implent the /info command, but now I have a problem :He says 0 by HP and SP, i know the problem is in Sub HandlePlayerInfoRequest, but i can't fix it.My Sub HandlePlayerInfoRequest>! ```Sub HandlePlayerInfoRequest(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim Name As String Dim I As Long Dim n As Long Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteBytes Data() Name = Buffer.ReadString 'Parse(1) Set Buffer = Nothing I = FindPlayer(Name)>! If I > 0 Then Call PlayerMsg(Index, "Account: " & Trim$(Player(I).Login) & ", Character: " & GetPlayerName(I), BrightGreen)>! If GetPlayerAccess(Index) > ADMIN_MONITOR Then Call PlayerMsg(Index, "-=- Stats for " & GetPlayerName(I) & " -=-", BrightGreen) Call PlayerMsg(Index, "Level: " & GetPlayerLevel(I) & " Exp: " & GetPlayerExp(I) & "/" & GetPlayerNextLevel(I), BrightGreen) Call PlayerMsg(Index, "HP: " & GetPlayerVital(I, Vitals.HP) & "/" & GetPlayerMaxVital(I, Vitals.HP) & " MP: " & GetPlayerVital(I, Vitals.MP) & "/" & GetPlayerMaxVital(I, Vitals.MP), BrightGreen) Call PlayerMsg(Index, "Strength: " & GetPlayerStat(I, Stats.Strength) & " Endurance: " & GetPlayerStat(I, Stats.Endurance) & " Intelligence: " & GetPlayerStat(I, Stats.Intelligence) & " Agility: " & GetPlayerStat(I, Stats.Agility) & " Willpower: " & GetPlayerStat(I, Stats.Willpower), BrightGreen) I = (GetPlayerStat(Index, Stats.Strength) \ 2) + (GetPlayerLevel(Index) \ 2) n = Int(Rnd * 100) + 1>! If n > 100 Then n = 100 If I > 100 Then I = 100 Call PlayerMsg(Index, "Critical Hit Chance: " & n & "%, Block Chance: " & I & "%", BrightGreen) End If>! Else Call PlayerMsg(Index, "Player is not online.", White) End IfEnd Sub```Thanks for your time. Link to comment Share on other sites More sharing options...
erkro1 Posted January 24, 2011 Author Share Posted January 24, 2011 BUMPI really need help ;( Link to comment Share on other sites More sharing options...
shadowwulf Posted January 25, 2011 Share Posted January 25, 2011 why is I = Fineplayername(name) instead of Index?Wouldnt you GetPlayerStat(Index….) not GetPlayerStat(Erkro1...)? Link to comment Share on other sites More sharing options...
westin444 Posted January 25, 2011 Share Posted January 25, 2011 its i=FindPLayer(Name)He doesn't want to use the index arg, but rather the player's name. And he doesn't want to show his stats, but rather i's stast. Link to comment Share on other sites More sharing options...
erkro1 Posted January 26, 2011 Author Share Posted January 26, 2011 Ok, but what should i need to do to fix it? 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