SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 21/08/2011, 09:17 AM   #1
Admigo
High-roller
 
Admigo's Avatar
 
Join Date: Oct 2010
Location: The Netherlands
Posts: 1,840
Reputation: 297
Default Timer is not smooth and dont stop.

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
__________________
Follow me on Instagram @brandonvanommen
Admigo is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timer dont stop sometimes:s Admigo Help Archive 4 16/08/2011 03:00 PM
Timer don't want to stop ;D Daslee Help Archive 4 28/08/2010 10:02 PM
Stop The Timer Ironboy500 Help Archive 6 18/11/2009 01:42 PM
timer wont stop dice7 Help Archive 6 14/04/2009 05:47 PM
Servers dont stop >.<. LudicrouSz Client Support 2 12/04/2009 11:20 AM


All times are GMT. The time now is 05:19 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.