24.04.2010, 23:13
i got the time enabled with TogglePlayerClock(playerid, 1); but its not setting the weather to the time like making it dark
static i_ServerSeconds;
static i_ServerMinutes;
static i_ServerHours;
forward ProcessGameTime();
public OnGameModeInit()
{
SetWorldTime(i_ServerHours);
SetTimer("ProcessGameTime", 1000, 1);
}
public ProcessGameTime()
{
if(++i_ServerSeconds == 60)
{
if(++i_ServerMinutes == 60)
{
if(++i_ServerHours == 24)
{
i_ServerHours = 0;
}
SetWorldTime(i_ServerHours);
i_ServerMinutes = 0;
}
i_ServerSeconds = 0;
}
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
SetPlayerTime(playerid, i_ServerHours, i_ServerMinutes);
}