Raised This Month: $ Target: $400
 0% 

[SOLVED] Server Exec Config file and map configs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-14-2015 , 00:30   [SOLVED] Server Exec Config file and map configs
Reply With Quote #1

So i have this little function which is reloading the default zombieplague.cfg
Now the problem is that i have different config files for every map, which contains a couple different cvar settubgs from the zombieplague.cfg

How can i load not only the zombieplague.cfg but and the config file for the map playing on ?

PHP Code:
public function()
{
    
// Setting The lighting Settings as before the Mode.
    
new cfgdir[32]
    
get_configsdir(cfgdircharsmax(cfgdir))

    
server_cmd("exec %s/zombieplague.cfg"cfgdir)


Last edited by Depresie; 09-14-2015 at 11:47.
Depresie is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-14-2015 , 01:07   Re: [HELP] Server Exec Config file and map configs
Reply With Quote #2

Map Specific Config Files
__________________
fysiks is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-14-2015 , 01:25   Re: [HELP] Server Exec Config file and map configs
Reply With Quote #3

i dont think you understood what i was trying to say...
i have already created a config file for each map...
each config contains the following cvar -> zp_lighting c/d/e/f etc ( different on every map )
now the problem is that i have a round mode, which is executing the function above at the end of the round ( yes it is needed )
the function above is executing the zombieplague.cfg, which is containing the following cvar -> zp_lighting g

i want the function to execute zombieplague.cfg for the default cvars, and then to execute the map's config file to set the lighting cvar from the map's config

in other words, what i need is something like this->

Code:
server_cmd("exec %s/zombieplague.cfg", cfgdir)

-->
Code:
new map = get current map name
Code:
server_cmd("exec %s/map.cfg", cfgdir)


Last edited by Depresie; 09-14-2015 at 01:56.
Depresie is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-14-2015 , 11:08   Re: [HELP] Server Exec Config file and map configs
Reply With Quote #4

To get map name you can use get_mapname.
__________________
HamletEagle is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-14-2015 , 11:47   Re: [HELP] Server Exec Config file and map configs
Reply With Quote #5

got it done, thanks, sorry for being a slowpoke, it's a little confusing using things you never used before =P
here is the code in case newbies would be interested in doing something like this

PHP Code:
public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /testme""function").
}

public function(
id)
{
    new 
cfgdir[32], mapname[32]
    
get_configsdir(cfgdircharsmax(cfgdir))
    
get_mapname(mapname31)
    
server_cmd("exec %s/maps/%s.cfg"cfgdirmapname)
    

Depresie is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 09-14-2015 , 12:06   Re: [SOLVED] Server Exec Config file and map configs
Reply With Quote #6

This is just what I was looking for a few months ago,but they did not understand what I want.
This works perfectly,thanks Depresie.
Krtola is offline
Send a message via Skype™ to Krtola
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-14-2015 , 12:13   Re: [SOLVED] Server Exec Config file and map configs
Reply With Quote #7

no problem
Depresie is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-14-2015 , 13:12   Re: [SOLVED] Server Exec Config file and map configs
Reply With Quote #8

That is not an excuse, you could simply searched for "get current map name" on google and you would get your answer.
__________________

Last edited by HamletEagle; 09-14-2015 at 13:13.
HamletEagle is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-14-2015 , 14:53   Re: [SOLVED] Server Exec Config file and map configs
Reply With Quote #9

i did, i also looked inside nextmap.sma but i got a little confused since i never did something like that the charsmax thing in the cfgdir line got me confused..

you're right, im a little lazy lately, maybe because im tired...

Last edited by Depresie; 09-14-2015 at 23:27.
Depresie is offline
Reply



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 22:04.


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