Raised This Month: $32 Target: $400
 8% 

Solved [L4D2] Invalid timer handle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
larrybrains
Senior Member
Join Date: May 2017
Old 05-19-2022 , 23:35   [L4D2] Invalid timer handle
Reply With Quote #1

I am getting an error with my witch plugin that I think happens when the witch dies.

PHP Code:
L 05/19/2022 22:16:59Info (map "c1m4_atrium") (file "/home/l4d2/l4d2ds2/left4dead2/addons/sourcemod/logs/errors_20220519.log")
L 05/19/2022 22:16:59: [SMPlugin "optional/l4d_witch_incap.smx" encountered error 23Native detected error
L 05
/19/2022 22:16:59: [SMInvalid timer handle 5d500671 (error 3during timer enddisplayed function is timer callbacknot the stack trace
L 05
/19/2022 22:16:59: [SMUnable to call function "BurnWitchDead_Timer" due to above error(s). 
My code is (which is modified from a few other peoples plugins):

PHP Code:
public Action OnTakeDamageWitch(int victimint &attackerint &inflictorfloat &damageint &damagetype)
{
    if (
<= attacker <= MaxClients && GetClientTeam(attacker) == && !IsWitchIdle(victim))
    {
        
damage 0.0;
        
#if debug
            
PrintToChatAll("[Witch Status] Prevented SI from damaging witch.");
        
#endif
        
return Plugin_Changed;
    }
    if( 
damagetype DMG_BURN && BurnWitchTimer[victim] == null)
    {
        
BurnWitchTimer[victim] = CreateTimer(witch_burn_timeBurnWitchDead_Timervictim);
    }
    return 
Plugin_Continue;
}

public 
Action BurnWitchDead_Timer(Handle timerany witch)
{
    if ( 
witch )
    {
        if(
IsWitch(witch))
        {
            
ForceDamageEntity(-199999witch);
            
BurnWitchTimer[witch] = null;
        }
    }

    return 
Plugin_Continue;

There is a lot more happening in the plugin, so let me know if you need to see more of it.

EDIT: figured this out. Was trying to delete the BurnWitchTimer[witch] on the witch killed event, but it wasn't needed. Error is gone now.

Last edited by larrybrains; 05-20-2022 at 16:38.
larrybrains 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 06:48.


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