From 7b96b4df22b5ff5c0d55c3c23b6141baac58c868 Mon Sep 17 00:00:00 2001 From: Arkshine Date: Sun, 20 Jul 2014 12:56:59 +0200 Subject: [PATCH] Remove unecessary variable. --- plugins/adminslots.sma | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/plugins/adminslots.sma b/plugins/adminslots.sma index 6d8dca36..65190c8a 100755 --- a/plugins/adminslots.sma +++ b/plugins/adminslots.sma @@ -38,7 +38,6 @@ new g_ResPtr new g_HidePtr new g_sv_visiblemaxplayers -new g_maxplayers public plugin_init() { @@ -48,7 +47,6 @@ public plugin_init() g_ResPtr = register_cvar("amx_reservation", "0") g_HidePtr = register_cvar("amx_hideslots", "0") g_sv_visiblemaxplayers = get_cvar_pointer("sv_visiblemaxplayers") - g_maxplayers = MaxClients } public plugin_cfg() @@ -60,14 +58,14 @@ public MapLoaded() { if (get_pcvar_num(g_HidePtr)) { - setVisibleSlots(get_playersnum(1), g_maxplayers - get_pcvar_num(g_ResPtr)) + setVisibleSlots(get_playersnum(1), MaxClients - get_pcvar_num(g_ResPtr)) } } public client_authorized(id) { new players = get_playersnum(1) - new limit = g_maxplayers - get_pcvar_num(g_ResPtr) + new limit = MaxClients - get_pcvar_num(g_ResPtr) if (access(id, ADMIN_RESERVATION) || (players <= limit)) { @@ -83,7 +81,7 @@ public client_disconnect(id) { if (get_pcvar_num(g_HidePtr)) { - setVisibleSlots(get_playersnum(1) - 1, g_maxplayers - get_pcvar_num(g_ResPtr)) + setVisibleSlots(get_playersnum(1) - 1, MaxClients - get_pcvar_num(g_ResPtr)) } } @@ -91,8 +89,8 @@ setVisibleSlots(players, limit) { new num = players + 1 - if (players == g_maxplayers) - num = g_maxplayers + if (players == MaxClients) + num = MaxClients else if (players < limit) num = limit