amxmodx/plugins
Vincent Herbet 6d6a41b894
Improve AdminSlot plugin (#631)
* Adminslot: Trim spaces

* Adminslot: Use semicolon everywhere

* Adminslot: Use brackets everywhere

* Adminslot: Hook cvars change and make sure max visible players is set right away

* Adminslot: Rename g_sv_visiblemaxplayers

* Adminslot: Move free slot calculation in its own function

* Adminslot: Use create_cvar and define appropriate bounds

* Adminslot: Use get_playersnum_ex with flag for clarity

* Adminslot: Move all the logic inside setVisibleSlots

Looks like the commit should have been split for clarity.

The initial purpose is to avoid code duplication and regroup checks.
The logic is the same with a little improvement to handle situations where a cvar is changed on-the-fly and sv_visiblemaxplayers needs to be reset.

Ultimately, the logic is the following:

 - At player's connection:
 -- Do nothing if amx_reservation == 0 and sv_visiblemaxplayers <= 0. If sv_visiblemaxplayers is set, we reset it directly.
 -- Check if player needs to be kicked. If not, and amx_hideslots == 0, then do nothing.
 -- Otherwise we update sv_visiblemaxplayers

 - Others events:
 -- Do nothing if either amx_reservation == 0 or amx_hideslots == 0, and if sv_visiblemaxplayers <= 0. If sv_visiblemaxplayers is set, we reset it directly.
 -- Otherwise we update sv_visiblemaxplayers

* Adminslot: Rename variables and adjust constantness

* Adminslot: Add a description to the cvars

* Adjust CVAR_HIDESLOTS english sentence

* Add the Deutsch translations
2020-06-03 23:52:47 +02:00
..
BinLogReader Update copyright year 2015-03-29 20:01:25 +02:00
cstrike Fix string incorrectly formatted in CS Misc Stats plugin (#704) 2019-04-30 09:59:15 +02:00
dod Add stat constants in plugins (#522) 2018-08-30 18:41:49 +02:00
esf Added Corona Byte's EvolutionX core 2005-08-24 06:13:55 +00:00
include Add menu_item_setaccess native (#826) 2020-05-29 21:40:35 +02:00
lang Improve AdminSlot plugin (#631) 2020-06-03 23:52:47 +02:00
ns Remove support for %name% replacement in plmenu (bug 6578). 2017-01-21 22:58:03 -05:00
testsuite Introduce a JSON module (#379) 2017-09-30 20:23:12 +02:00
tfc Add stat constants in plugins (#522) 2018-08-30 18:41:49 +02:00
ts Add stat constants in plugins (#522) 2018-08-30 18:41:49 +02:00
admin.sma AutoExecConfig: Remove config code in admin.sma 2015-08-14 16:38:28 +02:00
adminchat.sma Fix admin chat displaying the wrong language (#559) 2018-09-11 20:19:28 +02:00
admincmd.sma admincmd.sma exploits fix (#822) 2020-05-29 01:10:38 +02:00
adminhelp.sma Add amx_searchcmd command in adminhelp plugin and do some clean up (#415) 2017-08-01 22:56:21 +02:00
adminslots.sma Improve AdminSlot plugin (#631) 2020-06-03 23:52:47 +02:00
adminvote.sma adminvote.sma exploit fix (#823) 2020-05-29 01:04:16 +02:00
AMBuilder Compiler: Treat pawn warnings as errors when building 2014-09-29 15:55:16 +02:00
antiflood.sma MAX_PLAYERS: Fix plugins 2015-02-01 19:25:36 +01:00
cmdmenu.sma Update cmdmenu.sma 2015-05-17 19:50:42 +03:00
compile.exe Fixed error output on compiler 2005-07-30 00:31:42 +00:00
compile.sh Fix compile.sh script for OS X. 2014-05-18 20:37:44 -05:00
imessage.sma fix memory leaks 2015-07-11 00:39:34 +03:00
mapchooser.sma fix memory leaks 2015-07-11 00:39:34 +03:00
mapsmenu.sma fix memory leaks 2015-07-11 00:39:34 +03:00
menufront.sma Update menufront.sma 2015-02-23 02:21:20 +05:00
multilingual.sma Fix player not being internally disconnected in some situation + add client_disconnected forward 2015-08-14 00:08:50 +02:00
nextmap.sma Rename change_level to engine_changelevel 2015-01-23 16:55:16 +01:00
pausecfg.sma MAX_PLAYERS: Fix plugins 2015-02-01 19:25:36 +01:00
plmenu.sma Replace s/get_pdata* with s/get_ent_data* in plmenu.sma (#424) 2017-03-11 14:58:10 +01:00
pluginmenu.sma Fix back/next/exit buttons not translated in plugin's cvar/command menus (#667) 2019-01-30 15:57:54 +01:00
scrollmsg.sma Update license headers for plugins and includes. 2014-08-04 13:18:41 -05:00
statscfg.sma MAX_PLAYERS: Fix plugins 2015-02-01 19:25:36 +01:00
telemenu.sma MAX_PLAYERS: Fix moar 2015-02-01 21:45:16 +01:00
timeleft.sma MAX_PLAYERS: Fix plugins 2015-02-01 19:25:36 +01:00