26.10.2010, 11:34
If you want it to be 10 o'clock real time (server time) then you could do this, you'll need to make some minor edits if you want it for ingame time:
If you wanted it to be ingame time then you'd do a similar thing except you'd have to use SetWorldTime every hour (or however long you want an ingame hour to be ...), have a global variable and then set war = 1 when the hour is 0.
pawn Код:
forward WarSync();
public OnGameModeInit()
{
// Set a repeating timer to check the time every second for precision
SetTimer("WarSync", 1000, true);
}
public WarSync()
{
new
hours,
minutes,
seconds;
// Save the time into the variables.
gettime(hours, minutes, seconds);
// Check if the hour of the day is 10 o'clock.
if (hours == 10)
war = 1;
else
war = 0;
}