View Single Post
Author Message
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 06-10-2010 , 21:43   Think Function Isn't Working
Reply With Quote #1

Hey, I'm wondering what's wrong with this code.

PHP Code:
public thinkDynamite(ent)
{
    static 
id;
    
id entity_get_edict(entEV_ENT_owner);
    
    if( 
g_iPlayerClass[id] != DEMOLITIONS )
    {
        
remove_entity(ent);
        return;
    }
    
    if( !
g_fDynamiteCountdown[id] )
    {
        
ClearSyncHud(idg_msgSyncHudObject_3);
        
        
explode_dynamite(ident);
        return;
    }
    
    
set_hudmessage(255000.350.015.02.00.50.5);
    
ShowSyncHudMsg(idg_msgSyncHudObject_3"%.1f"g_fDynamiteCountdown[id]);
    
    
g_fDynamiteCountdown[id] -= 0.1;
    
entity_set_float(entEV_FL_nextthinkhalflife_time() + 0.1);

When I skip the think function the dynamite explodes fine... so the problem is in here somewhere and I'm not exactly sure what it is. Any help would be greatly appreciated.
shadow.hk is offline
Send a message via MSN to shadow.hk