SA-MP Forums Archive
/changename Command - 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: /changename Command (/showthread.php?tid=95561)



/changename Command - Jbosh123 - 04.09.2009

Hello Guys,

Ive looked around for a /changename command, But as I cannot script good, Can someone create a script which also deletes the name of the person I am changing their name to something else.

Ive tried looking everywhere, If anyone has a tut, this would be grateful.


Re: /changename Command - Karaula - 04.09.2009

Код:
	if(strcmp(cmd, "/changename", true) == 0)
	{
	  GetPlayerName(playerid, sendername, sizeof(sendername));
		new tmpp[256];
		tmpp = strtok(cmdtext, idx);
		if(!strlen(tmpp))
		{
			SendClientMessage(playerid, COLOR_YELLOW, "Correct SYNTAX: /changename [playerid] [new nick]");
			return 1;
		}
		giveplayerid = strval(tmpp);
		tmp = strtok(cmdtext, idx);
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(IsPlayerConnected(playerid))
		{
		  if(PlayerInfo[playerid][pAdmin] >= 1337)
		  {
		    if(IsPlayerConnected(giveplayerid))
		    {
					SetPlayerName(giveplayerid, tmp);
					format(string, sizeof(string), "AdmCMD: %s(%i) has changed Your name to %s", sendername, playerid, tmp);
					SendClientMessage(giveplayerid, COLOR_YELLOW, string);
					format(string, sizeof(string), "AdmCMD: You have changed ID %i's name to %s", giveplayerid, tmp);
					SendClientMessage(playerid, COLOR_YELLOW, string);
					format(string, 256, "AdmWarning: %s has changed %s's his name to %s.", sendername,giveplayer, tmp);
					ABroadCast(COLOR_YELLOW,string,1);
				}
				else
				{
				  format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
			  SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		  SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
	 	return 1;
	}



Re: /changename Command - Jbosh123 - 04.09.2009

Quote:
Originally Posted by Karaula
Код:
	if(strcmp(cmd, "/changename", true) == 0)
	{
	  GetPlayerName(playerid, sendername, sizeof(sendername));
		new tmpp[256];
		tmpp = strtok(cmdtext, idx);
		if(!strlen(tmpp))
		{
			SendClientMessage(playerid, COLOR_YELLOW, "Correct SYNTAX: /changename [playerid] [new nick]");
			return 1;
		}
		giveplayerid = strval(tmpp);
		tmp = strtok(cmdtext, idx);
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(IsPlayerConnected(playerid))
		{
		  if(PlayerInfo[playerid][pAdmin] >= 1337)
		  {
		    if(IsPlayerConnected(giveplayerid))
		    {
					SetPlayerName(giveplayerid, tmp);
					format(string, sizeof(string), "AdmCMD: %s(%i) has changed Your name to %s", sendername, playerid, tmp);
					SendClientMessage(giveplayerid, COLOR_YELLOW, string);
					format(string, sizeof(string), "AdmCMD: You have changed ID %i's name to %s", giveplayerid, tmp);
					SendClientMessage(playerid, COLOR_YELLOW, string);
					format(string, 256, "AdmWarning: %s has changed %s's his name to %s.", sendername,giveplayer, tmp);
					ABroadCast(COLOR_YELLOW,string,1);
				}
				else
				{
				  format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
			  SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		  SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
	 	return 1;
	}
Wheres the Fuction with deleting the previous name that was changed.


Re: /changename Command - Danny_Costelo - 04.09.2009

http://forum.sa-mp.com/index.php?topic=114903.0

Read this boards rule troughly before creating a topic, no-one is here to make anything for you.


Re: /changename Command - Jbosh123 - 04.09.2009

Im not asking anyone to make one for me, I am simply asking for a point to the right direction or a tutorial like I first said!