SA-MP Forums Archive
timer - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: timer (/showthread.php?tid=596598)



timer - GeneralAref - 20.12.2015

how to add timer for this?In the bottom of the page
Second: 25
Second: 24
Second: 23
Second: 22
...
Код:
stock ActiveRefinery(playerid)
{
		if(UnderAttack[Refinery] == 0)
		{
			if(!IsPlayerInAnyVehicle(playerid))
		 	{
			 	UnderAttack[Refinery] = 1;
     			timer[playerid][Refinery] = SetTimerEx("RefineryTimer", 25000, false,"i",playerid);
			 	Captured[playerid][Refinery] = 0;
			 	SendClientMessage(playerid, 0xFFFFFFFF,"| Stay in this checkpoint for 25 seconds to capture it! |");
             	if(gTeam[playerid] == TEAM_Internationalforces)
			    {
				  GangZoneFlashForAll(Zone[Refinery], TEAM_Internationalforces_COLOUR);
				}
				else if(gTeam[playerid] == TEAM_Daesh)
				{
			      GangZoneFlashForAll(Zone[Refinery], TEAM_Daesh_COLOUR);
			    }

				//------Message-----
			    if(tCP[Refinery] == TEAM_Internationalforces)
			    {
			      SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by Internationalforces!");
			      SendClientMessageToAll(COLOR_GREEN,"*Capture Zone is under attack!");
			    }
			    else if(tCP[Refinery] == TEAM_Daesh)
			    {
			      SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by Daesh!");
			      SendClientMessageToAll(COLOR_GREEN,"*Capture Zone is under attack!");
			    }

				else if(tCP[Refinery] == NONE)
				{
			      SendClientMessage(playerid, COLOR_WHITE,"This flag is not controlled by any team!");
				}
				//---------loop-------//
				for(new i = 0; i < MAX_PLAYERS; i ++)
				{
				   IsPlayerCapturing[i][Refinery] = 1;
				}
			}
			else return CaptureZoneMessage(playerid, 1);
		}
		else return CaptureZoneMessage(playerid, 2);
		return 1;
}