SA-MP Forums Archive
real time watch help - 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: real time watch help (/showthread.php?tid=330395)



real time watch help - iStrow - 01.04.2012

i made watch that goes exactly like a real watch but whenever server restarts it is on 00:00:00 because it starts from zero...can I some how make that it ongamemodeinit it refreshes itself with timezone i want so i don't have to set it using a command every time server restarts...

Код:
forward TimeUpdate(playerid);
public TimeUpdate(playerid)
{
   	sekunda++;
	if(sekunda == 60)
	{
		minuta++;
		sekunda = 0;
	}
    if(minuta == 60)
	{
		sat++;
		minuta = 0;
	}
	if(sat == 24)
	{
	    sekunda = 0;
	    minuta = 0;
	    sat = 0;
	}

 	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			SetPlayerTime(i, sat, minuta);
		}
	}
}
^^it is working with timer 1000 (1 second)