SetPlayerName

From SA-MP Wiki

Jump to: navigation, search

SetPlayerName


Sets the name of a player.


Parameters:
(playerid, name[])
playeridThe ID of the player to set the name of
name[]The name to set


Returns1 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.

Personal tools
In other languages