Raised This Month: $188 Target: $400
 47% 

[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 , 20: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.

    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, 395 views)
    File Type: sp Get Plugin or Get Source (mapend_cvars_reset.sp - 431 views - 1.3 KB)
    __________________

    Last edited by St00ne; 10-29-2014 at 01:26. Reason: v2.1
    St00ne is offline
    Impact123
    AlliedModders Donor
    Join Date: Oct 2011
    Location: Germany
    Old 05-06-2012 , 20: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 20:54.
    Impact123 is offline
    St00ne
    Veteran Member
    Join Date: Jan 2011
    Location: Annecy - France
    Old 05-06-2012 , 21: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
    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; 05-07-2012 at 02:27.
    St00ne is offline
    Impact123
    AlliedModders Donor
    Join Date: Oct 2011
    Location: Germany
    Old 05-06-2012 , 21: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 21:54.
    Impact123 is offline
    St00ne
    Veteran Member
    Join Date: Jan 2011
    Location: Annecy - France
    Old 05-07-2012 , 01: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 11:56.
    St00ne is offline
    St00ne
    Veteran Member
    Join Date: Jan 2011
    Location: Annecy - France
    Old 05-07-2012 , 02: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 22:30.
    St00ne is offline
    St00ne
    Veteran Member
    Join Date: Jan 2011
    Location: Annecy - France
    Old 07-17-2012 , 00: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.

    Regards,

    St00ne

    Edit: v3.0b uploaded to add a check if the cfg file is loaded.
    Attached Files
    File Type: cfg roundend_cvars_reset.cfg (50 Bytes, 82 views)
    File Type: sp Get Plugin or Get Source (roundend_cvars_reset.sp - 165 views - 1.8 KB)
    __________________

    Last edited by St00ne; 02-26-2013 at 18:48. Reason: indentation corrected
    St00ne is offline
    SlimeCounty
    SourceMod Donor
    Join Date: Jun 2011
    Old 07-17-2012 , 00: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 00:26.
    SlimeCounty is offline
    St00ne
    Veteran Member
    Join Date: Jan 2011
    Location: Annecy - France
    Old 07-17-2012 , 00: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.
    __________________

    Last edited by St00ne; 09-09-2012 at 04:27.
    St00ne is offline
    St00ne
    Veteran Member
    Join Date: Jan 2011
    Location: Annecy - France
    Old 09-07-2012 , 16: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.
    __________________
    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 18:53.


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