Graal Forums

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

Yen 11-03-2005 03:35 AM

Timestamp
 
I'm on the bug again..

Is there any function that gives you the current date/time?
I think I've seen one used before.. I've attempted to use timevar2 to find the date/time, but it seems to be off. According to the value it was returning, it's only been 10 days. O_o

If there isn't a function, could one be added?

ZeLpH_MyStiK 11-03-2005 03:38 AM

Quote:

Originally Posted by Yen
I'm on the bug again..

Is there any function that gives you the current date/time?
I think I've seen one used before.. I've attempted to use timevar2 to find the date/time, but it seems to be off. According to the value it was returning, it's only been 10 days. O_o

If there isn't a function, could one be added?

timevar2 can be used to give you the exact time and date. I've scripted one for #gscript, and it worked perfectly well.

Yen 11-03-2005 03:40 AM

minutes = timevar2 / 60;
hours = minutes / 60;
days = hours / 24;

Neh?

Polo 11-03-2005 04:33 AM

Quote:

Originally Posted by Yen
I've attempted to use timevar2 to find the date/time, but it seems to be off. According to the value it was returning, it's only been 10 days. O_o

On serverside, timevar2 is unixtime, on clientside, its the time in seconds since the computer was switched on. Could this be the source of your problem? :)

Yen 11-03-2005 04:36 AM

It's giving me the same thing on both client and serverside..

EDIT: Nevermind. For some odd reason, I had two //#CLIENTSIDE lines.. O-o
Thanks.


But it'd still be nice to be able to read from your computer's clock to get the date/time.

Polo 11-03-2005 04:47 AM

Well what you can do is set the unix time from serverside in a clientr. variable, then interpret that on clientside to adjust the clientside timevar2 to unixtime (by taking the difference, then summing it back on when doing timestamps). It'll be out be a few seconds due to lag, but should be ok.

If your using the timestamps for some kind of secure thing though, you should probably be doing it all on serverside. ^^


All times are GMT +2. The time now is 07:17 PM.

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