Quote:
Originally Posted by Emp`
if you really wanted to optimize it, you could just do:
Code:
public plugin_init()
{
register_plugin("test", "", "")
}
public client_putinserver(id)
{
static test_pcvar;
if( !test_pcvar )
test_pcvar = register_cvar("amx_test_cvar", "1")
if (get_pcvar_num(test_pcvar))
client_print(0, print_chat, "test")
}
|
thats not better.
memory usage to his pcvar example: identical
performance: worst. you check everytime in client_putinserver if the cvar is registered which will cost performance(not much, but it costs performance).
__________________