27.01.2015, 13:36
I wanted to make a kick command with timer, but I can't make the unkick public function. Can you edit the script below to make it work properly? I'd be grateful.
pawn Код:
CMD:kick(playerid, params[])
{
new targetid, minutes, reason[128], string[128];
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "Player is not connected to the server");
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, "Command not found on server! /help");
if(sscanf(params,"uis[128]", targetid, minutes, reason)) return SendClientMessage(playerid, COLOR_RED, "Kick: /Kick (id) (minutes) (reason)");
format(string, sizeof(string), "Administrator %s kicked %s for %d minutes: %s", PlayerName(playerid), PlayerName(targetid), minutes, reason);
SendClientMessageToAll(COLOR_RED, string);
Ban(targetid);
KickTimer = SetTimerEx("Unkick", minutes*60000, false, "i", targetid);
kicked[targetid] = true;
return 1;
}
public Unkick(playerid)
{
new string[128], ip[16];
format(string,sizeof(string),"unbanip %f",ip);
SendRconCommand(format);
kicked[playerid] = false;
return 1;
}