View Full Version : Timer IDs ??
Sakrateri
04-14-2005, 12:46 AM
Where or How do you find Timer IDs to use with
quest::settimer(Timer ID,180); ???
fathernitwit
04-14-2005, 04:51 AM
you can use any integer you want. Its just used to be able to tell which timer went off within your EVENT_TIMER routine, and is local to the specific quest, so you can reuse the same timer ID everywhere.... just use 0 if you dont care.
knightz
04-14-2005, 05:01 AM
Pretty sure timer id is a char, i use stuff like "mob_name_timer" and it works perfect.
Sakrateri
04-14-2005, 05:28 AM
Well ive got it set like
sub EVENT_SPAWN {
quest::settimer(1,180);
}
trying to set a timer upon spawn , but i guess it should be
sub EVENT_TIMER {
quest::settimer(1,180);
}
???
When i use it like i have it , it crashes zone exe
knightz
04-14-2005, 05:34 AM
If you want to start a timer on spawn use:
sub EVENT_SPAWN {
quest::settimer("timer_name", $seconds);
}
sub EVENT_TIMER {
if($timer eq "timer_name") {
# do stuff here
quest::stoptimer("timer_name"); # if you dont stop it, the timer restarts
}
}
Sakrateri
04-14-2005, 05:56 AM
Ok thanks , but one more question , What do I name the timer? or where would I find the name for it? sorry for being a pain and thanks for the help
RangerDown
04-14-2005, 06:04 AM
Name it whatever works for you. In the EVENT_TIMER sub you must check the value of $timer, which will be set to the name of the timer that is being triggered.
Sakrateri
04-14-2005, 06:41 AM
Ok thanks alot guys , really appriciate this :)
vBulletin® v3.8.11, Copyright ©2000-2024, vBulletin Solutions Inc.