fixed bug amb795 - reservedslots could crash
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401357
This commit is contained in:
parent
ee6f77d05f
commit
1f04ba166a
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user