I'm working on a quest file that automatically starts and ends events based on server time.I have a few points that I do not understand, what can I use with when?I can not find the definition of this statement in the server source code, I have at least a chance to examine where it is stored. The other problem I'm dealing with right now is;
I did with when login, there is a logic error. Each time login is done, clear_server_timer() runs and then server_loop_timer() function is running.When in my_oto_event.server_loop_timer the clocks are only checked with full equality(An example time == "13.00:00") the player will never catch it,
How can we follow a solution path?
If you need to explain what I'm trying to do with a small sample code, you can look down.
when login or enter begin -- Can we keep this part constantly ?
clear_server_timer("my_oto_event")
server_loop_timer("my_oto_event",1)
end
when my_oto_event.server_timer begin
if os.date("%X") == "13:00:00" then
game.set_event_flag("test_event1",1)
end
if os.date("%X") == "16:00:00" then --end
game.set_event_flag("test_event1",0)
end
end