Server crashes when using a timer.
Codes:
if ( CheckBan( player ) == 1 ) NewTimer( "Kick", 5000, 1, player );
function Kick( player )
{
EMessage( "** [" + player.ID + "] " + player.Name + " has left the server( KICKED )." );
player.Kick();
}
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi62.tinypic.com%2F2vlli4y.jpg&hash=b26000d076577941224cfc59ed0f68b1f13d1ac8)
Known bug: https://bitbucket.org/stormeus/0.4-squirrel/issue/9/some-types-of-data-crash-timers
Use a wrapper function and pass an player ID instead of instance.
Locked.
I just want to point out that this would crash your server anyway if the player left in the five seconds it takes to kick them.
You can check if a player is still online by using a timer with player.ID instead of player, then using this in your Kick function:
function Kick(playerID) {
local player = FindPlayer(playerID);
if (player == null) {
return;
}
EMessage( [...]