Raised This Month: $12 Target: $400
 3% 

killtimer error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lingzhidiyu
Senior Member
Join Date: Mar 2014
Old 09-29-2014 , 11:44   killtimer error
Reply With Quote #1

I GOT ERROR

Native "KillTimer" reported: Invalid timer handle 8bfa0a83 (error 1)



PHP Code:
new Handle:G_H_Timer;
new 
bool:IsItOn;

HookEvent("round_start"Event_RoundStart);


public 
Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    if (
G_H_Timer != INVALID_HANDLE)
    {
        
KillTimer(G_H_Timer);//maybe CloseHandle?
        
G_H_Timer INVALID_HANDLE;
    }
    
IsItOn false;
    
G_H_Timer CreateTimer(60.0TimerA);
}

public 
Action:TimerA(Handle:timer)
{
    
IsItOn true;

lingzhidiyu is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-29-2014 , 11:57   Re: killtimer error
Reply With Quote #2

You need to set the timer to INVALID_HANDLE when it ends.

PHP Code:
public Action:TimerA(Handle:timer)
{
    
IsItOn true;
    
G_H_Timer INVALID_HANDLE;

__________________
Not currently working on SourceMod plugin development.
Powerlord 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 03:58.


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