SetPlayerName
#1

I am expiriencing a client bug (I think) with SetPlayerName.
In my gamemode names must be RP, so I check that Name_Surname format is used.
After that I set playername to New_Name[id] exampe: New_Name115
And after that the realname example: John_Doe.

I set the name twice because SetPlayerName does not allow name changes if only a letter is changed from lowercase to uppercase and the other way around.

The problem that I am expiriencing is that:
Playerid 0 joins the game like this -> joHN_dOe
In console I clearly see the changes of names.
When you press tab, the new name is shown as it should (John_Doe) (due to my script changes).

Player 1 joins the game like this -> tESt_nIcK
In console I clearly see the changes of names.
When you press tab as playerid 0 , both names are fine (John_Doe and Test_Nick).
When you press tab as playerid 1, he sees his old nick (tESt_nIcK , not Test_Nick), BUT in the console it clearly SAYS that the nick was changed to New_Name1, then Test_Nick.
Reply
#2

This is a script bug/error not a client one, post in scripting help, someone will help you out.

http://forum.sa-mp.com/forumdisplay.php?f=12
Reply
#3

Really? Did you read the whole post or only the parts?
Reply
#4

I did, and it still counts as a script error. Post it in the link he gave you, and you'll get actual help.
Reply
#5

Quote:
Originally Posted by Excelize
Посмотреть сообщение
I did, and it still counts as a script error. Post it in the link he gave you, and you'll get actual help.
How can it be a scripting error if the change was registered in the console, every player sees the nick change except for the player whose name was changed ?
And I don't need scripting help, I made a workaround, but I still think that this is a SA-MP bug.
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)