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

KillTimer Problems


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iJumPixX
Junior Member
Join Date: Feb 2013
Location: Russian Federation
Old 02-15-2013 , 10:51   KillTimer Problems
Reply With Quote #1

Please, help fix.
The problem with the plugin, error log full ;)

Error:
PHP Code:
[SMNative "KillTimer" reportedInvalid timer handle e66b0795 (error 3)
[
SMDisplaying call stack trace for plugin "RPG.smx":
[
SM]   [0]  Line 355rpg/helpers.inc::Timer_KillTimer() 
Code:
PHP Code:
public Action:Timer_KillTimer(Handle:timer,Handle:hTimer)
{
    if(
hTimer!=INVALID_HANDLE)
        
KillTimer(hTimertrue);
        
    return 
Plugin_Stop;


Last edited by iJumPixX; 02-15-2013 at 10:52.
iJumPixX is offline
Send a message via ICQ to iJumPixX
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 02-15-2013 , 10:55   Re: KillTimer Problems
Reply With Quote #2

Even when using return Plugin_Stop; I'm not sure if it marks the handle as INVALID_HANDLE. You should use something like this while avoiding TIMER_FLAG_NO_MAPCHANGE as it doesn't mark the timer as INVALID_HANDLE on the end of the map.
PHP Code:
public Action:Timer_KillTimer(Handle:hTimer)
{
        if(
hTimer != INVALID_HANDLE)
        {
                
KillTimer(hTimertrue);
                
hTimer INVALID_HANDLE;
        }
        return 
Plugin_Continue;


Last edited by ReFlexPoison; 02-15-2013 at 11:03.
ReFlexPoison is offline
iJumPixX
Junior Member
Join Date: Feb 2013
Location: Russian Federation
Old 02-15-2013 , 10:58   Re: KillTimer Problems
Reply With Quote #3

Quote:
Originally Posted by ReFlexPoison View Post
Even when using return Plugin_Stop; I'm not sure if it marks the handle as INVALID_HANDLE. You should use something like this while avoiding TIMER_FLAG_NO_MAPCHANGE as it doesn't mark the timer as INVALID_HANDLE on the end of the map.
PHP Code:
public Action:Timer_KillTimer(Handle:timer,Handle:hTimer)
{
        if(
hTimer!=INVALID_HANDLE)
        {
                
KillTimer(hTimertrue);
                
hTimer INVALID_HANDLE;
        }
        return 
Plugin_Continue;

Thank you ... This thc_rpg 0.8.6.
I'll check!
iJumPixX is offline
Send a message via ICQ to iJumPixX
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 02-15-2013 , 11:04   Re: KillTimer Problems
Reply With Quote #4

Quote:
Originally Posted by iJumPixX View Post
Thank you ... This thc_rpg 0.8.6.
I'll check!
Edited my post above, don't know why you were using two handles in the function ?.? ~~~ Unless it was a global handle.

Last edited by ReFlexPoison; 02-15-2013 at 11:04.
ReFlexPoison is offline
iJumPixX
Junior Member
Join Date: Feb 2013
Location: Russian Federation
Old 02-15-2013 , 11:24   Re: KillTimer Problems
Reply With Quote #5

Quote:
Originally Posted by ReFlexPoison View Post
Edited my post above, don't know why you were using two handles in the function ?.? ~~~ Unless it was a global handle.
A thc_rpg will work fine?
iJumPixX is offline
Send a message via ICQ to iJumPixX
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 02-15-2013 , 12:39   KillTimer Problems
Reply With Quote #6

Don't close a timer handle inside of its callback. If it's not a repeating timer, it'll be closed automatically. Otherwise, returning Plugin_Stop will close it.
__________________
Dr. McKay is offline
iJumPixX
Junior Member
Join Date: Feb 2013
Location: Russian Federation
Old 02-15-2013 , 12:44   Re: KillTimer Problems
Reply With Quote #7

Quote:
Originally Posted by Dr. McKay View Post
Don't close a timer handle inside of its callback. If it's not a repeating timer, it'll be closed automatically. Otherwise, returning Plugin_Stop will close it.
And how to be? What will be the correct code?
I'm a noob in sourcepawn
iJumPixX is offline
Send a message via ICQ to iJumPixX
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 02-15-2013 , 14:10   Re: KillTimer Problems
Reply With Quote #8

Quote:
Originally Posted by iJumPixX View Post
And how to be? What will be the correct code?
I'm a noob in sourcepawn
Just leave out the KillTimer code.
__________________
Dr. McKay is offline
iJumPixX
Junior Member
Join Date: Feb 2013
Location: Russian Federation
Old 02-16-2013 , 05:24   Re: KillTimer Problems
Reply With Quote #9

Quote:
Originally Posted by Dr. McKay View Post
Just leave out the KillTimer code.
I still do not understand it, but thanks for the help ;)

----

Error was not even on the code ReFlexPoison.
Sorry for my english ;)

Last edited by iJumPixX; 02-16-2013 at 05:31.
iJumPixX is offline
Send a message via ICQ to iJumPixX
iJumPixX
Junior Member
Join Date: Feb 2013
Location: Russian Federation
Old 02-18-2013 , 06:39   Re: KillTimer Problems
Reply With Quote #10

UP!
iJumPixX is offline
Send a message via ICQ to iJumPixX
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 16:36.


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