05.04.2013, 20:34
Not tested.
edit: I think you might actually be able to do this:
edit: I think you might actually be able to do this:
pawn Код:
CMD:setadmin(playerid, params[])
{
new id, adminlevel,MyRank[32],HisRank[32],MyName[32],HisName[32];
if(PlayerInfo[playerid][pAdmin] <= 4) return SendClientMessage(playerid, COLOR_SILVER, "You must be atleast a Community Owner to use this command!");
else if(sscanf(params, "ud", id, adminlevel)) return SendClientMessage(playerid, COLOR_SILVER, "Syntax: /setadmin [PlayerID][Admin Level]");
else if(adminlevel < 0 || adminlevel > 5) return SendClientMessage(playerid, COLOR_SILVER, "Error: Must be level 1-5!");
else
{
if(PlayerInfo[id][pAdmin] == adminlevel) return SendClientMessage(playerid, COLOR_SILVER, "Error: This player is already that level!");
else
{
GetPlayerName(playerid,MyName,32);
GetPlayerName(id,HisName,32);
PlayerInfo[id][pAdmin] = adminlevel;
if(PlayerInfo[playerid][pAdmin] == 1){MyRank = "Moderator";}
if(PlayerInfo[playerid][pAdmin] == 2){MyRank = "Trial Administrator";}
if(PlayerInfo[playerid][pAdmin] == 3){MyRank = "Administrator";}
if(PlayerInfo[playerid][pAdmin] == 4){MyRank = "Lead Administrator";}
if(PlayerInfo[playerid][pAdmin] == 5){MyRank = "Community Owner";}
if(adminlevel == 3)
{
new string[128];
format(string, sizeof(string), "[AdmCmd] %s %s(ID:%d) had made %s(ID:%d) an Administrator",MyRank,MyName,playerid,HisName,id);
SendClientMessageToAll(COLOR_YELLOW,string);
}
}
}
return 1;
}