need help with /setadmin command ! fast
#5

There were flaws in HY's code, i corrected it.
pawn Код:
CMD:setadmin(playerid,params[])
{
    new ID;
    new Level;
    new string[128];
    if(PlayerInfo[playerid][Admin] >= 5)
    {
        if(sscanf(params,"ui", ID, Level)) return SendClientMessage(playerid,-1,"{FF0000}USAGE: {15FF00}/SetAdmin [ID] [Level]");
        if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,-1,"Player is not connected");
        PlayerInfo[ID][Admin] = Level;
        format(string, sizeof(string), "{FF0000}[INFO]: {15FF00}You gave to {FF0000}%s {15FF00}Admin Level {0066CC}: %i", GetName(ID), Level);
        SendClientMessage(playerid, -1, string);
        format(string, sizeof(string), "{FF0000}[INFO]: {15FF00}Admin {FF0000}%s {15FF00}has setted your Admin Level to{0066CC}: %i", GetName(playerid), Level);
        SendClientMessage(ID, -1, string);
    }
    else
    {
        SendClientMessage(playerid, -1, "You need to be Admin Level 5 !");
    }
    return 1;
}

stock GetName(playerid)
{
    new Name[24];
    GetPlayerName(playerid, Name,24);
    return Name;
}
Reply


Messages In This Thread
need help with /setadmin command ! fast - by Toxik - 04.11.2014, 16:18
Re: need help with /setadmin command ! fast - by HY - 04.11.2014, 16:27
Re: need help with /setadmin command ! fast - by Toxik - 04.11.2014, 16:30
Re: need help with /setadmin command ! fast - by mkmk - 04.11.2014, 16:36
Re: need help with /setadmin command ! fast - by DavidBilla - 04.11.2014, 17:23
Re: need help with /setadmin command ! fast - by Toxik - 04.11.2014, 17:28
Re: need help with /setadmin command ! fast - by iShawn - 04.11.2014, 17:54
Re: need help with /setadmin command ! fast - by Stinged - 04.11.2014, 18:02
Re: need help with /setadmin command ! fast - by DavidBilla - 04.11.2014, 18:03
Re: need help with /setadmin command ! fast - by mkmk - 04.11.2014, 18:39

Forum Jump:


Users browsing this thread: 1 Guest(s)