24.02.2012, 00:26
pawn Код:
cmd(setadmin, playerid, params[])
{
new level;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an admin"); // If the player isn't an admin it will send him the message.
if(!sscanf(params, "ui", targetplayerid, level)) return SendClientMessage(playerid, -1, "/setadmin [playerid] [level]);
if(Level > 6 || 0 > Level) return SendClientMessage(playerid, -1, "Level 0-6");
isadmin[targetplayerid] = level; //isadmin will be the level you wrote in.
switch (isadmin[targetplayerid]
{
case 0: SendClientMessage(playerid, -1, "You have been removed from the admin team."); //If isadmin == 0 it will send him this message
case 1: SendClientMessage(playerid, -1, "You've been added to the admin team."); // If level 1 and so on this message will be set.
case 2: SendClientMessage(playerid, -1, "You've been added to the admin team.");
case 3: SendClientMessage(playerid, -1, "You've been added to the admin team.");
case 4: SendClientMessage(playerid, -1, "You've been added to the admin team.");
case 5: SendClientMessage(playerid, -1, "You've been added to the admin team.");
case 6: SendClientMessage(playerid, -1, "You've been added to the admin team.");
}
return 1;
}