27.02.2013, 14:06
Hey guys. I am trying to make constant night time on my server.
I know it's possible by disabling the player clock and setting an hour, but I need that clock running, because the weather changes more smoothly while it's activated. Otherwise I get an instant weather change, and that's not very nice. Here's what I've tried:
I've set a timer:
And then I made this function here using foreach from ******:
So after 4 minutes in game, the time should have changed back to 00:00 and start over, but it didn't. Can someone explain why?
I used the normal loop already with the same result.
I know it's possible by disabling the player clock and setting an hour, but I need that clock running, because the weather changes more smoothly while it's activated. Otherwise I get an instant weather change, and that's not very nice. Here's what I've tried:
I've set a timer:
Код:
forward timechange(); public OnFilterScriptInit() { SetTimer("timechange", 240000, true); //4 minutes in real life, so 4 hours gametime }
Код:
public timechange() { foreach (new i : Player) { SetPlayerTime(i,0,0); } }
I used the normal loop already with the same result.