18.07.2012, 13:49
@too late.
pawn Код:
CMD:kick(playerid,params[])
{
new id, reason[60];
if(!IsPlayerAdmin(playerid) && Player[playerid][Admin] < 4) return SendClientMessage(playerid, red, "ERROR: {FFFFFF}You Have Entered An Invalid Command. Read {00FF00}/CMDS{FFFFFF}.");
if(sscanf(params,"us[60]",id,reason)) return SendClientMessage(playerid, red, "SYNTAX ERROR: {00FF00}/KICK {FFFF00}<PlayerID> <Reason>");
if(strlen(reason) > 60) return SendClientMessage(playerid, red, "ERROR: {FFFFFF}Reason Must Be Below 60 Characters.");
if(!strlen(reason)) return SendClientMessage(playerid,-1,"You must put a reason");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, red, "ERROR: {FFFFFF}Player Is Not Connected.");
new string[134], string2[177];
if(Player[playerid][Hidden] == 0)
{
format(string,sizeof(string),"You Have Been Kicked By Administrator %s | Reason: %s", pName(playerid), reason);
format(string,sizeof(string),"Player %s Has Been Kicked From The Server By Administrator %s | Reason: %s",pName(id),pName(playerid),reason);
}
else
{
format(string,sizeof(string),"You Have Been Kicked From The Server | Reason: %s", reason);
format(string2,sizeof(string2),"Player %s Has Been Kicked From The Server | Reason: %s",pName(id),reason);
}
SendClientMessage(id, red, string);
SendClientMessage(id, orange, "If You Think This Is A Mistake Or You Are Being Treated Unfairly, Post A Report At 'WWW.AWPGAMING.COM/FORUMS'");
format(string,sizeof(string),"You Have Kicked %s From The Server | Reason: %s", pName(id), reason);
SendClientMessage(playerid, yellow, string);
format(string,sizeof(string),"Administrator %s Has Kicked Player %s | Reason: %s",pName(playerid), pName(id), reason);
Kick(id);
SendClientMessageToAll(red,string2);
return 1;
}