How to set time ?
#4

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:

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;
}
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.
Reply


Messages In This Thread
How to set time ? - by gunnrcrakr - 26.10.2010, 08:00
Re: How to set time ? - by Jochemd - 26.10.2010, 08:05
Re: How to set time ? - by gunnrcrakr - 26.10.2010, 11:05
Re: How to set time ? - by Simon - 26.10.2010, 11:34
Re: How to set time ? - by Jochemd - 26.10.2010, 11:37
Re: How to set time ? - by gunnrcrakr - 26.10.2010, 14:12

Forum Jump:


Users browsing this thread: 1 Guest(s)