11.09.2013, 10:42
You could just enable the in-game clock and set its value.
pawn Код:
public OnGameModeInit() {
// run UpdateTime every 1000ms
// 1000ms = 1 second
// repeating: true
SetTimer("UpdateTime", 1000, true);
}
public OnPlayerConnect(playerid) {
// Show the clock for the player
TogglePlayerClock(playerid, true);
return 1;
}
forward UpdateTime();
public UpdateTime() {
new hour, minute;
// gettime will save the values into the variables
gettime(hour, minute);
// loop all players
for (new p = 0; p < MAX_PLAYERS; p++) {
if (IsPlayerConnected(p)) {
// set the in-game time and
SetPlayerTime(p, hour, minute);
}
}
}