View Single Post
  #1  
Old 05-15-2009, 07:08 AM
Stryke Stryke is offline
Scripter
Join Date: Apr 2008
Posts: 157
Stryke is an unknown quantity at this point
function onPlayerChats() delayed if there is an onTimeout() in the script

It seems that if you have the onPlayerChats() event in a script and an onTimeout() event, there is a slight delay when the function is called. It might be just me, but I'm not sure, so I decided to post it here.

If you have just the following below, the player's chat will be set to "" just fine without any delay.
PHP Code:
function onPlayerChats()
{
  if (
player.chat == "/test")
  {
    
player.chat "";
  }

However, if you have this:
PHP Code:
function onCreated()
{
  
setTimer(.05);
}

function 
onTimeout()
{
  
//doesn't even need code here
  
setTimer(.05);
}

function 
onPlayerChats()
{
  if (
player.chat == "/test")
  {
    
player.chat "";
  }

The above code will have a slight delay for onPlayerChats() to be called.

Well, there is a workaround for this by just putting the onPlayerChats event into a different WNPC, however i'd still like this fixed.
Reply With Quote