AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] Server Exec Config file and map configs (https://forums.alliedmods.net/showthread.php?t=271518)

Depresie 09-14-2015 00:30

[SOLVED] Server Exec Config file and map configs
 
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)



fysiks 09-14-2015 01:07

Re: [HELP] Server Exec Config file and map configs
 
Map Specific Config Files

Depresie 09-14-2015 01:25

Re: [HELP] Server Exec Config file and map configs
 
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)



HamletEagle 09-14-2015 11:08

Re: [HELP] Server Exec Config file and map configs
 
To get map name you can use get_mapname.

Depresie 09-14-2015 11:47

Re: [HELP] Server Exec Config file and map configs
 
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)
    



Krtola 09-14-2015 12:06

Re: [SOLVED] Server Exec Config file and map configs
 
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.

Depresie 09-14-2015 12:13

Re: [SOLVED] Server Exec Config file and map configs
 
no problem :P

HamletEagle 09-14-2015 13:12

Re: [SOLVED] Server Exec Config file and map configs
 
That is not an excuse, you could simply searched for "get current map name" on google and you would get your answer.

Depresie 09-14-2015 14:53

Re: [SOLVED] Server Exec Config file and map configs
 
i did, i also looked inside nextmap.sma but i got a little confused since i never did something like that :P the charsmax thing in the cfgdir line got me confused..

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


All times are GMT -4. The time now is 22:04.

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