|
What i am trying to do: event in game like a boss spawn, it got killed. the time when it is killed is recorded in real life time. After 24 hours or 6 hours of real life time, it will re-spawn once a player enter the map. I had read this: http://msdn.microsoft.com/en-us/library/system.datetime.now%28VS.80%29.aspx I can records the time when boss get killed. do not know how to check if 24 hours or 6 hours has passed after boss gotten kill. prefer help with the codes in java, or C# any help would be much appreciated.
(comments are locked)
|
|
If you already know how to get the current time with datetime.now, just do the same thing in an update event, and compare the death tiem with the current time, and respawn if the desired time has elapsed. -Larry I guess i should say i don't know how to compare them.
then on the update event... This is the line that i dont know how to code: if ( (DateTime.Now - saveTime) > 12){ monsterRespawn();}
Jan 13 '12 at 04:40 PM
hdy
Try something like... if ((DateTime.Now-saveTime).Hours > 12){ monsterRespawn(); } -Larry
Jan 13 '12 at 05:25 PM
Larry Dietz
ah .Hours! Thank you
Jan 13 '12 at 05:30 PM
hdy
Glad I was able to help. -Larry
Jan 13 '12 at 05:32 PM
Larry Dietz
(comments are locked)
|
