SA-MP Forums Archive
help with changing name - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help with changing name (/showthread.php?tid=156530)



help with changing name - cuvip - 23.06.2010

i'm making a script that if admin type a command like /god or /duty, their name will be changed to [playerid](god), or (duty), anyone can hellp?


Re: help with changing name - gtapolicemods - 23.06.2010

here you go you can try this


Код:
format(namestring, sizeof(namestring), "GOD";
SetPlayerName(playerid, namestring);
let me know if this helps


Re: help with changing name - (SF)Noobanatior - 23.06.2010

i found this tricky but did it a while ago for a race leader im sure you can adapt my code

Код:
//add
new name[MAX_PLAYER_NAME],racename[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(racename,sizeof(racename),"%s[1st]",pname);
SetPlayerName(playerid,racename);


//remove
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
	if(strfind(pname,"[1st]",false,strlen(pname)-5) !=-1)	{
		strdel(pname,strlen(pname)-5,strlen(pname));
	  	SetPlayerName(a,pname);
 	}