AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [Any] Map end cvars reset (sv_gravity, phys_timescale, phys_pushscale, etc...) [v2.1] (https://forums.alliedmods.net/showthread.php?t=184610)

St00ne 05-06-2012 20:33

[Any] Map end cvars reset (sv_gravity, phys_timescale, phys_pushscale, etc...) [v2.1]
 
2 Attachment(s)
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"

https://files.gamebanana.com/img/ss/maps/18443.jpg

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.

Impact123 05-06-2012 20:53

Re: MapEnd 3cvars_reset
 
Why not just exec server and autoexec.cfg if they exist?

Yours sincerely
Impact

St00ne 05-06-2012 21:05

Re: MapEnd 3cvars_reset
 
Quote:

Originally Posted by Impact123 (Post 1703884)
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

Impact123 05-06-2012 21:53

Re: MapEnd 3cvars_reset
 
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

St00ne 05-07-2012 01:36

Re: MapEnd 3cvars_reset
 
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.

St00ne 05-07-2012 02:17

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

Regards,

St00ne

St00ne 07-17-2012 00:21

Re: [Any] Map end cvars reset (sv_gravity, phys_timescale, phys_pushscale, etc...)
 
2 Attachment(s)
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.)

SlimeCounty 07-17-2012 00:25

Re: [Any] Map end cvars reset (sv_gravity, phys_timescale, phys_pushscale, etc...)
 
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.

St00ne 07-17-2012 00:38

Re: [Any] Map end cvars reset (sv_gravity, phys_timescale, phys_pushscale, etc...)
 
The plugin you mentionned is for TF2 only.

St00ne 09-07-2012 16:54

Re: [Any] Map end cvars reset (sv_gravity, phys_timescale, phys_pushscale, etc...)
 
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.


All times are GMT -4. The time now is 14:57.

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