SetPlayerName
#6

Here is some more information:

Код:
new pName[MAX_PLAYERS][MAX_PLAYER_NAME+1];

public OnPlayerConnect(playerid)
{
	GetPlayerName(playerid,pName[playerid],MAX_PLAYER_NAME);
	
	printf("pName:%s",pName[playerid]);

	new pNameSize = strlen(pName[playerid]);
	for(new i; i < pNameSize; i++)
	{
	    pName[playerid][i] = tolower(pName[playerid][i]);
	}

	printf("pName:%s",pName[playerid]);

	SetPlayerName(playerid, "New_Name");
	SetPlayerName(playerid, pName[playerid]);


	GameTextForPlayer(playerid,"~w~SA-MP: ~r~Bare Script",5000,5);
	return 1;
}
SCREENS:






EDIT:

I just now saw this notice in the wiki:

Important Note: If you set the player's name to the same name except different cased letters (i.e. "heLLO" to "hello"), it will not work.
If used in OnPlayerConnect, the new name will not be shown for the connecting player.

So it a known bug. I just didn't see the notice.
Reply


Messages In This Thread
SetPlayerName - by Gigi-The-Beast - 22.01.2014, 21:29
Re: SetPlayerName - by Flake. - 22.01.2014, 22:43
Re: SetPlayerName - by Gigi-The-Beast - 22.01.2014, 22:57
Re: SetPlayerName - by Excelize - 23.01.2014, 01:13
Re: SetPlayerName - by Gigi-The-Beast - 23.01.2014, 10:57
Re: SetPlayerName - by Gigi-The-Beast - 23.01.2014, 13:27

Forum Jump:


Users browsing this thread: 1 Guest(s)