Raised This Month: $ Target: $400
 0% 

How properly count/use cycles of ent think


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
avril-lavigne
Banned
Join Date: Apr 2009
Old 10-25-2014 , 14:33   Re: How properly count/use cycles of ent think
Reply With Quote #1

PHP Code:
public ctfthink(ent)
{
         if(!
is_valid_ent(ent)) return      
         
set_pev(ent,pev_nextthinkhalflife_time() + 5.0//check ent status each 5 sec

         
if(getstatus(ent) == 3// dropped state. 
         
{
              
dd++    
              if(
dd 5)   // got 30 sec delay. 6*5 times
              
{
                              
                               
set_pev(ent,pev_originoct)  // go to base
                           
status(ent,1)  // on base
                           
dd 0      
              
}             
        }
         else 
dd // ent status 3 was interrupted by a player , clear counter

If put nextthink 30 sec right after needed state (3). It wont count delay NOW . Also if it sleeps 30 sec - what if someone picked up ent in that period and entity state was changed? so I cant wait 30sec at once. So I need to check ent state each few seconds to make sure it was dropped and stay in the same state 30sec before going to base.
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 10-25-2014 at 14:36.
avril-lavigne is offline
Reply



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 17:38.


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