View Single Post
Old 17/01/2020, 08:32 PM   #12
PPC23
Little Clucker
 
Join Date: Feb 2013
Posts: 28
Reputation: 9
Default Re: Make the world time the same for everyone

About this SetWorldTime:
pawn Code:
#undef SetWorldTime
#define SetWorldTime(%1, %2) for(new i = 0,j = GetPlayerPoolSize();i <= j;i++) if(IsPlayerConnected(i)) SetPlayerTime(i, %1, %2);
It actually undefines the original function and creates a new one that uses the SetPlayerTime function to make the time the same for all players.
You can change it so the original SetWorldTime is availible again:
pawn Code:
#define SetTimeForAll(%1, %2) for(new i = 0,j = GetPlayerPoolSize();i <= j;i++) if(IsPlayerConnected(i)) SetPlayerTime(i, %1, %2);

You can use it as SetTimeForAll(hour, minutes);


EDIT:
This is all wrong. When you use SetPlayerTime to set the player's time, when the player pauses the game so the clock, so this is how the clock get's desynced for some players.
SetWorldTime doesn't have this problem, because the time is the same for all.
Disadvantage is that you can't set the minute here.
I'll try to work on this. ALTERNATIVE

Sorry for the confusion.
PPC23 is offline   Reply With Quote