14.02.2012, 16:04
oh, I had the same issue sometimes with the || on if statement.
Then replace it with this and I am sure it will work.
Then replace it with this and I am sure it will work.
pawn Код:
CMD:makeadmin( playerid, params[ ] )
{
new id, AdminLevel2;
if( PlayerInfo[ playerid ][ AdminLevel ] >= 5 || PlayerInfo[ playerid ][ AdminLevel ] <= 5 && IsPlayerAdmin( playerid ) )
{
if( sscanf( params, "ri", id, AdminLevel2 ) ) return SendClientMessage( playerid, COLOR_DARKGOLD, "USAGE: /makeadmin [PlayerId/PartOfName] [Admin Level]" );
if( AdminLevel2 < 0 || AdminLevel2 > 5 ) return SendClientMessage(playerid, COLOR_DARKGOLD, "Avaliable Levels: 0, 1, 2, 3, 4 and 5.");
new string[128]; new Name[MAX_PLAYER_NAME]; new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s Has Given You %d Admin Level.", Name, AdminLevel2);
SendClientMessage(id, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You Gave %d Admin Level To %s.", AdminLevel2, PlayerName);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
PlayerInfo[id][AdminLevel] = AdminLevel2;
}
else NotAdmin( playerid );
return 1;
}