View Full Version : scheduleEvent

10-19-2006, 09:49 PM
I've scripted a bomb, using the scheduleEvent command to plan an explosion.

Since we have custom movement on Graal2001 (Bomy Island), the canbecarried(); command doesn't work.

Is there a way to check how many time has been past since I scheduled the event? I'm using sleep in the script also, so don't come with timeouts please.


10-20-2006, 03:06 AM
You could pass the time of the scheduling as parameter?
like scheduleevent(5,"onexplosion",timevar2)

10-20-2006, 10:30 PM
That's not what I ment, I mean..
Lets say in my bomb, I did;
scheduleEvent( 5, "explode", "");

And I am going to pick it up, after for example.. 2 seconds, I want something to say that it still has 3 seconds left before it's going to explode. But since it is serverside, I don't want to use a timeout to count that, due the lag it will give. Neither I want to use a timeout on clientside, since there are sleep() commands being used there.

So, basically.. I'm looking for some command that gives the time left, before the first time an event gets started (something like; getEventData( "function"); which returns the time left untill it would be started, and the params).

Is this possible?

10-20-2006, 10:54 PM
Try doing this:

Before you schedule the event set a variable to timevar2.

This will allow you to do something like "timevar2 - variable" to get the time since you scheduled it.

10-21-2006, 07:00 PM
Ofcourse ;D Smart one.

Tho, it doesn't give a variable like; 1.57 seconds.. (I think), does it?

Thank you though.

10-21-2006, 07:06 PM
Yes it does, it gives up to 8 or 9 decimal places I believe.

10-22-2006, 01:36 PM
Yes it does, it gives up to 8 or 9 decimal places I believe.

Okay thanks then :D