View Single Post
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-22-2009 , 18:23   Re: Simple Knife Warmup
Reply With Quote #12

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.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552