Raised This Month: $ Target: $400
 0% 

Think Function Isn't Working


Post New Thread Reply   
 
Thread Tools Display Modes
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
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 06-10-2010 , 23:09   Re: Think Function Isn't Working
Reply With Quote #2

Add some debug messages in. Make client_prints for each possible situation that could be bugged and check to see what isn't valid or isn't being cached correctly.

I'd add some checks in for validity of the entity and its owner first.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 06-11-2010 , 04:53   Re: Think Function Isn't Working
Reply With Quote #3

Nevermind, got it. Just a silly mistake somewhere else in the plugin...
shadow.hk is offline
Send a message via MSN to shadow.hk
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 07:45.


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