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

How do i create a Plugin Timer??


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WolfGang
BANNED
Join Date: Oct 2010
Old 12-18-2010 , 22:25   How do i create a Plugin Timer??
Reply With Quote #1

[L4D2] Ok so i was just wonder how do i create a timer for a plugin??
Example if you dont know what i mean...

I wanna make the plugin announce it self every 30sec when a player connects and disable it when a player disconnect.

...i wanna make this plugin announce it self every 30sec...

Last edited by WolfGang; 12-18-2010 at 22:31.
WolfGang is offline
Farzad
SourceMod Donor
Join Date: Jul 2010
Location: Canada
Old 12-19-2010 , 12:41   Re: How do i create a Plugin Timer??
Reply With Quote #2

To save the handle id:
new Handle:TimerHandle[MaxClients]

To create a timer:
http://docs.sourcemod.net/api/index....d=show&id=156&

Ex:
TimerHandle[client] = CreateTimer(30.0, annouceself);

To cancel timer:
http://docs.sourcemod.net/api/index....d=show&id=241&

Ex.
CloseHandle(TimerHandle[client]);


Let me know if you need any further help or if you don't understand anything.
__________________
Farzad is offline
Send a message via MSN to Farzad Send a message via Yahoo to Farzad
UJKA
New Member
Join Date: Dec 2010
Location: Belgrade, Serbia
Old 12-20-2010 , 10:50   Re: How do i create a Plugin Timer??
Reply With Quote #3

I looking for this too. Thanks Farzad
UJKA is offline
Send a message via Skype™ to UJKA
Farzad
SourceMod Donor
Join Date: Jul 2010
Location: Canada
Old 12-21-2010 , 19:19   Re: How do i create a Plugin Timer??
Reply With Quote #4

No problem, let me know if you need any else.
__________________
Farzad is offline
Send a message via MSN to Farzad Send a message via Yahoo to Farzad
nigelqujs
New Member
Join Date: Feb 2011
Old 02-22-2011 , 00:56   Re: How do i create a Plugin Timer??
Reply With Quote #5

Quote:
Originally Posted by Farzad View Post
To save the handle id:
new Handle:TimerHandlehttp://docs.sourcemod.net/api/index....d=show&id=156&[/url]

Ex:
TimerHandleCreateTimer(30.0, annouceself);[/color]

To cancel timer:
http://docs.sourcemod.net/api/index....d=show&id=241&

Ex.
CloseHandle(TimerHandle[client]);


Let me know if you need any further help or if you don't understand anything.
Is the link expired? Why I cannot open the link here?
nigelqujs 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 07:27.


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