Would it be more efficient for this code if I were to take the pcvar and make a global variable for its value to be used instead of calling the get_pcvar_num fuction every time I need the value for a pcvar? I know I would have to change the map for the cvar to be updated.
Like this:
PHP Code:
#include <amxmodx>
new pcvar
new g_pcvarvalue
public plugin_init()
{
register_plugin("efficient","1.0","r4ndomz")
pcvar = register_cvar("qwerty", "1");
}
public plugin_cfg()
{
g_pcvarvalue = get_pcvar_num(pcvar);
}
public function(id)
{
client_print(id, print_chat, "%i", g_pcvarvalue);
}
__________________