/setadmin CMD (Dini)
#2

pawn Код:
CMD:setadmin(playerid, params[])
{
    new id, level;
    if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "USAGE: /setadmin [id] [level]");

    if(PlayerInfo[playerid][AdminLevel] == 10) // only example
    {
        if(IsPlayerConnected(id))
        {
            if(1 <= level < 10) // only example
            {
                new string[128];
                PlayerInfo[id][AdminLevel] = level;
                format(string, sizeof(string), "* %s have promoted you to admin level %d.", level);
                SendClientMessage(id, -1, string);
                format(string, sizeof(string), "* You have promoted %s to admin level %d.", level);
                SendClientMessage(playerid, -1, string);
            }
            else SendClientMessage(playerid, -1, "ERROR: Invalid level (valid level: 1 - 10.");
        }  
        else SendClientMessage(playerid, -1, "ERROR: Player not connected!");
    }
    else SendClientMessage(playerid, -1, "ERROR: You are not admin!");
}
Reply


Messages In This Thread
/setadmin CMD (Dini) - by MikeMike1997 - 26.03.2014, 00:00
Re: /setadmin CMD (Dini) - by RenovanZ - 26.03.2014, 00:17
Re: /setadmin CMD (Dini) - by MikeMike1997 - 26.03.2014, 00:21
Re: /setadmin CMD (Dini) - by RenovanZ - 26.03.2014, 00:22
Re: /setadmin CMD (Dini) - by MikeMike1997 - 26.03.2014, 00:26

Forum Jump:


Users browsing this thread: 2 Guest(s)