Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   scheduleEvent (https://forums.graalonline.com/forums/showthread.php?t=69526)

contiga 10-19-2006 09:49 PM

scheduleEvent
 
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.

Ty.

Admins 10-20-2006 03:06 AM

You could pass the time of the scheduling as parameter?
like scheduleevent(5,"onexplosion",timevar2)

contiga 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?

Riot 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.

contiga 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.

Riot 10-21-2006 07:06 PM

Yes it does, it gives up to 8 or 9 decimal places I believe.

contiga 10-22-2006 01:36 PM

Quote:

Originally Posted by Riot (Post 1233909)
Yes it does, it gives up to 8 or 9 decimal places I believe.

Okay thanks then :D


All times are GMT +2. The time now is 05:39 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.