AMX Mod X - Half-Life 1 Scripting and Administration
Go to file
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
.github Add CONTRIBUTING and ISSUE_TEMPLATE (#534) 2018-09-02 20:35:42 +02:00
amxmodx Add menu_item_setaccess native (#826) 2020-05-29 21:40:35 +02:00
compiler Port bugfix for incorrect heap deallocation on conditional operator (#627) 2018-11-02 14:15:31 +01:00
configs Move hamdata.ini to gamedata (#597) 2018-09-28 16:51:54 +02:00
editor/studio Add elog_message native (#451) 2017-08-01 15:14:53 +02:00
gamedata Update gamedata for all supported mods (#771) 2019-10-21 11:49:30 +02:00
installer Move hamdata.ini to gamedata (#597) 2018-09-28 16:51:54 +02:00
modules Fix broken DoD Fun module natives (#851) 2020-05-29 00:54:36 +02:00
plugins Improve AdminSlot plugin (#631) 2020-06-03 23:52:47 +02:00
public Bump ReHLDS API version to 3.6 (#721) 2019-05-16 14:55:41 +02:00
support Add new plugin defines regarding the AMX Mod X version (#723) 2019-10-17 18:55:05 +02:00
third_party Fix behavior change about endianness check in maxmind/libmaxminddb#123 (#770) 2019-10-20 23:21:57 +02:00
tools Normalize line endings and whitespace 2016-01-16 21:15:52 -03:00
.gitattributes Add gitattributes 2015-03-10 11:11:49 +02:00
.gitignore Build assembly files with AMBuild. (#481) 2018-08-26 20:28:25 +02:00
.gitmodules Use upstream AMTL as a submodule 2015-03-09 22:53:58 +01:00
.travis.yml Build assembly files with AMBuild. (#481) 2018-08-26 20:28:25 +02:00
AMBuildScript String changes for missing path exception messages (#718) 2019-05-14 00:37:49 +02:00
appveyor.yml Fix MySQL connector link (#844) 2020-03-04 21:10:41 +01:00
configure.py Build assembly files with AMBuild. (#481) 2018-08-26 20:28:25 +02:00
product.version Bump version 2018-09-11 00:48:15 +02:00
pushbuild.txt Another stab at Windows build fix. 2018-09-09 07:40:58 -04:00
README.md Updated readme (#539) 2018-09-04 19:31:23 +02:00

AMX Mod X is a Metamod plugin for Half-Life 1. It provides comprehensive scripting for the game engine and its mods. Scripts can intercept network messages, log events, commands, client commands, set cvars, modify entities, and more. AMX Mod X also has a system for extending native scripting through modules, leading to outside support for things like MySQL and Sockets.

General

Development