Mirage Source
/setname - 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: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: /setname (/showthread.php?tid=2282)



/setname - Nean - 22-10-2008

I'm sure I can do this by myself, I think. Anyways, the only trouble I'm having is figuring out what N should =, I don't think it should be a value, lol. I was thinking of Dimming N as a string, but from then on I'm lost. Any help would be appreciated.

[spoiler]
Code:
' :::::::::::::::::::::::
' ::  Set name packet  ::
' :::::::::::::::::::::::
Sub HandleSetName(ByVal Index As Long, ByRef Parse() As String)
Dim n As Long

    ' Prevent hacking
    If GetPlayerAccess(Index) < ADMIN_MAPPER Then
        Call HackingAttempt(Index, "Admin Cloning")
        Exit Sub
    End If
    
    ' The name
    n = Val(Parse(1))
    
    Call SetPlayerName(Index, n)
    Call SendPlayerData(Index)
    Exit Sub
End Sub
[/spoiler]


Re: /setname - GIAKEN - 22-10-2008

n = FindPlayer(Parse(1))

SetPlayerName(n, Parse(2))

Client:

SendData(whatever & sep_char & Command(1) & sep_char & Command(2) & end_char)

/setname Giaken Giakenn

There's a lot more checks you should do though. Like making sure Command 1 and 2 aren't the same and so on. EXPERIMENT WITH IT!