SA-MP Forums Archive
/name command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /name command (/showthread.php?tid=292489)



/name command - (_AcE_) - 23.10.2011

How do I script a command for a person to do :

/name [input text]?

All I want to know is how do i script the command, and change their name to what they type?


Re: /name command - CyNiC - 24.10.2011

You can found it in admin filterscripts.
pawn Код:
//Example with zcmd & sscanf
CMD:name(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new id, newname[MAX_PLAYER_NAME];
        if(sscanf(params, "ds", id, newname)) return SendClientMessage(playerid, -1, "Syntax: /name [newname]");
        SetPlayerName(id, newname);
        SendClientMessage(playerid, -1, "The player name has changed.");
        return true;
    }
    return false;
}



Re: /name command - =WoR=Varth - 24.10.2011

pawn Код:
if(sscanf(params,"ds[128]",id,newname))
You forgot the length.