05.12.2011, 23:00
Untested, should work. Remember to add dcmd(kick,4,cmdtext); under OnPlayerCommandText.
pawn Код:
dcmd_kick(playerid,params[])
{
new string[128], aname[24], pname[24], id, reason[50];
if(sscanf(params,"us[50]",id,reason)) return SendClientMessage(playerid,-1,"USAGE: /kick [playerid] [reason]");
GetPlayerName(playerid,aname,24); // admin
GetPlayerName(id,pname,24); // target
if(IsPlayerConnected(id))
{
format(string,128,"Admin %s (%d) Has Kicked %s (%d). Reason: %s",aname,playerid,pname,playerid, reason);
print(string); // print to console
SendClientMessageToAll(-1,string);
Kick(id);
}
return 1;
}