Timer doesn't work properly
#1

Hello, i have a little problem with timer.

I have timer that is counting points for pay on server. You need 60 points to get pay. For every min on server you get 1 point, and so on. Common pay system. Recently for no reason my timer started bugging. It worked all allright and suddenly. On some players it works and after some time it stops working, but mostly it doesn't work. It works fine 1-2 hours after server restart and then it starts bugging.

This is code that i'm using in function
Код:
public OnPlayerConnect(playerd)
Код:
PlataTimer[playerid] = SetTimerEx("TimerZaPlatu", 60000,true, "i", playerid);
This is code that i'm using in function
Код:
public OnPlayerDisconnect(playerid)
Код:
KillTimer(PlataTimer[playerid]);
And this is timer function code

Код:
forward TimerZaPlatu(playerid);
public TimerZaPlatu(playerid)
{
    new sat, minut, sekund, godina, mesec, dan;
	gettime(sat, minut, sekund);
	getdate(godina, mesec, dan);
	new szString[64], ime[MAX_PLAYER_NAME];
	RPIme(playerid, ime);
	PI[playerid][PayDayPoeni]++;
	if(PI[playerid][PayDayPoeni] == 50)
	{
		if(PI[playerid][Banka] < 0){
			format(szString, sizeof(szString), "| {1E90FF}Nova Banka{ffffff} | Stanje na vasem racunu je u minusu $%d, vratite dug kako ne biste bili kaznjeni.",PI[playerid][Banka]);
			SCM(playerid, -1, szString);
		}
	}
    if(PI[playerid][PayDayPoeni] >= 60){
		PayDay(playerid);
		PI[playerid][PayDayPoeni] = 0;
		hDobioPay[playerid] = 0;
		format(szString, sizeof(szString), "%s je dobio platu. Vreme: %d sati, %d min, %d sec",ime,sat,minut,sekund);
		UpisiLog(FAJL_PDDEBUGLOG, szString);
	}
	return 1;
}
How do i fix this? Any suggestions, advices... anything would be helpful.
Reply


Messages In This Thread
Timer doesn't work properly - by GGRPSkripter - 09.02.2016, 18:47
Re: Timer doesn't work properly - by AlexBlack - 09.02.2016, 18:56
Re: Timer doesn't work properly - by GGRPSkripter - 09.02.2016, 19:04
Re: Timer doesn't work properly - by ikey07 - 09.02.2016, 19:07

Forum Jump:


Users browsing this thread: 2 Guest(s)