View Single Post
  #2  
Old 01-30-2008, 01:56 PM
Theeper
Discordant
 
Join Date: May 2004
Posts: 290
Default

I am not sure of exactly what you need, but I use quest::settimer() and haven't noticed any problems with it losing track of the invoking PC.

Here is how I have used it in a couple custom scripts that seem to work fine for me on a 1085 build.

Code:
sub EVENT_SPAWN 
{
      quest::settimer("my_timer", 10);
}

sub EVENT_SAY 
{
	if ($text =~ /my timer/i) 
	{
	quest::say("Starting 10 sec timer for $name.");
	quest::settimer("my_timer", 10);
	}
}

sub EVENT_TIMER 
{
	if($timer eq "my_timer") 
	{
	quest::say("time is up for $name");
	quest::stoptimer("my_timer");
	}
}
Reply With Quote