03.01.2013, 21:12
pawn Код:
CMD:setadmin(playerid, params[])
{
if(!IsPlayerAdmin(playerid))return 0;
if(sscanf(params,"ui",ID,levels)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /setadmin [ID] [Level 1-4]");
if(levels > 5) return SendClientMessage(playerid,0xFF0000FF,"LEVELS AVAILABLE 1-5!");
if(!IsPlayerConnected(ID))return SendClientMessage(playerid,red,"That user is not currently connected.");
if(PlayerData[ID][AdminLevel] == levels) return SendClientMessage(playerid,0xFF0000FF, "ERROR: That user is already that level!");
GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);
GetPlayerName(ID,pname,MAX_PLAYER_NAME);
if(levels == 0)
{
format(str, sizeof(str),"%s has changed your Admin level to %d on the server.",Nam,levels);
SendClientMessage(ID,0xFF9900AA,str);
format(str, sizeof(str),"You had set %s Admin level to %d!",pname,levels);
SendClientMessage(playerid,0xFF9900AA,str);
PlayerData[ID][AdminLevel] = levels;
return 1;
}
CMD:akill(playerid,params[])
{
if(PlayerData[playerid][AdminLevel] < 1) return 0;
if(sscanf(params,"u",ID)) return SendClientMessage(playerid,grey,"USAGE: /akill [playerid / Partofname]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red,"ERROR: That user is not currently connected!");
GetPlayerName(playerid,Nam,sizeof(Nam));
GetPlayerName(ID,pname,sizeof(pname));
format(str,sizeof(str),"Administrator %s has been killed by an admin.",Nam);
SendClientMessage(ID,orange,str);
format(str,sizeof(str),"You have admin killed %s",pname);
SendClientMessage(playerid,orange,str);
SetPlayerHealth(ID,0);
return 1;
}