SA-MP Forums Archive
Kick Delays. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Kick Delays. (/showthread.php?tid=571767)



Kick Delays. - ChuckyBabe - 22.04.2015

I just want to know how to delay a kick for a example using a timer. Here is my forward and public

Код:
forward kickdelays();
public kickdelays(playerid) { Kick(playerid); }
KICK CMD

Код:
CMD:kick(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
		new string[128], giveplayerid, reason[64];
		if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid/partofname] [reason]");

		if(IsPlayerConnected(giveplayerid))
		{
			if(PlayerInfo[giveplayerid][pAdmin] < PlayerInfo[playerid][pAdmin]) {
				new playerip[32];
				GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
				format(string, sizeof(string), "AdmCmd: %s (IP:%s) was kicked by %s, reason: %s", GetPlayerNameEx(giveplayerid), playerip, GetPlayerNameEx(playerid), reason);
				Log("logs/kick.log", string);
				format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
				SendClientMessageToAllEx(COLOR_LIGHTRED, string);
    			SetTimer("kickdelays", 1000, false); // Set a timer of 1000 miliseconds (1 second)
			}
			return 1;
		} else SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified.");
	}

	return 1;
}
Error code.

Код:
C:\Users\Windows7\Desktop\Microsoft Corporation ©\replace\Irish Verse\gamemodes\IVRP.pwn(74459) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Kick Delays. - [KHK]Khalid - 22.04.2015

https://sampwiki.blast.hk/wiki/Kick

It's
pawn Код:
SetTimerEx("kickdelays", 1000, false, "i", playerid);



Re: Kick Delays. - ChuckyBabe - 22.04.2015

Quote:
Originally Posted by [KHK]Khalid
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/Kick

It's
pawn Код:
SetTimerEx("kickdelays", 1000, false, "i", playerid);
Woah ! Thanks.


Re: Kick Delays. - Threshold - 22.04.2015

forward kickdelays();

Should be

forward kickdelays(playerid);