18.03.2011, 03:51
pawn Code:
CMD:setadmin(playerid, params[])
{
new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], admlvl, id;
if(GetPVarInt(playerid, "Level") == 1)
{
if (sscanf(params, "ui", id, admlvl)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setadmin [id] [adminlevel]");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "This player is not connected");
if (admlvl > 3 || admlvl < 0) return SendClientMessage(playerid, COLOR_RED,"Invalid level");
SetPVarInt(id, "Level") = admlvl;// this line here is the fuckup
GetPlayerName(id, victimname, sizeof(victimname));
GetPlayerName(playerid, adminname, sizeof(adminname));
new stri[128];
format(stri,128,"AdmWarn: %s [ID %d] has set %s [ID %d] admin level to %i",adminname, playerid, victimname, id, admlvl);
SendClientMessageToAll(COLOR_GREEN,str);
return 1;
}else return SendClientMessage(playerid,COLOR_RED," You arent the level!");}