Make admin command doesn't work
#1

pawn Код:
CMD:makeadmin(playerid, params[])
{
    new ID;
    new lvl;
    new string[128];
    new lvlname[50];

    if(lvl == 0) return lvlname = "Not Admin";
    if(lvl == 1) return lvlname = "Moderator";
    if(lvl == 2) return lvlname = "Junior Administrator";
    if(lvl == 3) return lvlname = "Senior Administrator";
    if(lvl == 4) return lvlname = "Executive Administrator";
    if(lvl == 5) return lvlname = "Owner";
    if(sscanf(params, "ui", ID, lvl))
    {
        SendClientMessage(playerid, COLOR_RED, "USAGE: /makeadmin [PlayerID/Name] [Level]");
        return 1;
    }
    else
    {
        if(pInfo[playerid][Admin] >= 5 || IsPlayerAdmin(playerid))
        {
            if(IsPlayerConnected(ID))
            {
                if(pInfo[ID][Admin] != lvl)
                {
                    format(string, sizeof(string), "Promoted to~n~~w~Admin Level %d", lvl);
                    if(pInfo[ID][Admin] < lvl)
                    {
                        format(string, sizeof(string), "~g~Promoted to~n~~w~Admin Level %d", lvl);
                        GameTextForPlayer(playerid, string, 9000, 0);
                    }

                    if(pInfo[ID][Admin] > lvl)
                    {
                        format(string, sizeof(string), "~r~Demoted to~n~~w~Admin Level %d", lvl);
                        GameTextForPlayer(playerid, string, 9000, 0);
                    }
                    pInfo[ID][Admin] = lvl;
                    format(string, sizeof(string), "-| You have given %s(%d) admin level %d (%s) |-", GetName(ID), ID, lvl, lvlname);
                    SendClientMessage(playerid, COLOR_ADMIN, string);
                    format(string, sizeof(string), "-| Admin %s has given you admin level %d (%s) |-", GetName(playerid), lvl, lvlname);
                    SendClientMessage(ID, COLOR_ADMIN, string);
                }
                else
                {
                    SendClientMessage(playerid, COLOR_RED, "ERROR: Player is already that level.");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected. Use /adminoffline to set an offline player's level.");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a high enough level to use this command.");
        }
    }
    return 1;
}
When I try to use it in-game, nothing happens. No error message, no "unknown command" message, just nothing.

Any ideas?

Thanks.
Reply


Messages In This Thread
Make admin command doesn't work - by stormchaser206 - 24.09.2016, 02:54
Re: Make admin command doesn't work - by gurmani11 - 24.09.2016, 05:01
Re: Make admin command doesn't work - by stormchaser206 - 24.09.2016, 05:23

Forum Jump:


Users browsing this thread: 1 Guest(s)