19.12.2011, 06:08
pawn Код:
CMD:setadmin(playerid,params[])
{
new id,level,n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME],string[128];
if(PlayerInfo[playerid][pAdmin] < 10) return 1;
if (sscanf(params,"ud",id,level)) return SendClientMessage(playerid,COLOR_RED,"Usage:/setadmin [ID] [Admin Level]");
if (!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
PlayerInfo[id][pAdmin] = level;//Here you had playerid instead of id
GetPlayerName(playerid,n,sizeof(n));
GetPlayerName(id,on,sizeof(on));
format(string,sizeof(string),"Your Admin Level Has Been Set To %d By %s ",level,n);
SendClientMessage(id,COLOR_ORANGE,string);
format(string, sizeof(string), "You have set %s Admin Level To %d",on,level);
SendClientMessage(playerid,COLOR_ORANGE,string);
//you had one additional Level setting here :S
return 1;
}