11.02.2013, 23:16
I got this:
the problem is that when i do /setlevel ID LEVEL, it always appears "DEMOTED" it does never appears promoted, pls help me !!
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;
}