24.08.2012, 09:29
And if you want my command that sets admins, I have made a customized one by myself, here it is:
I don't think it has any problem though.
pawn Код:
CMD:setadmin(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new targetid, level, adminrank[32];
new sendername[32], string[128];
if(sscanf(params, "uis[128]", targetid, level, adminrank))
{
SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setadmin <playerid> <level> <Admin Rank Name>");
return 1;
}
if(level > 5 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "> Don't go below 0 or higher then 5!"); return 1; }
if(IsPlayerConnected(targetid))
{
//new ranktext[32];
/*if(PlayerInfo[targetid][pAdmin] == 5) { ranktext = "Trial Admin"; }
else if(PlayerInfo[targetid][pAdmin] == 4) { ranktext = "Basic Admin"; }
else if(PlayerInfo[targetid][pAdmin] == 3) { ranktext = "Lead Admin"; }
else if(PlayerInfo[targetid][pAdmin] == 2) { ranktext = "Head Admin"; }
else if(PlayerInfo[targetid][pAdmin] == 1) { ranktext = "Owner"; }
else { ranktext = "Trial Admin"; }*/
PlayerInfo[targetid][pAdmin] = level;
SavePlayerStats(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string),"> Admin %s has promoted you to a %s(Admin Level:%i)", sendername, adminrank, level);
SendClientMessage(targetid, 0xFFFFFFFF, string);
}
}
else return SendClientMessage(playerid, 0xFFFFFFFF, "Only Admins can perform this action.");
return 1;
}