Raised This Month: $ Target: $400
 0% 

[Any] Map end cvars reset (sv_gravity, phys_timescale, phys_pushscale, etc...) [v2.1]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
St00ne
Veteran Member
Join Date: Jan 2011
Location: Annecy - France
Plugin ID:
2938
Plugin Version:
2.1
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    6 
    Plugin Description:
    Resets any cvar like sv_gravity, phys_timescale or phys_pushscale at map end.
    Old 05-06-2012 , 21:33   [Any] Map end cvars reset (sv_gravity, phys_timescale, phys_pushscale, etc...) [v2.1]
    Reply With Quote #1

    Running a soccer server which also has volleyball and other sports maps, I needed to find a way to reset the gravity, timescale and pushscale back to default values before mapchange.
    If you just set phys_timescale 1 in your server.cfg or in your map configs, the nextmap will still have a weird physcale. You need to change the map again to have it fixed. The server acts like it considers the value of the previous map instead of the one written in your server.cfg, even though the server.cfg is to be loaded at start up of any map... this is a common bug of CS:S.
    This plugin fixes the bug by allowing you to reset any cvar you want at map end.

    I know there are some maps on TF2 where there is the same problem, so I think this plugin can be useful for other mods than CS:S.

    The main advantage of this plugin is that it works even with a manual or rtv mapchange.

    EDIT: On TF2, for projectiles, it only works with normal map change (max frags limit reached for example), and not with admin or rtv map change. I'll try to see if I can fix that.
    PS: Round End version -> https://forums.alliedmods.net/showpo...51&postcount=7

    All comments are welcome.

    St00ne

    Installation:
    Download mapend_cvars_reset.smx and place it to your addons/sourcemod/plugins folder.
    Download mapend_cvars_reset.sp and place it to your addons/sourcemod/scripting folder.
    Download mapend_cvars_reset.cfg and place it to your cfg/sourcemod folder.

    Usage:
    Add any command you want to the mapend_cvars_reset.cfg file like this:
    Code:
    phys_timescale "1"
    phys_pushscale "1"
    sv_gravity "800"


    Additional information:
    Servers using this plugin:
    http://www.game-monitor.com/search.p...ars_reset_ver=
    http://www.gametracker.com/search/?s...=&sort=&order=

    Thanks to Bacardi and DarthNinja.
    Attached Files
    File Type: cfg mapend_cvars_reset.cfg (50 Bytes, 829 views)
    File Type: sp Get Plugin or Get Source (mapend_cvars_reset.sp - 2036 views - 1.3 KB)
    __________________

    *** *** ***
    -My plugins-

    Last edited by St00ne; 08-11-2019 at 02:47. Reason: v2.1
    St00ne is offline
    Impact123
    Veteran Member
    Join Date: Oct 2011
    Location: Germany
    Old 05-06-2012 , 21:53   Re: MapEnd 3cvars_reset
    Reply With Quote #2

    Why not just exec server and autoexec.cfg if they exist?

    Yours sincerely
    Impact
    __________________

    Last edited by Impact123; 05-06-2012 at 21:54.
    Impact123 is offline
    St00ne
    Veteran Member
    Join Date: Jan 2011
    Location: Annecy - France
    Old 05-06-2012 , 22:05   Re: MapEnd 3cvars_reset
    Reply With Quote #3

    Quote:
    Originally Posted by Impact123 View Post
    Why not just exec server and autoexec.cfg if they exist?

    Yours sincerely
    Impact
    NOTE: At the time, plugin was handling only 3 cvars.

    Hi Impact,

    What do you mean: do you think that the plugin should execute all server configs at the end of the map?
    Or do you mean that this plugin seems useless because admins could just change the cvars manually?
    Regards,

    St00ne

    Last edited by St00ne; 08-11-2019 at 03:24.
    St00ne is offline
    Impact123
    Veteran Member
    Join Date: Oct 2011
    Location: Germany
    Old 05-06-2012 , 22:53   Re: MapEnd 3cvars_reset
    Reply With Quote #4

    What i meant is, that admins should have this cvars set in their server.cfg, so it would be better to just exec that cfg if it exists.

    Something like that should do it
    PHP Code:
    if(FileExists("cfg/server.cfg"))
    {
        
    ServerCommand("exec \"server.cfg\"");

    Looks like a better solution to me.

    Yours sincerely
    Impact
    __________________

    Last edited by Impact123; 05-06-2012 at 22:54.
    Impact123 is offline
    St00ne
    Veteran Member
    Join Date: Jan 2011
    Location: Annecy - France
    Old 05-07-2012 , 02:36   Re: MapEnd 3cvars_reset
    Reply With Quote #5

    Hi,

    It's true that this way, admins could put all the commands they would want in a cfg file to be executed at map end, instead of being restricted to the 3 cvars I chose/needed.
    So I should do something like:
    Code:
    ServerCommand ("exec sourcemod/mapend_commands.cfg")
    and provide an empty mapend_commands.cfg file that admins could edit.

    But for now I don't know if the exec command can be called OnMapEnd. I have to test it.

    I don't think admins would want to execute all commands written in server.cfg, or even just a few more commands than gravity, physcale and pushscale, at map end.
    You have to keep in mind that the 3 cvars mentionned above are some of the few cvars (if not the only ones), causing pbs on CS:S.
    It's kind of a "known bug": these cvars need to be set just before mapchange... All other cvars are set correctly at nextmap if they are in the server.cfg.

    Last edited by St00ne; 05-07-2012 at 12:56.
    St00ne is offline
    St00ne
    Veteran Member
    Join Date: Jan 2011
    Location: Annecy - France
    Old 05-07-2012 , 03:17   Re: MapEnd 3cvars_reset
    Reply With Quote #6

    Ok it works, plugin title modified: it allows you to reset any cvar you want.

    Regards,

    St00ne

    Last edited by St00ne; 05-07-2012 at 23:30.
    St00ne is offline
    St00ne
    Veteran Member
    Join Date: Jan 2011
    Location: Annecy - France
    Old 07-17-2012 , 01:21   Re: [Any] Map end cvars reset (sv_gravity, phys_timescale, phys_pushscale, etc...)
    Reply With Quote #7

    As requested by a CS:S mg server admin I know, I made a version of this plugin which resets cvars at round end.
    On some mg maps you can play soccer or volley for one round, and then the physcale, timescale or gravity are changed and not reset next round.

    There's an enable/disable cvar:
    sm_roundend_cvars_reset_enabled 1 / 0
    The config file has been renamed (see attachements).

    I'm just dropping it here.
    (v3.0b uploaded to add a check if the cfg file is loaded.)
    Attached Files
    File Type: cfg roundend_cvars_reset.cfg (50 Bytes, 610 views)
    File Type: sp Get Plugin or Get Source (roundend_cvars_reset.sp - 1276 views - 1.8 KB)
    __________________

    *** *** ***
    -My plugins-

    Last edited by St00ne; 08-22-2019 at 18:21. Reason: indentation corrected
    St00ne is offline
    SlimeCounty
    SourceMod Donor
    Join Date: Jun 2011
    Old 07-17-2012 , 01:25   Re: [Any] Map end cvars reset (sv_gravity, phys_timescale, phys_pushscale, etc...)
    Reply With Quote #8

    Isn't this something Round Triggers would be able to accomplish as well?
    Using rtrig commands in a map specific .cfg file seems like it would accomplish the same thing.
    __________________

    Last edited by SlimeCounty; 07-17-2012 at 01:26.
    SlimeCounty is offline
    St00ne
    Veteran Member
    Join Date: Jan 2011
    Location: Annecy - France
    Old 07-17-2012 , 01:38   Re: [Any] Map end cvars reset (sv_gravity, phys_timescale, phys_pushscale, etc...)
    Reply With Quote #9

    The plugin you mentionned is for TF2 only.
    __________________

    *** *** ***
    -My plugins-

    Last edited by St00ne; 09-09-2012 at 05:27.
    St00ne is offline
    St00ne
    Veteran Member
    Join Date: Jan 2011
    Location: Annecy - France
    Old 09-07-2012 , 17:54   Re: [Any] Map end cvars reset (sv_gravity, phys_timescale, phys_pushscale, etc...)
    Reply With Quote #10

    1st post edited, it seems that it only works with normal map change on TF2 (not rtv or admin mapchange) for projectiles. I'll try to fix this.
    On CS:S it works in all cases.
    __________________

    *** *** ***
    -My plugins-
    St00ne 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 09:10.


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