Problem with time..
#1

Hello i use realtime but dont work. I put him in my gamemode but still dont works. Need me something to sync my time on the computer and to set it in the game and to set the weather as like is the time. Please help me!
Reply
#2

show your code
Reply
#3

Код:
//==========================[Clock]=======================================
new hour, minute;
new timestr[32];

//=========================[World Time]=========================================
new timeshift = -1;
new shifthour;
new ghour = 0;
new gminute = 0;
new gsecond = 0;
new realtime = 1;
new wtime = 15;

//==============================================================================
public UpdateTime()
{
    gettime(hour, minute);
   	format(timestr,32,"%02d:%02d",hour,minute);

   	SetWorldTime(hour);

	new x=0;
	while(x!=MAX_PLAYERS) {
	    if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) {
	        SetPlayerTime(x,hour,minute);
		 }
		 x++;
	}
}

    UpdateTime();
	SetTimer("UpdateTime",1000 * 60,1);

	gettime(ghour, gminute, gsecond);
	FixHour(ghour);
	ghour = shifthour;
	if(!realtime)
	{
		SetWorldTime(wtime);
	}
	AllowInteriorWeapons(1);
	EnableStuntBonusForAll(0);
	SetNameTagDrawDistance(60.0);
	CalculateStarted = 1;
    CalculateEvent = 1;
    Jackpot = 50000;
    EventPlayers = 0;
	if (realtime)
	{
		new tmphour;
		new tmpminute;
		new tmpsecond;
		gettime(tmphour, tmpminute, tmpsecond);
		FixHour(tmphour);
		tmphour = shifthour;
		SetWorldTime(tmphour);
	}

	gettime(hour, minute);
	SetPlayerTime(playerid,hour,minute);
I think this ghour, timeshift and etc. dont need me..
Reply
#4

Please help..
Reply
#5

Can you be more specific ?
What doesn't work ?

It doesn't show, it shows incorrect time, it doesn't set the time


My guess would be array mistype
Quote:

if (realtime)
{
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
SetWorldTime(tmphour);
}

gettime(hour, minute);
SetPlayerTime(playerid,hour,minute);

Reply
#6

Dont set the weather..
Reply
#7

Help?
Reply
#8

Please help me!
Reply
#9

Help please?
Reply
#10

Help..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)