13.07.2013, 09:50
when i type /setlevel 2 5. It always returns to the format.
When i even type /setlevel 0 4. It gives me the same results.
here is the code ↓
thank you.
When i even type /setlevel 0 4. It gives me the same results.
here is the code ↓
pawn Код:
//RCON COMMANDS
CMD:setadmin(playerid,params[])
{
new level, targetid;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You're not authorized to use that command!");
if(sscanf(params,"ui",targetid,level)) return SendClientMessage(playerid,-1,"USAGE: /setadmin [playerid] [level]");
if(level > 4) return SendClientMessage(playerid, COLOR_BRIGHTRED, "SERVER: Maximum Administrator level is 4.");
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_BRIGHTRED, "That player is not connected!");
new MyString[128];
new TargetString[128];
format(MyString,sizeof MyString, "Administrator level set.", targetid, level);
format(TargetString,sizeof TargetString, "You have been promoted to a Administrator. /help for more information");
SendClientMessage(targetid, COLOR_LIGHTCYAN, TargetString );
SendClientMessage(playerid, COLOR_GREEN, MyString);
PlayerInfo[targetid][pAdmin] = level;
return 1;
}