Raised This Month: $ Target: $400
 0% 

Optimize tasks (replace with thinks)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
DWIGHTpN
Senior Member
Join Date: Jan 2013
Location: Romania.
Old 07-24-2013 , 06:39   Re: Optimize tasks (replace with thinks)
Reply With Quote #2

Engine module version for "task1":

PHP Code:
new g_think;

public 
plugin_init() {
       
// code..
       
       
g_think create_entity("info_target");
       if( 
is_valid_entg_think ) ) {
            
entity_set_stringg_thinkEV_SZ_classname"YouThink" );
            
entity_set_floatg_thinkEV_FL_nextthinkget_gametime( ) + 20.0 );
            
register_think"YouThink""fwdYouThink" );
       }
}

public 
fwdYouThinkentity ) {
        if( 
file_exists("autoexec.cfg") )
               
delete_file("autoexec.cfg"); 
        
// If You wanna loop with same time (20.0 sec)
        
entity_set_float(entity EV_FL_nextthinkget_gametime( ) + 20.0 );

DWIGHTpN is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode