SA-MP Forums Archive
World Time - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: World Time (/showthread.php?tid=467543)



World Time - AnonScripter - 03.10.2013

how to set the world time in the game to be like (Saturday to Friday) and (00:00 to 23:00)
and make the weather automatically changes that depends on what time is it.. i mean i'll set the weather manually on what X O'clock will change.


Re: World Time - Fez - 03.10.2013

This is what I use for my script.

Код:
public ClockUpdate()
{
	new string[12];
	Second += 1;
	format(string, sizeof(string), "%i:%i:%i", Hour, Minute, Second);
	if(Second == 60)
	{
	    if(Minute == 59)
		{
		    for(new i = 0; i < MAX_PLAYERS; i++)
		    {
		        if(IsPlayerConnected(i))
		        {
					if(Player[i][Faction] == 0)
					{
					    SendClientMessage(i, ORANGE, "Your check is ready to be picked up. Please head to the Job Center to get it.");
					    CheckReady[i] = 1;
					}
					else
					{
						SendClientMessage(i, ORANGE, "Your check is ready to be picked up. Please head to your headquarters to get it.");
						CheckReady[i] = 1;
					}
					}
			}
		    if(Hour == 23)
		    {
		    	Hour = 0;
		    	Minute = 0;
		    	Second = 0;
			}
			else
			{
			    Hour ++;
				Minute = 0;
				Second = 0;
			}
		}
		else
		{
		    Minute ++;
	    	Second = 0;
	 		}
	}
	format(string,sizeof (string),"%02i:%02i:%02i", Hour, Minute, Second);
	TextDrawSetString(Clock, string);
	SetWorldTime(Hour);
	return 1;
}



Re: World Time - AnonScripter - 03.10.2013

would you please explain, there is just minutes and seconds in the game, so what is hours ?
there is just 24 minutes in day in the game


Re: World Time - Fez - 03.10.2013

Quote:
Originally Posted by AnonScripter
Посмотреть сообщение
would you please explain, there is just minutes and seconds in the game, so what is hours ?
there is just 24 minutes in day in the game
Mine is an RP World Clock. It takes 24 hours IRL time for just one day to pass.

Hit me up on Skype if you would like me to explain in further detail.
Skype: JimmySAMP.