11.07.2011, 22:02
(
Last edited by Unte99; 12/07/2011 at 12:01 AM.
)
Kick command:
EDIT: If it works, delete the else's and the brackets in the ban command. In your case, the else means if the player didn't use the command.
pawn Code:
CMD:kick(playerid, params[])
{
new Targetplayer;
new string[168];
new Reason[288];
new Year, Month, Day;
getdate(Year, Month, Day);
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0x8A4117FF, "Server: You are not an Adminstrator to use this command.");
if (sscanf(params, "uz", Targetplayer,Reason)) return SendClientMessage(playerid, 0x8A4117FF, "Server: /Kick (PlayerID/PartOfName) (Reason).");
if (Targetplayer == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0x8A4117FF, "Server: Player not found.");
Kick(Targetplayer);
format(string, sizeof(string),"Server: Adminstrator %s Kicked %s Reason: %s | Date: %02d/%02d/%d.",playerid,Targetplayer,Reason,Month,Day,Year);
SendClientMessageToAll(0x8A4117FF,string);
return 1;
}