Jump to content

OnTimer


88man88

Recommended Posts

The event is only sent once for every registration. Call start timer in the body of the OnTimer too.

int MyTimerInterval = 10 const
int MyTimerID = 999 const

Event OnInit()
    StartTimer(MyTimerInterval, MyTimerID)
EndEvent

Event OnTimer(int aiTimerID) 
    If (aiTimerID == MyTimerID)
        StartTimer(MyTimerInterval, MyTimerID) ; ask for another one, indefinitly
    EndIf
EndEvent

Most scripts like this should also consider a terminating condition but most objects you would attach to will automatically cancel the timer when appropriate. For example, a quest that is stopped will also cancel any timers on scripts which belong to it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...