Add CheckHiddenSlots() Function

This commit is contained in:
stickz 2015-11-27 12:51:38 -05:00
parent 3e1ba143bf
commit 75484c02a0

View File

@ -85,18 +85,12 @@ public OnPluginEnd()
public OnMapStart()
{
if (sm_hide_slots.BoolValue)
{
SetVisibleMaxSlots(GetClientCount(false), GetMaxHumanPlayers() - sm_reserved_slots.IntValue);
}
CheckHiddenSlots();
}
public OnConfigsExecuted()
{
if (sm_hide_slots.BoolValue)
{
SetVisibleMaxSlots(GetClientCount(false), GetMaxHumanPlayers() - sm_reserved_slots.IntValue);
}
CheckHiddenSlots();
}
public Action:OnTimedKick(Handle:timer, any:client)
@ -108,10 +102,7 @@ public Action:OnTimedKick(Handle:timer, any:client)
KickClient(client, "%T", "Slot reserved", client);
if (sm_hide_slots.BoolValue)
{
SetVisibleMaxSlots(GetClientCount(false), GetMaxHumanPlayers() - sm_reserved_slots.IntValue);
}
CheckHiddenSlots();
return Plugin_Handled;
}
@ -198,10 +189,7 @@ public OnClientPostAdminCheck(client)
public OnClientDisconnect_Post(client)
{
if (sm_hide_slots.BoolValue)
{
SetVisibleMaxSlots(GetClientCount(false), GetMaxHumanPlayers() - sm_reserved_slots.IntValue);
}
CheckHiddenSlots();
if (g_isAdmin[client])
{
@ -237,6 +225,14 @@ public SlotHideChanged(ConVar convar, const String:oldValue[], const String:newV
}
}
CheckHiddenSlots()
{
if (sm_hide_slots.BoolValue)
{
SetVisibleMaxSlots(GetClientCount(false), GetMaxHumanPlayers() - sm_reserved_slots.IntValue);
}
}
SetVisibleMaxSlots(clients, limit)
{
new num = clients;