Sets the name of a player.
|playerid||The ID of the player to set the name of.|
|const name||The name to set. Must be 1-24 characters long and only contain valid characters (0-9, a-z, A-Z, , (), \$ @ . _ and = only).|
1 The name was changed successfully
0 The player already has that name
-1 The name can not be changed (it's already in use, too long or has invalid characters)
Changing the players' name to the same name but with different character cases (e.g. "John" to "JOHN") will not work. If used in OnPlayerConnect, the new name will not be shown for the connecting player. Passing a null string as the new name will crash the server. Player names can be up to 24 characters when using this function, but when joining the server from the SA-MP server browser, players' names must be no more than 20 and less than 3 characters (the server will deny entry). This allows for 4 characters extra when using SetPlayerName.
- GetPlayerName: Get a player's name.