View Single Post
Old 17/01/2020, 04:15 PM   #3
DomagojSellug
Huge Clucker
 
DomagojSellug's Avatar
 
Join Date: Sep 2016
Location: Croatia
Posts: 255
Reputation: 22
Default Re: Make the world time the same for everyone

pawn Code:
// Somewhere in your script;
new hour, minute, second;

public OnGameModeInit(){
    gettime(hour, minute, second); // get current server time
    SetTimer("updateWorldTime", 360000, true); // set a timer every hour
}
forward updateWorldTime();
public updateWorldTime(){
    gettime(hour, minute, second); // get current server time every hour so it's updated
}

OnPlayerConnect(playerid){
    SetPlayerTime(playerid, hour, 0); // when player connects, it sets their time to the server time automatically which is updated every hour
}

That's the simplest I could write here, hope it helps!
__________________

San Andreas Multiplayer server based off Counter Strike: Global Offensive.

Join us today!

DISCORD: discord.sa-go.info
WEBSITE: http://sa-go.info
SERVER IP: samp.sa-go.info
DomagojSellug is offline   Reply With Quote