SetPlayerName
From SA-MP Wiki
SetPlayerName
Sets the name of a player.
(playerid, name[])
| playerid | The ID of the player to set the name of |
| name[] | The name to set |
| Returns | 1 if the name was changed, 0 if the player is already using that name or -1 when the name cannot be changed (it's in use, too long or has invalid characters) |
Important Note: If you set the player's name to the same name, expect different case latters (ie "heLLO" to "hello") it will not work.
if(strcmp(cmdtext,"/superman",true) == 0) { SetPlayerName(playerid,"Superman"); return 1; }
Related Functions
The following functions might be useful as well, as they're related to this function in one way or another.
- GetPlayerName: Get a player's name.
