Quote:
Originally Posted by [DOG]irinel1996
Well, sorry for bumping, maybe this helps:
pawn Код:
new kick_gTimer[MAX_PLAYERS];
stock CallDelayedKick(playerid) { KillTimer(kick_gTimer[playerid]); kick_gTimer[playerid] = SetTimerEx("DelayedKick", 1000, false, "i", playerid); return 1; }
forward DelayedKick(playerid); public DelayedKick(playerid) { if (!IsPlayerConnected(playerid)) return 1; Kick(playerid); return 1; }
Example:
pawn Код:
public OnPlayerConnect(playerid) { if (IsPlayerTroll(playerid)) { SendClientMessage(playerid, -1, "We sorry, we don't accept trolls there!"); CallDelayedKick(playerid); } return 1; }
|
Thanks for sharing that, I'll use it for my Anticheat, but then i've been wondering, on that 1000ms timer, A general spammer could still spam until the delayed kick is called. My question is, is it safe to use a 62ms timer to call the kick? Tested it and it works although i'm quite not sure if it would still be safe.