Raised This Month: $32 Target: $400
 8% 

Player Threshold Configs


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Mister_Magotchi
SourceMod Donor
Join Date: Dec 2006
Location: Nampa, Idaho
Plugin ID:
1903
Plugin Version:
1.0
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Executes configs based on player count at round start if non-spectator, non-bot player count has crossed a configurable threshold
    Old 08-21-2010 , 15:40   Player Threshold Configs
    Reply With Quote #1

    Player Threshold Configs

    This plugin executes configs based on player count at round start if non-spectator, non-bot player count has crossed a configurable threshold.

    It is an extremely simple plugin, but I couldn't find anything that really does exactly this functionality. I've used it to replace other plugins that handle things like toggling alltalk on or off based on player count. The primary reason I developed it: Counter-Strike: Source recently added the sv_tags feature where information tags about your server can be listed in the server browser. If you have bot_quota set, as many servers do, whether you actually have bots in your server or not at any given time, the game will always automatically force "bots" to be in your sv_tags.

    Cvar:

    sourcemod/player-threshold-configs.cfg is auto-generated with the default setting:
    • sm_player_threshold_configs_threshold - Minimum number of players required for plugin to use population-normal.cfg instead of population-low.cfg . Default: 4

    Example of How it Works

    Using the default threshold of 4 for example:
    • There are 3 human players in the server who are not spectating. The server is currently running under its low population settings (population-low.cfg).
    • A human player joins the server and a team. The next round starts. Since there are now 4 players, which is >= (greater than or equal to) the threshold, the normal population (population-normal.cfg) gets executed.
    • Several more players join the server and join teams. The next round starts. Nothing happens.
    • Several people leave the server or go spectator. There are now 3 human players who aren't spectating. The next round starts. The low population config (population-low.cfg) gets executed.
    • A player leaves. There are now 2 non-spectator, non-bot players. The next round starts. Nothing happens.

    Setup
    1. Install the plugin.
    2. Create files named "population-low.cfg" and "population-normal.cfg" in your <mod>/cfg folder (eg. "cstrike/cfg/population-low.cfg" and "cstrike/cfg/population-normal.cfg").
    3. Put your settings in them for low and normal populations.
    Note: population-low.cfg will get executed OnConfigsExecuted (after standard server configs and plugin configs are executed) at the start of each new map (and on server start).

    Example Configs

    These are also attached in example-configs.zip .

    server.cfg (related part)
    Code:
    bot_quota_mode fill
    population-low.cfg
    Code:
    bot_quota 4
    sv_alltalk 1
    say Alltalk has been turned on due to player threshold.
    population-normal.cfg
    Code:
    bot_quota 0
    sv_alltalk 0
    say Alltalk has been turned off due to player threshold.
    Version History:
    • 1.0.0 - 2010-08-21 - Initial release
    • 1.0.1 - 2010-10-01 - The low population config is now executed OnConfigsExecuted (after standard server configs and plugin configs are executed).
    Attached Files
    File Type: zip example-configs.zip (497 Bytes, 575 views)
    File Type: sp Get Plugin or Get Source (player-threshold-configs.sp - 1568 views - 1.7 KB)

    Last edited by Mister_Magotchi; 07-20-2011 at 13:57.
    Mister_Magotchi is offline
    PAL-18
    AlliedModders Donor
    Join Date: Jul 2010
    Old 09-05-2010 , 15:25   Re: Player Threshold Configs
    Reply With Quote #2

    This is an awesome plugin. I'm surprised no one else commented on it.
    PAL-18 is offline
    Mister_Magotchi
    SourceMod Donor
    Join Date: Dec 2006
    Location: Nampa, Idaho
    Old 09-05-2010 , 16:56   Re: Player Threshold Configs
    Reply With Quote #3

    Thank you for the compliment. It might just be that the plugin has somewhat of a limited scope (mainly applies to games with many short rounds per map, such as CS:S).
    Mister_Magotchi is offline
    GrO
    Veteran Member
    Join Date: Jun 2010
    Location: Poland
    Old 09-15-2010 , 02:39   Re: Player Threshold Configs
    Reply With Quote #4

    Great, simple and functional plugin.

    It suits my needs perfectly, thank You very much for this ;].
    __________________
    GrO is offline
    Thraka
    AlliedModders Donor
    Join Date: Aug 2005
    Old 09-19-2010 , 22:28   Re: Player Threshold Configs
    Reply With Quote #5

    You could have it run on player spawn event for TF2. This way it's constant without a timer to manage.
    Thraka is offline
    Mister_Magotchi
    SourceMod Donor
    Join Date: Dec 2006
    Location: Nampa, Idaho
    Old 09-20-2010 , 04:05   Re: Player Threshold Configs
    Reply With Quote #6

    There is no timer. This plugin just uses the round_sitart event.
    Mister_Magotchi is offline
    Mister_Magotchi
    SourceMod Donor
    Join Date: Dec 2006
    Location: Nampa, Idaho
    Old 10-02-2010 , 00:08   Re: Player Threshold Configs
    Reply With Quote #7

    I updated this plugin to execute "population-low.cfg" OnConfigsExecuted (after standard server configs and plugin configs are executed).

    It's one less thing to worry about when installing the plugin, because you no longer have to do anything in your server.cfg to get the low population config executed.

    My original reason for changing it (which ended up not working how I expected):
    Valve recently added "alltalk" as a possible sv_tags tag.
    Other plugins which manage alltalk, such as my Round-End Alltalk plugin or Simple Alltalk Manager, take the notify flag off of sv_alltalk.
    This has the effect of making the sv_tags not properly update when sv_alltalk is changed.
    When a server starts, if it has "sv_alltalk 1" in its server.cfg (such as with Player Threshold Configs set as in my example) in addition to having such a plugin that removes the notify flag for the sv_alltalk CVar, it will permanently have "alltalk" in its sv_tags.
    For this reason, I made the low population config get run after all the other plugins had loaded and done their dirty work.

    This fixed the problem when I tested on a listenserver or local dedicated server with just the two plugins, but it doesn't seem to fix the problem on my live servers with many other plugins and much more configuration.

    In order to temporarily fix the problem for myself, I put ' sv_password "" ' in my population-normal.cfg . Now, at least when the server gets enough people in it, for some reason the tags get reset and no longer include "alltalk". I don't quite understand what the deal is. If I figure it out and it's something I should change in this plugin to fix the problem, I will.

    Last edited by Mister_Magotchi; 10-02-2010 at 01:06.
    Mister_Magotchi is offline
    magik
    Member
    Join Date: Aug 2009
    Old 01-02-2011 , 03:33   Re: Player Threshold Configs
    Reply With Quote #8

    bonjour

    voila je travail avec le plugin tripmine http://forums.alliedmods.net/showthread.php?t=70782

    et pour atribuer les mines la cvars est sm_tripmines_allowed "15" qui se trouve dans le fichier cfg/sourcemod/plugin.tripmines.cfg
    mais je veux faire une limite exp: player < =10, = 15 mines dans population low.cfg et si player > = 11, = 10 mines dans population normal.cfg
    pouvez vous m'aider svp a configurer le fichier population low et population normal.

    merci

    magik is offline
    magik
    Member
    Join Date: Aug 2009
    Old 01-02-2011 , 04:00   Re: Player Threshold Configs
    Reply With Quote #9

    ahhhhhhhh

    desolé mais votre plugin ne marche plus, crash serveur...
    magik is offline
    Mister_Magotchi
    SourceMod Donor
    Join Date: Dec 2006
    Location: Nampa, Idaho
    Old 01-02-2011 , 04:32   Re: Player Threshold Configs
    Reply With Quote #10

    I don't speak French, but I believe I got it.

    Set:
    sm_player_threshold_configs_threshold 11

    In population-low.cfg, put:
    sm_tripmines_allowed 15

    In population-normal.cfg, put:
    sm_tripmines_allowed 10

    I use my plugin all the time on my Counter-Strike: Source server, and I've never had it crash the server once. I'll even compile a new copy and throw it on my server to make sure.
    Mister_Magotchi is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 10:07.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode