Zone Stop attacking problem
#1

Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    for(new x=0; x < sizeof(CP); x++)
    {
        if(checkpointid == CP[x])
        {
            if(UnderAttack[x] == 1)
         	{
             	SendClientMessage(playerid, 0xFF0000FF,"This zone is already being captured!");
         	}
         	else if(gTeam[playerid] == tCP[x])
         	{
             	SendClientMessage(playerid, 0xFF0000FF,"This zone is already captured by your team!");
         	}
         	else if(gTeam[playerid] == TEAM_NONE)
         	{
             	SendClientMessage(playerid, 0xFF0000FF,"You have no team so you cannot capture!");
         	}
         	else
         	{
	            UnderAttack[x] = 1;
	            timer[playerid][x] = SetTimerEx("SetCaptureZone", 25000, false,"i",playerid);
	            CountTime[playerid] = SetTimerEx("CountDown", 1, false,"i", playerid);
	            InCP[playerid] = x;
	            Captured[Zone1] = 0;
	            switch(gTeam[playerid])
	            {
	                case TEAM_United_States: GangZoneFlashForAll(Zone[x], COLOR_LIGHTERBLUE);
	                case TEAM_United_Kingdom: GangZoneFlashForAll(Zone[x], COLOR_RED);
	                case TEAM_Dubai: GangZoneFlashForAll(Zone[x], COLOR_ORANGELIGHT);
	                case TEAM_Europe: GangZoneFlashForAll(Zone[x], COLOR_GREENLIGHT);
	                case TEAM_Kemirov: GangZoneFlashForAll(Zone[x], COLOR_BROWNLIGHT);
	                case TEAM_Asia: GangZoneFlashForAll(Zone[x], COLOR_YELLOW);
	                
	            }
            	SendClientMessage(playerid, COLOR_YELLOW,"Wait 25 seconds to capture this zone");
         	}
		}
	}
 	return 1;
}
forward OnPlayerLeaveDynamicCP(playerid, checkpointid);
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
    for(new x=0; x < sizeof(CP); x++)
    {
        if(checkpointid == CP[x])
        {
            if(Captured[x] == 1)
            {
                GangZoneStopFlashForAll(Zone[x]);
	            UnderAttack[x] = 0;
	            InCP[playerid] = 0;
	            tCP[x] = gTeam[playerid];
	            switch(gTeam[playerid])
	            {
	                case TEAM_United_States: GangZoneShowForAll(Zone[x], COLOR_LIGHTERBLUE);
	                case TEAM_United_Kingdom: GangZoneShowForAll(Zone[x], COLOR_RED);
	                case TEAM_Dubai: GangZoneShowForAll(Zone[x], COLOR_ORANGELIGHT);
	                case TEAM_Europe: GangZoneShowForAll(Zone[x], COLOR_GREENLIGHT);
	                case TEAM_Kemirov: GangZoneShowForAll(Zone[x], COLOR_BROWNLIGHT);
	                case TEAM_Asia: GangZoneShowForAll(Zone[x], COLOR_YELLOW);
	            }
			}
		}
	}
    return 1;
}
Hello guys, i have problem when i leaving the CP its keep Capture the zone anyone can fix the code for fix it please ?
and any one can help me add time left message/textdraw Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)