PHP Code:
public ctfthink(ent)
{
if(!is_valid_ent(ent)) return
set_pev(ent,pev_nextthink, halflife_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_origin, oct) // go to base
status(ent,1) // on base
dd = 0
}
}
else dd = 0 // 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