10.06.2016, 14:47
hello guys this cmd when i type /setlevel it demote me to level 0 before i type id and level
PHP код:
CMD:setlevel(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
new target,level,string[134];
if(sscanf(params,"ud",target,level)) SendClientMessage(playerid,-1,"USAGE: /setlevel [playerid] [0 - 5]");
if(level < 0 || level > 5) return SendClientMessage(playerid, COLOR_RED, "Max Admin Level [5]");
if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"**Player is not connected");
PlayerInfo[target][pAdmin] = level;
format(string,sizeof(string),"Administrator %s Has setted your Admin Level To %d",pName(playerid),level);
SendClientMessage(target,-1,string);
format(string,sizeof(string),"You have setted %s Level To %d",pName(target),level);
SendClientMessage(playerid,-1,string);
}
else
{
SendClientMessage(playerid,0xFF0000FF,"Only Level +5 can use this command");
}
return 1;
}