10.05.2010, 18:40
My clock is now synced thanks to code i found on the forums. Now, the issue is, how can i detect if it's between 8:00 and 21:00 the bank is open, but if it's from any other time outside within 8:00 and 21:00 the bank is closed?
Here is my time code:
Here is my time code:
pawn Код:
SetTimer("ClockSync", 1000, 1);
pawn Код:
forward ClockSync();
public ClockSync()
{
Second++;
if(Second == 60)
{
Minute++;
Second = 0;
}
if(Minute >= 24) Minute = 0;
for(new i; i<GetMaxPlayers(); i++) SetPlayerTime(i, Minute, Second);
new string[64];
format(string, sizeof(string), "The time [%d] [%d]", Minute, Second);
return 1;
}
pawn Код:
TogglePlayerClock(playerid, 1);