[SOLVED] Normal clock?
#3

Quote:
Originally Posted by SAWC™
pawn Код:
new time[2]; // 0 hours, 1 minutes
pawn Код:
public OnGameModeInit()
{
  time[0] = random(24), time[1] = random(60);
  SetTimer("ChangeTime", 1000, true);
  return 1;
}
pawn Код:
forward ChangeTime();
public ChangeTime()
{
  time[1] ++;
  if(time[1] > 59) time[1] = 0, time[0] ++;
  if(time[0] > 23) time[0] = 0, time[1] = 0;
  for(new i = 0; i < MAX_PLAYERS; i ++)
  {
    if(IsPlayerConnected(i)) SetPlayerTime(i, time[0], time[1]);
  }
  return 1;
}
That's a 24 minutes/days and 60 seconds/hour. Don't forget to use TogglePlayerClock to disable the single player clock.
Thanks, but I get this error:

Код:
undefined symbol "playerid"
At this line:

Код:
if(IsPlayerConnected(i)) SetPlayerTime(playerid, time[0], time[1]);
Reply


Messages In This Thread
[SOLVED] Normal clock? - by FreddeN - 03.03.2010, 13:39
Re: [HELP] Normal clock? - by Miguel - 03.03.2010, 13:50
Re: [HELP] Normal clock? - by FreddeN - 03.03.2010, 13:56
Re: [HELP] Normal clock? - by Miguel - 03.03.2010, 14:01
Re: [HELP] Normal clock? - by FreddeN - 03.03.2010, 14:08
Re: [HELP] Normal clock? - by MaykoX - 03.03.2010, 14:09
Re: [HELP] Normal clock? - by Miguel - 03.03.2010, 14:13
Re: [HELP] Normal clock? - by FreddeN - 03.03.2010, 16:12
Re: [HELP] Normal clock? - by Miguel - 03.03.2010, 16:17
Re: [HELP] Normal clock? - by FreddeN - 03.03.2010, 16:32

Forum Jump:


Users browsing this thread: 1 Guest(s)