01.04.2012, 11:17
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...
^^it is working with timer 1000 (1 second)
Код:
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);
}
}
}

