20.11.2012, 16:02
pawn Код:
CMD:ban(playerid,params[])
{
new Target,Reason;
if(!sscanf(params,"us[124]",Target,Reason))
{
if(IsPlayerConnected(Target))
{
if(pInfo[Target][Admin] > pInfo[playerid][Admin])
{
SendClientMessage(playerid,-1,"WARNING: An error occured. [Reason: Banning higher level admins is forbidden.");
}
else
{
new String[124],Name[MAX_PLAYER_NAME];
GetPlayerName(Target,Name,sizeof(Name));
format(String,sizeof(String),"%s has been banned. [Reason: %s]",Name,Reason);
SendClientMessageToAll(-1,String);
Ban(Target);
}
}
else
{
SendClientMessage(playerid,-1,"WARNING: An error occured. [Reason: Player is not connected.");
}
}
else
{
SendClientMessage(playerid,-1,"USAGE: /Ban [Playerid] [Reason]");
}
return 1;
}