Change Name command
#2

Here this should work fine in zcmd:

Код:
CMD:changename(playerid, params[])
{
	new targetid,name[128];
	if(PInfo[playerid][Level] < 2 || !IsPlayerAdmin(playerid)) return 0;
	else if (sscanf(params,"us",targetid,name))SendClientMessage(playerid,RED,"Usage: /changename [Playerid] [New name]");
	else if(!IsPlayerConnected(targetid))SendClientMessage(playerid,RED,"Error: Player is not connected!");
	else {
	    new string[128],n[MAX_PLAYER_NAME];
	    GetPlayerName(targetid,n,sizeof(n));
	    SetPlayerName(targetid,name);
	    format(string,sizeof(string),"Admin %s [ID:%d] Has set %s [ID:%d] name to %s",Name(playerid),playerid,n,targetid,name);
	    SendClientMessageToAll(YELLOW,string);
  		format(string,sizeof(string),"Your Name has been set to %s by Admin %s[ID:%d]",Name(targetid),n,playerid);
	    SendClientMessage(playerid,GREEN,string);
	}
	return 1;
}
Hope this helps!
Reply


Messages In This Thread
Change Name command - by NTS - 12.03.2012, 18:50
Re: Change Name command - by kvsolga - 12.03.2012, 18:51
Re: Change Name command - by NTS - 12.03.2012, 18:53

Forum Jump:


Users browsing this thread: 1 Guest(s)