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

question about timers


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kirewv
Senior Member
Join Date: Oct 2007
Old 05-01-2008 , 02:48   question about timers
Reply With Quote #1

if I have a handle to hold different timers and I have the following:

PHP Code:
client_Timer[client] = CreateTimer(0.1Timer_activityclientTIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE); 
and then later while the timer is still running:

PHP Code:
client_Timer[client] = CreateTimer(0.4Timer_activityEndclientTIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE); 
Will the second code automatically overwrite and end the first timer or do I have to close the first timer before I create the second?
kirewv is offline
raydan
Senior Member
Join Date: Aug 2006
Old 05-01-2008 , 08:07   Re: question about timers
Reply With Quote #2

Code:
client_Timer[client] = INVALID_HANDLE;
client_Timer[client] = CreateTimer(0.1, Timer_activity, client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
.
.
.
if(client_Timer[client] != INVALID_HANDLE)
{
KillTimer(client_Timer[client]);
client_Timer[client] = INVALID_HANDLE;
}
client_Timer[client] = CreateTimer(0.4, Timer_activityEnd, client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
raydan is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 05-01-2008 , 19:29   Re: question about timers
Reply With Quote #3

Restarting the timer it with the same return variable won't stop the first timer, you need to close it yourself. You can do so with CloseHandle() or KillTimer()
Greyscale 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:00.


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