need help with /setadmin command ! fast
#8

There is no difference between %i and %d.
This should work.
pawn Код:
CMD:setadmin(playerid, params[])
{
    if (PlayerInfo[playerid][Admin] >= 5)
    {
        new id, level;
        if (sscanf(params,"ui", id, level))
            return SendClientMessage(playerid, -1, "Usage: /setadmin <id/name> <level>");
        if (id == INVALID_PLAYER_ID))
            return SendClientMessage(playerid, -1, "Invalid playerid.");
                if (level < 0 || level > 5)
                    return SendClientMessage(playerid, -1, "Admin levels are between 0 and 5 only.");
           
        new string[66];
       
        GetPlayerName(playerid, string, sizeof (string));
        format(string, sizeof (string), "Your admin level has been changed to %i by %s", level, string);
        SendClientMessage(id, -1, string);
       
        GetPlayerName(id, string, sizeof (string));
        format(string, sizeof (string), "Admin %s has changed your admin level to %i", string, level);
        SendClientMessage(playerid, -1, string);
       
        PlayerInfo[playerid][Admin] = level;
    }
    else
    {
        SendClientMessage(playerid, -1, "You are not allowed to use this command.");
    }
    return 1;
}
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)