Mirage Source
Advanced Info On Player (Compatible with newest release) - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51)
+----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44)
+------ Forum: Tutorials (https://mirage-engine.uk/forums/forumdisplay.php?fid=13)
+------ Thread: Advanced Info On Player (Compatible with newest release) (/showthread.php?tid=2185)



Advanced Info On Player (Compatible with newest release) - Nean - 24-09-2008

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


Re: Advanced Info On Player - Jacob - 24-09-2008

This won't work in the latest version of MS4.


Re: Advanced Info On Player - Nean - 25-09-2008

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.


Re: Advanced Info On Player (Compatible with newest release) - Nean - 10-10-2008

Just updated it. Should be compatible with newest release.