There are only two situations in which pcvars are slower:
- You only reference the cvar once.
- You need to use set_cvar_string() (and even this has some weird technicalities).
In this case, you make reference to
mp_freezetime thrice in the code, and probably a good 10-20 times on the average lifespan of a loaded plugin.
PHP Code:
public plugin_cfg()
{
mp_freezetime = get_cvar_num("mp_freezetime")
}
PHP Code:
set_task(1.0, "restart", TASKID, _, _, "b")
set_cvar_num("mp_freezetime", 0)
}
PHP Code:
if(hudtimer <= 0)
{
remove_task(TASKID)
set_cvar_num("sv_restartround", 1)
set_cvar_num("mp_freezetime", mp_freezetime)
}
So use pcvars.
__________________