27.05.2013, 14:04
Here you are a working command:
NOTE: Make sure that you have sscanf and zcmd includes.
Define this on top of your script:
pawn Код:
CMD:kick(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new str[128], reason[64], targetid;
if(sscanf(params,"us", targetid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [Player ID] [Reason]");
{
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "SERVER: Player not connected");
SendClientMessageToAll(COLOR_RED, str);
Kick(targetid);
}
}
else SendClientMessage(playerid, COLOR_RED, "You do not have access to this command!");
return 1;
}
Define this on top of your script:
pawn Код:
#define C_WHITE 0xFFFFFFFF
#define COLOR_RED 0xFF0000FF