Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Advanced Info On Player (Compatible with newest release)
#1
Sometimes, just getting the basic knowledge on the other character, just isn't enough for you staff members, so I made an Advanced Info command. Just type: /advancedinfo Playername. It will display the Username, the password, their IP, and their Access level. Add to it as you wish, I just supplied the basics, and gave a general idea of it.

[spoiler]Server Side:

Find:
Code:
CPlayerInfoRequest

Under it add:
Code:
CAdvancedPlayerInfoRequest

Then find:
Code:
' ::::::::::::::::::::::::::::::::
' :: Player info request packet ::
' ::::::::::::::::::::::::::::::::
Sub HandlePlayerInfoRequest(ByVal Index As Long, ByRef Parse() As String)
Dim Name As String
Dim i As Long, n As Long

    Name = Parse(1)
    
    i = FindPlayer(Name)
    If i > 0 Then
        Call PlayerMsg(Index, "Account: " & Trim$(Player(i).Login) & ", Name: " & 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) & "  SP: " & GetPlayerVital(i, Vitals.SP) & "/" & GetPlayerMaxVital(i, Vitals.SP), BrightGreen)
            Call PlayerMsg(Index, "Strength: " & GetPlayerStat(i, Stats.Strength) & "  Defense: " & GetPlayerStat(i, Stats.Defense) & "  Magic: " & GetPlayerStat(i, Stats.Magic) & "  Speed: " & GetPlayerStat(i, Stats.Speed), BrightGreen)
            n = Int(GetPlayerStat(i, Stats.Strength) / 2) + Int(GetPlayerLevel(i) / 2)
            i = Int(GetPlayerStat(i, Stats.Defense) / 2) + Int(GetPlayerLevel(i) / 2)
            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 If
End Sub

Above it add:
Code:
' :::::::::::::::::::::::::::::::::::::::::
' :: Advanced Player info request packet ::
' :::::::::::::::::::::::::::::::::::::::::
Sub HandleAdvancedPlayerInfoRequest(ByVal Index As Long, ByRef Parse() As String)
Dim Name As String
Dim i As Long, n As Long

    Name = Parse(1)
    
    i = FindPlayer(Name)
   If GetPlayerAccess(Index) > 0 Then
    If i > 0 Then
        Call PlayerMsg(Index, "Account: " & Trim$(Player(i).Login) & ", Name: " & GetPlayerName(i), BrightGreen)
        If GetPlayerAccess(Index) > ADMIN_MONITOR Then
            Call PlayerMsg(Index, "-=- Advanced Info for " & GetPlayerName(i) & " -=-", BrightGreen)
            Call PlayerMsg(Index, "IP: " & GetPlayerIP(i), BrightGreen)
            Call PlayerMsg(Index, "Access: " & GetPlayerAccess(i), BrightGreen)
            Call PlayerMsg(Index, "PK's: " & GetPlayerPK(i), BrightGreen)
            Call PlayerMsg(Index, "Coordinates: " & GetPlayerMap(i) & "  X: " & GetPlayerX(i) & "  Y: " & GetPlayerY(i), BrightGreen)
    Else
        Call PlayerMsg(Index, "Player is not online.", White)
    End If
    End If
    End If
End Sub

Find:
Code:
Case CPlayerInfoRequest
            HandlePlayerInfoRequest Index, Parse

And above it add:
Code:
Case CAdvancedPlayerInfoRequest
            HandleAdvancedPlayerInfoRequest Index, Parse

Client Side:

Find:
Code:
CPlayerInfoRequest

Above it add:
Code:
CAdvancedPlayerInfoRequest

Then find:
Code:
Case "/info"
                    ' Checks to make sure we have more than one string in the array
                    If UBound(Command) >= 1 Then
                        Call SendData(CPlayerInfoRequest & SEP_CHAR & Command(1) & END_CHAR)
                    End If

Above it add:
Code:
Case "/ainfo"
                    ' Checks to make sure we have more than one string in the array
                    If UBound(Command) >= 1 Then
                        Call SendData(CAdvancedPlayerInfoRequest & SEP_CHAR & Command(1) & END_CHAR)
                    End If

That should be everything. Hope this was of some help to you.[/spoiler]

That should be it. This is updated as of: Oct 10, 2008. And should be compatible with newest release
Reply
#2
This won't work in the latest version of MS4.
Reply
#3
Yeah, I just added that, to have more to the script. I'll remove it in the next version. I'm going to rewrite this for the latest version.
Reply
#4
Just updated it. Should be compatible with newest release.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)