Anything wrong with this command ?
#1

Hello guys i have made this command but the problem is when i type /setadmin 1 3 in game it just sets the player with the lowest id 0 as an admin not only this but some other commands have same problem can someone explain why and how can i fix it
pawn Код:
CMD:setadmin(playerid, params[])
{
    if(IsPlayerAdmin(playerid) | PlayerInfo[playerid][pAdmin] >= 3)
    {
        new pID;
        new Level;
        new string[128];
        new pName[MAX_PLAYER_NAME];
        new aName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, aName, sizeof(aName));
        GetPlayerName(pID, pName, sizeof(pName));
        if(sscanf(params, "ui", pID, Level)) return SendClientMessage(playerid, -1, "[USAGE] /setadmin [playerid] [level]");
        if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, -1, "[ERROR] The Player You Want To Make Admin Is Not Connected");
        format(string, sizeof(string), "Admin %s Has Made %s An Admin Level %d", aName, pName, Level);
        SendClientMessageToAll(-1, string);
        PlayerInfo[pID][pAdmin] = Level;
    }
    else return SendClientMessage(playerid, -1, "You Are Not Authorized To Use That Command");
    return 1;
}
Reply


Messages In This Thread
Anything wrong with this command ? - by Glint - 28.07.2012, 09:07
Re: Anything wrong with this command ? - by [BK]TrollKing - 28.07.2012, 09:10
Re: Anything wrong with this command ? - by Akira297 - 28.07.2012, 09:10
Re: Anything wrong with this command ? - by Glint - 28.07.2012, 09:13
Re: Anything wrong with this command ? - by Akira297 - 28.07.2012, 09:14
Re: Anything wrong with this command ? - by [BK]TrollKing - 28.07.2012, 09:15
Re: Anything wrong with this command ? - by Glint - 28.07.2012, 09:17
Re: Anything wrong with this command ? - by Akira297 - 28.07.2012, 09:20
Re: Anything wrong with this command ? - by sleepysnowflake - 28.07.2012, 09:21
Re: Anything wrong with this command ? - by Glint - 28.07.2012, 09:34

Forum Jump:


Users browsing this thread: 1 Guest(s)