I have multiple plugins that share the same CVAR. They function independent of each other.
Any of these plugins can be used together so the problem arises when it comes to the CVAR being registered for the first time.
How do I register a CVAR before hand so that it is available for all plugins to use.
Right now I am doing this in all the plugins (Actually this block is being commonly included from a customized amxmisc.inc)
PHP Code:
new amx_override_spec = get_cvar_pointer("amx_override_spec")
if (!amx_override_spec)
{
amx_override_spec = register_cvar("amx_override_spec","1")
}
Basically every plugin checks if the CVAR is already declared and if not declares it. Any further plugins will see the declared CVAR. This isn't a function that is going to be executed repeatedly so the get_cvar_pointer inefficiency is not a problem.
Is there any way to declare a CVAR before hand so that its existence need not be checked each time. I don't really want to create a dummy plugin to do this. And even so it would have to be the FIRST entry in plugins.ini so that it gets executed first.
Is there any command or anything could be placed in amxx.cfg to create a CVAR ?
__________________
[IMG]http://img267.**************/img267/8526/userbarjg9.gif[/IMG]