fixed bug amb795 - reservedslots could crash

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401357
This commit is contained in:
David Anderson 2007-08-18 22:51:25 +00:00
parent ee6f77d05f
commit 1f04ba166a

View File

@ -74,6 +74,20 @@ public OnConfigsExecuted()
}
}
public Action:OnTimedKick(Handle:timer, any:value)
{
new client = GetClientOfUserId(value);
if (!client || !IsClientInGame(client))
{
return Plugin_Handled;
}
KickClient(client, "%T", "Slot reserved", client);
return Plugin_Handled;
}
public OnClientPostAdminCheck(client)
{
new reserved = GetConVarInt(sm_reserved_slots);
@ -95,7 +109,7 @@ public OnClientPostAdminCheck(client)
}
/* Kick player because there are no public slots left */
KickClient(client, "%T", "Slot reserved", client);
CreateTimer(0.1, OnTimedKick, GetClientUserId(client));
}
}