Time Error. Clock Restarts.
#1

Okay my clock shows but it starts at 16:30 and then it goes to like 17:30 then it restarts at 16:30 again.

I tried messing with it, to sync my clock to WorldTime, and I messed it up it seems.

Here's the codes that I have in my GameMode.
Could someone check these codes and make sure they are correct, if they aren't could you please fix them in a reply.

Код:
public OnGameModeInit()
{
	SetTimer("UpdateTime",65009, 1);
Код:
public OnPlayerConnect(playerid)
{
	TogglePlayerClock(playerid, 1);
	gettime(hour, minute);
 	PlayerInfo[playerid][logminute] = 0;
    SetPlayerTime(playerid,hour,minute);
Код:
public OnPlayerSpawn(playerid)
	gettime(hour, minute);
	SetPlayerTime(playerid,hour,minute);
Код:
new worldTime;
public UpdateTime()
{
        gettime(hour, minute);
   	worldTime++;
        worldTime%=24;
        SetWorldTime(hour);

	new x=0;
	while(x!=MAX_PLAYERS)
	{
 		if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE)
		{
  			SetPlayerTime(x,hour,minute);
	 	}
	 	x++;
	}
	if(minute < 1)
	{
	
  new string[128];
		format(string, 128, "Game Time: %02d:00", minute);
		SendClientMessageToAll(COLOR_GREEN, string);
Reply


Messages In This Thread
Time Error. Clock Restarts. - by David5290 - 28.01.2011, 21:37
Re: Time Error. Clock Restarts. - by David5290 - 28.01.2011, 21:59
Re: Time Error. Clock Restarts. - by David5290 - 28.01.2011, 23:03
Re: Time Error. Clock Restarts. - by David5290 - 28.01.2011, 23:55
AW: Time Error. Clock Restarts. - by Nero_3D - 29.01.2011, 00:23
Re: AW: Time Error. Clock Restarts. - by David5290 - 29.01.2011, 00:51
Re: Time Error. Clock Restarts. - by David5290 - 29.01.2011, 03:22
Re: Time Error. Clock Restarts. - by Antonio [G-RP] - 29.01.2011, 03:52
Re: Time Error. Clock Restarts. - by David5290 - 29.01.2011, 15:39
AW: Time Error. Clock Restarts. - by Nero_3D - 29.01.2011, 16:27

Forum Jump:


Users browsing this thread: 1 Guest(s)