Quote:
Originally Posted by admantis
Hello all again
Now I have a error here, well, actually not errors or warnings, just a bugged script.
pawn Код:
new WorldTime; public OnGameModeInit() {
SetTimer("SetHour", 5000, 1); // 3600000 = 1 hour in ms - Time was set to 5000 ms for testing purposes. WorldTime = SetWorldTime(random(24)); }
pawn Код:
forward SetHour() public SetHour() { if (WorldTime == 24) WorldTime = 0; SetWorldTime((WorldTime)+1); }
However when I go ingame nothing happens. Thought the time is properly set to a random number upto 24, it won't change every 5000 ms - 5 seconds.
EDIT: I need help really, bcs now I found out time will be set only to hour 24 OnGameModeInit.
Thanks to everyone
|
You're not increasing your "WorldTime" variable
pawn Код:
forward SetHour()
public SetHour()
{
if (WorldTime == 24) WorldTime = 0;
SetWorldTime((WorldTime)+1);
WorldTime++;
}