/Changename help?
#2

Код:
CMD:setname(playerid, params[])
{
        if(PlayerInfo[playerid][Level] >= 6)	{
        new string[128], tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
		if(isnull(tmp) || isnull(tmp2)) return SendClientMessage(playerid, red, "USAGE: /setname [playerid] [new name]");
		if (udb_Exists(tmp2)) return SendClientMessage(playerid,red,"This User Name Is Taken!");
		new player1 = strval(tmp);
		if(PlayerInfo[player1][LoggedIn] == 0) return SendClientMessage(playerid,red,"Player Must Have Account!");
		new OldName[24],str[128];
		GetPlayerName(player1,OldName,sizeof(OldName));
		format(str,sizeof(str),"ladmin/users/%s.sav",OldName);
		udb_RenameUser(OldName,tmp2);
		format(str,sizeof(str),"ladmin/users/%s.sav",params);
		SetPlayerName(player1,tmp2);
		PlayerPlaySound(player1,1057,0.0,0.0,0.0);
        format(string, sizeof(string),"Admin ''%s'' Has Changed Your Name To '%s'",PlayerName2(playerid), tmp2);
		return SendClientMessage(player1,yellow,string);
	}   else return SendClientMessage(playerid,red, "ERROR: Only Level 6 can Use This Command");
return 1; }
Reply


Messages In This Thread
/Changename help? - by Tomix - 11.08.2013, 23:24
Re: /Changename help? - by FiReAlEx - 11.08.2013, 23:26
Re: /Changename help? - by Tomix - 11.08.2013, 23:28
Re: /Changename help? - by FiReAlEx - 11.08.2013, 23:30
Re: /Changename help? - by Tomix - 11.08.2013, 23:32
Re : /Changename help? - by Naruto_Emilio - 12.08.2013, 00:00
Re: /Changename help? - by NinjahZ - 12.08.2013, 00:34
Re: /Changename help? - by Tomix - 12.08.2013, 06:17
Re: /Changename help? - by tyler12 - 12.08.2013, 06:43
Re: /Changename help? - by NinjahZ - 12.08.2013, 07:07

Forum Jump:


Users browsing this thread: 1 Guest(s)