amxmodx/plugins/lang
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
..
admin.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
adminchat.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
admincmd.txt Yet another Hungarian langugage revise (#816) 2020-05-29 01:13:38 +02:00
adminhelp.txt Yet another Hungarian langugage revise (#816) 2020-05-29 01:13:38 +02:00
adminslots.txt Improve AdminSlot plugin (#631) 2020-06-03 23:52:47 +02:00
adminvote.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
antiflood.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
cmdmenu.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
common.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
imessage.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
languages.txt European Portuguese Language translation support (#750) 2019-10-17 15:46:04 +02:00
mapchooser.txt Yet another Hungarian langugage revise (#816) 2020-05-29 01:13:38 +02:00
mapsmenu.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
menufront.txt Yet another Hungarian langugage revise (#816) 2020-05-29 01:13:38 +02:00
miscstats.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
multilingual.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
nextmap.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
pausecfg.txt Yet another Hungarian langugage revise (#816) 2020-05-29 01:13:38 +02:00
plmenu.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
restmenu.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
scrollmsg.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
stats_dod.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
statscfg.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
statsx.txt Yet another Hungarian langugage revise (#816) 2020-05-29 01:13:38 +02:00
telemenu.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
time.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00
timeleft.txt Turkish Translation Fixes/Addings (#862) 2020-05-29 00:51:14 +02:00