Ingame world time
#5

I see no problem with TogglePlayerClock, its just unfortunate that there isn't a function to set the clock for all players
Using a textdraw instead would be a bit more effective (no need for the while loop)

PHP код:
// OnGameModeInit
SetTimerEx("Clock"750true"i"gettime() - 60 2); // start at 3 o'clock
// OnPlayerSpawn ?
TogglePlayerClock(playeridtrue);
//
forward Clock(start);
public 
Clock(start) {
    const 
sec 2;
    new
        
diff = ((gettime() - start) / sec) % (60 24),
        
GetPlayerPoolSize(),
        
minute diff 60,
        
hour diff 60
    
;
    while(
>= 0) {
        
SetPlayerTime(i--, hourminute);
    }

The problem is the update rate because we can't replicate 1 second exact, therefore I use a faster rate
Reply


Messages In This Thread
Ingame world time - by fuckingcruse - 02.07.2016, 13:00
Re: Ingame world time - by Nero_3D - 02.07.2016, 13:07
Re: Ingame world time - by fuckingcruse - 02.07.2016, 13:15
Re: Ingame world time - by Dayrion - 02.07.2016, 13:34
Re: Ingame world time - by Nero_3D - 02.07.2016, 16:09

Forum Jump:


Users browsing this thread: 1 Guest(s)