3rd party cvar not loaded on plugin_cfg
So I'm registering a cvar in plugin_init:
Code:
then trying to get its value on plugin_cfg: Code:
Which often gives me the default cvar value. I only managed to make this return the right value each time by delaying it by two seconds, which is not reliable and stupid. Any ideas? |
Re: 3rd party cvar not loaded on plugin_cfg
I've never seen this issue. Where are you setting the cvar?
|
Re: 3rd party cvar not loaded on plugin_cfg
amxx.cfg
0.5 seconds delay seems to work too, however I don't want to risk loading a wrong cvar value because of some sort of lag that basically copies all of my achievements to an other server on the website. This absolutely needs to be reliable, which is why I'm starting the thread in the first place. |
Re: 3rd party cvar not loaded on plugin_cfg
Well, amxx.cfg is executed in plugin_init() from admin.sma ; and plugin_cfg() is sent at the time as plugin_init(), just right after (from same metamod forward) ; so considering it doesn't use server_exec() in admin.sma, it's possible config file to not be executed right away. Adding server_exec() in admin.sma or adding a small delay in your plugin, both should lead to same wanted result.
|
Re: 3rd party cvar not loaded on plugin_cfg
Thanks, I'll try it. I'm also going to try adding server_exec directly to plugin_init of my plugin, because I'm going to distribute it to other people.
Edit: I just realized it won't do anything, so nevermind. I'll just delay it then, 0.5 seconds is still fine. |
| All times are GMT -4. The time now is 15:46. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.