setlevel
#1

I got this:

pawn Код:
CMD:setlevel(playerid, params[])
{
    new levels,Nam[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME],str[128],ID;
    if(!IsPlayerAdmin(playerid))return 0;
    if(sscanf(params,"ui",ID,levels)) return SendClientMessage(playerid, RED, "USAGE: /setlevel <ID> <Level 1-5>");
    if(levels > 5) return SendClientMessage(playerid, RED,"ERROR: Levels Available 1-5");
    if(!IsPlayerConnected(ID))return SendClientMessage(playerid, RED,"ERROR: Player is not connected.");
    if(PlayerData[ID][AdminLevel] == levels) return SendClientMessage(playerid, RED, "ERROR: Player is already this admin level.");
    GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);
    GetPlayerName(ID,pname,MAX_PLAYER_NAME);
    if(levels == 0)
    {
        format(str, sizeof(str),"%s has set your Admin level to %d.",Nam,levels);
        GameTextForPlayer(playerid, "~g~PROMOTED", 3000, 4);
        SendClientMessage(ID,GREEN,str);
        format(str, sizeof(str),"You had set %s Admin level to %d.",pname,levels);
        SendClientMessage(playerid,ORANGE,str);
        PlayerData[ID][AdminLevel] = levels;
        return 1;
    }
    format(str, sizeof(str),"%s has set your Admin level to %d.",Nam,levels);
    GameTextForPlayer(playerid, "~y~DEMOTED", 3000, 4);
    SendClientMessage(ID,YELLOW,str);
    format(str, sizeof(str),"You had set %s Admin level to %d",pname,levels);
    SendClientMessage(playerid,ORANGE,str);
    PlayerData[ID][AdminLevel] = levels;
    return 1;
}
the problem is that when i do /setlevel ID LEVEL, it always appears "DEMOTED" it does never appears promoted, pls help me !!
Reply


Messages In This Thread
setlevel - by MiGu3X - 11.02.2013, 23:16
Re: setlevel - by MP2 - 11.02.2013, 23:54
Respuesta: setlevel - by MiGu3X - 12.02.2013, 00:24
Re: setlevel - by MP2 - 12.02.2013, 00:33
Respuesta: setlevel - by MiGu3X - 12.02.2013, 00:34
Re: setlevel - by MP2 - 12.02.2013, 00:53
Respuesta: setlevel - by MiGu3X - 12.02.2013, 01:05
Re: setlevel - by MP2 - 12.02.2013, 01:08
Respuesta: setlevel - by MiGu3X - 12.02.2013, 01:25
Re: setlevel - by MP2 - 12.02.2013, 02:07

Forum Jump:


Users browsing this thread: 1 Guest(s)