Set admin
#1

Hey guys, so I am having a problem.So I made a set admin command for rcon admins
pawn Код:
CMD:rmakeadmin(playerid, params[]) // CMD for making someone an admin...
{
    new pid;
    new alevel;
    new str[128];
    if(sscanf(params,"ui", pid, alevel)) return SendClientMessage(playerid, -1, "USAGE: /rmakeadmin [playerid] [admin level]");
    if (IsPlayerAdmin(playerid))
    {
        if((alevel<=5)&&(alevel>=1))
        {
            if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player specified !");
            format(str, sizeof(str), "* You have promoted player %s to a level %i admin.", GetName(pid), alevel);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
            format(str, sizeof(str), "* You have been promoted to a level %i admin by a Administrator.", alevel);
            SendClientMessage(pid, COLOR_LIGHTBLUE, str);
            PlayerInfo[pid][pAdmin] = alevel;
        }
        else SendClientMessage(playerid, COLOR_GREY, "  Invalid admin level specified (Admin Level 1-5)");
    }
    else SendClientMessage(playerid, COLOR_GREY, "  You are not authorized to use this command !");
    return 1;
}
So about this, when I /rmakeadmin while logged in RCON. I type /rmakeadmin [then my id here] 5
Also the highest level admin is 5.But then when I type in the command, It says like the player is not connected.I'm the only player connected which is ID 0, isn't this code correct?
I really need help.
Reply


Messages In This Thread
Set admin - by JustinAn - 27.07.2012, 20:37
Re: Set admin - by rVar - 27.07.2012, 20:43
Re: Set admin - by JustinAn - 27.07.2012, 20:47
Re: Set admin - by JustinAn - 27.07.2012, 20:57
Re: Set admin - by Marlon_Lorran - 27.07.2012, 21:01
Re: Set admin - by JustinAn - 27.07.2012, 21:12

Forum Jump:


Users browsing this thread: 2 Guest(s)