Command with ID
#1

Hello, how can i make this that i type the Player ID to change his name?

Код:
CMD:changename(playerid, params[])
{
    if(pInfo[playerid][pLogged] == 1)
    {
    if(pInfo[playerid][pAdminLevel] >= 5)
    {
    new oldname[24], newname[24];
    if(sscanf(params,"s[24]s[24]",oldname, newname)) return SendClientMessage(playerid,-1,""chat""COL_RED" Usage: /changename [oldname] [newname]");
    new filestring2[128];
    format(filestring2, sizeof(filestring2), "/Users/%s.ini", oldname);
    if(!fexist(filestring2)) return SendClientMessage(playerid,-1,""chat""COL_RED" That account name doesn't exist!");
    new filestring[128];
    format(filestring, sizeof(filestring), "/Users/%s.ini", newname);
    if(fexist(filestring)) return SendClientMessage(playerid,-1,""chat""COL_RED" The new name you've chosen is already taken");
    frename(filestring2, filestring);
    new string[128];
    format(string, sizeof(string), "» {F7B533}You have successfully renamed %s's account to %s" ,oldname, newname);
    SendClientMessage(playerid, -1, string);
	}
	else {
		SendClientMessage(playerid,-1,""chat""COL_RED" You do not have the sufficient privileges to use this command.");
			}
	}
	else {
	    SendClientMessage(playerid,-1,""chat" You are not logged in!");
	    Kick(playerid);
	}
    return 1;
}
Reply


Messages In This Thread
Command with ID - by Blackazur - 26.06.2013, 16:45
Re: Command with ID - by Deathstalker - 26.06.2013, 17:04
Re: Command with ID - by Jefff - 26.06.2013, 17:23

Forum Jump:


Users browsing this thread: 1 Guest(s)