register_cvar() and get_pcvar_num()
PHP Code:
I have tried getting the value using get_cvar_num() and in different places like plugin_cfg() but the result is same. What am I missing here ? |
Re: register_cvar() and get_pcvar_num()
amxx.cfg is executed during plugin_cfg, so checking it before then will alter the results. Make sure that the cvar value has actually changed, execute "amx_cvar sample_cvar" and see what it says the value is
|
Re: register_cvar() and get_pcvar_num()
Okay.
Actually what I want is depending on a cvar value start a timer(continuous timer). So what is best function in my case ? |
Re: register_cvar() and get_pcvar_num()
Actually, this should work after the map has been changed once. On first boot it will not.
|
Re: register_cvar() and get_pcvar_num()
^^Correct. This is what happening. But where should I put this stuff which will work everytime ?
|
Re: register_cvar() and get_pcvar_num()
Read the cvar in plugin_cfg().
|
Re: register_cvar() and get_pcvar_num()
Actually that was originally written and not working. Let me show you the original code.
PHP Code:
|
Re: register_cvar() and get_pcvar_num()
create own cfg and execute it inside plugin_cfg
or check your plugins.ini maybe the possition of your plugin is too high you should to take it last.(I think) |
Re: register_cvar() and get_pcvar_num()
Can anyone show me a quick version of reading own cfg and reflecting that changes to registered cvars ?
|
Re: register_cvar() and get_pcvar_num()
Quote:
|
| All times are GMT -4. The time now is 13:37. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.