Timer is not smooth and dont stop.
#1

Heey guys,
I made 20 seconds timer for capture zones. But the timer is not smooth and dont stop. Here is code:
onplayerpickup
Code:
if(pickupid==areap)
	{
		if(gTeam[playerid]==TEAM_EUROPE)
		{
		    if(Team_Europe_Area==0)
		    {
				capturezone=SetTimer("capturezones",1000,1);
				Team_Europe_Takes=1;
			}
			if(Team_Europe_Area==1)
		    {
				SendClientMessage(playerid,COLOR_WHITE,"This Zone Is Already From Your Team!");
			}
		}
		if(gTeam[playerid]==TEAM_USA)
		{
			if(Team_Usa_Area==0)
		    {
				capturezone=SetTimer("capturezones",1000,1);
				Team_Usa_Takes=1;
			}
			if(Team_Usa_Area==1)
		    {
				SendClientMessage(playerid,COLOR_WHITE,"This Zone Is Already From Your Team!");
			}
		}
		return 1;
	}
The timer:
Code:
forward capturezones();
public capturezones()
{
	counter--;
	new string[80];
	for(new i=0; i<MAX_PLAYERS; i++)
 	{
		format(string,sizeof(string),"Stay %d Seconds In Checkpoint For Capture!",counter);
		GameTextForPlayer(i, string, 1000, 5);
	}
	if(counter== 0)
	{
		if(Team_Europe_Area == 0 && Team_Europe_Takes==1)
		{
			GangZoneShowForAll(area,GZ_YELLOW);
			Team_Europe_Area = 1;
			Team_Europe_Takes=0;
			counter=20;
			KillTimer(capturezone);
		}
		if(Team_Usa_Area == 0 && Team_Usa_Takes==1)
		{
			GangZoneShowForAll(area,GZ_BLUE);
			Team_Usa_Area = 1;
			Team_Usa_Takes=0;
			counter=20;
			KillTimer(capturezone);
		}
		KillTimer(capturezone);
	}
}
Can anyone fix this pls?

Thanks Admigo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)