Commit Graph

37 Commits

Author SHA1 Message Date
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
3568fb8747 Add client_remove() forward and fix a bug with client not internally disconnected (#414)
* Rename client_disconnected to client_disconnecting

* Add client_disconnected as post forward

* Fix client not properly disconnected internally

Introduced in #264.
Edict is reset once SV_DropClient is called, so that second check would be always false.

* Reflect changes on the concerned plugins

* Revert renaming, let's add only client_remove as post forward
2017-02-25 11:50:52 +01:00
ed4faf7c11 Fix player not being internally disconnected in some situation + add client_disconnected forward 2015-08-14 00:08:50 +02:00
f787db1be5 Update license headers for plugins and includes. 2014-08-04 13:18:41 -05:00
0e0d7ec9d5 Instead of assigning FCVAR_PROTECTED to cvars after startup, register cvars with said flag 2014-07-29 00:33:08 +03:00
7b96b4df22 Remove unecessary variable. 2014-07-20 12:56:59 +02:00
07534edfcd Use the new constants in various place. 2014-07-20 12:27:02 +02:00
16b2721c2a Apply general optimizations in adminslots plugin (bug 5831, r=arkshine)
Former-commit-id: 1ea1766188a73cb80a50396fb2b88e11c88bc1e1
2013-08-05 18:26:57 +02:00
121dc75451 Directly kick players rather than use a loopback command (bug 3884, r=dvander).
Former-commit-id: dfe1903ecf4faa49b83b85213aa0fbc083fbb0c2
2013-02-13 00:15:40 -08:00
71065a65dd attempted merge at 1.77 back into trunk... Oh MY GOD 2007-03-09 03:04:40 +00:00
35a96176fa Fixed bug am43881: hideslots not working on first map 2006-09-01 01:40:37 +00:00
b34557b839 fixed bug at27878 2006-04-19 02:52:39 +00:00
ef5437fec3 a working adminslots 2006-03-19 21:25:18 +00:00
880cb401fb fixed bug at26340 (NiLuJe) 2006-03-13 14:35:26 +00:00
eb7a49f6d4 fixed awful cvar bug, amx_reservedslots (which wasn't registered by the plugin) was used in the code instead of amx_reservation 2006-03-06 15:27:30 +00:00
85c37c6a39 merged in marticus's changes 2006-02-27 09:22:03 +00:00
e27c0b205f (Marticus)
-Added documentation and cleaned up the code
-Created amx_hideslots cvar to replace #define HIDE_RESERVED_SLOTS
-Removed ackSignal *sigh* and the horribly coded setVisibleSlots function
-Removed client disconnect
-Created global variable gPlayerLimit to be used in both functions
-Moved set cvar sv_visiblemaxplayers to plugin_init
2006-01-07 00:54:40 +00:00
1a48ebb345 format fixes 2005-11-21 20:31:18 +00:00
ddf3b6df32 new cleaned-up version of the plugins (no more OLOcode :D) 2005-09-12 21:06:24 +00:00
c1f2a499f8 fixed compiling error (by FireStorm) 2004-11-20 21:34:22 +00:00
d14c107db1 Fixed some include bugs
Fixed adminslots not showing right slots on connect
Fixed RTEs on wrong team
2004-09-19 00:52:15 +00:00
94474b57c1 added dictionary common.txt 2004-08-06 18:44:37 +00:00
0be7ddcbd9 updated to use the multi-lingual system | better code style 2004-08-03 20:11:16 +00:00
4fccdd676b use AMXX_VERSION_STR 2004-07-30 23:39:39 +00:00
ef11026195 removed WON support
fixed some bugs
2004-07-19 14:33:17 +00:00
4ab6b083c1 Updated version numbers.
Fixed Condition-Zero support.
Replaced Stats with StatsX.
2004-06-24 08:10:52 +00:00
eaf5384522 fixed if NO_STEAM is defined 2004-03-27 22:13:41 +00:00
079f824a81 updated version information 2004-03-24 08:30:08 +00:00
1425615e20 Fixed headers. 2004-03-15 21:05:08 +00:00
9f6b206881 compatible to new include files 2004-03-07 14:30:53 +00:00
4b81034f81 updated includes 2004-03-05 19:35:38 +00:00
3ba4ece791 removed AMX_VERSION_STR 2004-02-21 20:58:35 +00:00
8c6374567a updated header 2004-02-21 19:36:35 +00:00
0b742e54bd kicking reason is displayed (Steam) 2004-02-13 21:20:59 +00:00
c3da720704 updated header | fixed compiler errors 2004-02-11 19:32:01 +00:00
51fe5a4822 changed header and version info 2004-02-01 18:45:44 +00:00
9e999a0ba6 Initial revision 2004-01-31 20:56:22 +00:00