Raised This Month: $23 Target: $400
 5% 

Is there a way to make certain cvars be executed when a map ends?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diddley4209
Junior Member
Join Date: May 2020
Old 05-18-2020 , 13:27   Is there a way to make certain cvars be executed when a map ends?
Reply With Quote #1

On one of my maps I'd like nospread, but I don't want nospread in any other map, what would be the easiest way to do this?
Diddley4209 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-18-2020 , 13:43   Re: Is there a way to make certain cvars be executed when a map ends?
Reply With Quote #2

Quote:
Originally Posted by Diddley4209 View Post
On one of my maps I'd like nospread, but I don't want nospread in any other map, what would be the easiest way to do this?
For each map, you can also add a configuration file that will execute when the map loads. This is useful to set certain settings for 3rd party maps, say, removing the freeze time on fy_iceworld.

To do this, simply create a folder in addons\amxmodx\configs called "maps" and place a .cfg file named after the map with the settings in it, for example, you might have addons\amxmodx\configs\maps\fy_iceworld.cfg.

Otherwise to do it at 'the end', make a regular config file like server.cfg. Create plugin with Set_task_ex with flag SetTask_BeforeMapChange.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell

Last edited by DJEarthQuake; 05-18-2020 at 13:44.
DJEarthQuake is offline
Diddley4209
Junior Member
Join Date: May 2020
Old 05-18-2020 , 13:59   Re: Is there a way to make certain cvars be executed when a map ends?
Reply With Quote #3

Quote:
Originally Posted by DJEarthQuake View Post
For each map, you can also add a configuration file that will execute when the map loads. This is useful to set certain settings for 3rd party maps, say, removing the freeze time on fy_iceworld.

To do this, simply create a folder in addons\amxmodx\configs called "maps" and place a .cfg file named after the map with the settings in it, for example, you might have addons\amxmodx\configs\maps\fy_iceworld.cfg.

Otherwise to do it at 'the end', make a regular config file like server.cfg. Create plugin with Set_task_ex with flag SetTask_BeforeMapChange.
Yeah, I have these set in the map config, but they don't change when the map switches. I'm still new to source servers, so how would I create this "plugin" with that flag?
Diddley4209 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-18-2020 , 14:19   Re: Is there a way to make certain cvars be executed when a map ends?
Reply With Quote #4

You can set them in configs/amxx.cfg if you want to reset them after the map. This will be executed for each map, but the map-specific files will be executed after this one, so the cvars there will apply only for those maps.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Diddley4209
Junior Member
Join Date: May 2020
Old 05-18-2020 , 15:18   Re: Is there a way to make certain cvars be executed when a map ends?
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
You can set them in configs/amxx.cfg if you want to reset them after the map. This will be executed for each map, but the map-specific files will be executed after this one, so the cvars there will apply only for those maps.
I don't have that file
Diddley4209 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-18-2020 , 16:08   Re: Is there a way to make certain cvars be executed when a map ends?
Reply With Quote #6

How can you not have it? This is a default AMXX file. If you didn't download AMXX from the official website, please download it. If you did, simply create the file.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Diddley4209
Junior Member
Join Date: May 2020
Old 05-18-2020 , 16:10   Re: Is there a way to make certain cvars be executed when a map ends?
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
How can you not have it? This is a default AMXX file. If you didn't download AMXX from the official website, please download it. If you did, simply create the file.
What is AMXX? Sorry I'm confused haha
Diddley4209 is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 05-18-2020 , 18:10   Re: Is there a way to make certain cvars be executed when a map ends?
Reply With Quote #8

Quote:
Originally Posted by Diddley4209 View Post
What is AMXX? Sorry I'm confused haha
what is amxx? really? what are you doing on this forum? did you say you are new to Source Server? so why did you post in the amx sections?

make up your mind of what you want
tarsisd2 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-18-2020 , 22:19   Re: Is there a way to make certain cvars be executed when a map ends?
Reply With Quote #9

Quote:
Originally Posted by Diddley4209 View Post
What is AMXX? Sorry I'm confused haha
AMXX is short for AMX Mod X, a server-side modification for Half-Life 1 based servers (which is the section of the forum in which you are now posting). If you have a Source-based game, you need to use SourceMod which as its own section for support (below the AMX Mod X section on the main page).
__________________

Last edited by fysiks; 05-18-2020 at 22:20.
fysiks is online now
Diddley4209
Junior Member
Join Date: May 2020
Old 05-19-2020 , 01:43   Re: Is there a way to make certain cvars be executed when a map ends?
Reply With Quote #10

Quote:
Originally Posted by tarsisd2 View Post
what is amxx? really? what are you doing on this forum? did you say you are new to Source Server? so why did you post in the amx sections?

make up your mind of what you want
Oh yikes my bad, I didn't mean to post it in this forum. I figured out how to do what I needed, sorry about the confusion.
Diddley4209 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 14:32.


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