Capture zone problem rep+
#8

PHP код:
new ctimer[MAX_PLAYERS];
stock ActiveTown(playerid)
{
        if(
UnderAttack[Town] == 0)
        {
            if(!
IsPlayerInAnyVehicle(playerid))
            {
                
UnderAttack[Town] = 1;
                
Captured[playerid][Town] = 0;
                
// Removed a unnecessary timer...
                
IsPlayerCapturing[playerid][Town] = 1//Fix
                
SendClientMessage(playerid, -1,"| Stay in this checkpoint for {FFFFFF}25 {FFFFFF}seconds {FFFFFF}to capture it! |");
                
CountVar[Town] = 25;
                if(
gTeam[playerid] == C1)
                {
                  
GangZoneFlashForAll(Zone[Town], COLOR_BLUE);
                }
                else if(
gTeam[playerid] == T1)
                {
                  
GangZoneFlashForAll(Zone[Town], RED);
                }
                 else if(
gTeam[playerid] == BG)
                {
                  
GangZoneFlashForAll(Zone[Town], RED);
                }
                
//------Message-----
                
if(tCP[Town] == C1)
                {
                  
SendClientMessage(playeridC_COLOR,"This flag is controlled by Cops!");
                  
SendClientMessageToAll(-1,"{FFFFFF}>{FFFFFF}Old observatory is under attack!");
                }
                else if(
tCP[Town] == T1)
                {
                  
SendClientMessage(playeridT_COLOR,"This flag is controlled by Terrorists!");
                  
SendClientMessageToAll(-1,"{FFFFFF}>{FFFFFF}Old observatory is under attack!");
                }
                else if(
tCP[Town] == BG)
                {
                  
SendClientMessage(playeridT_COLOR,"This flag is controlled by Terrorists!");
                  
SendClientMessageToAll(-1,"{FFFFFF}>{FFFFFF}Old observatory is under attack!");
                }
                else if(
tCP[Town] == NONE)
                {
                  
SendClientMessage(playeridCOLOR_WHITE,"This flag is not controlled by any team!");
                }
                
ctimer[playerid] = SetTimerEx("Count"1000true"i"playerid);
            }
            else return 
CaptureZoneMessage(playerid1);
        }
        else {
         
CaptureZoneMessage(playerid2);
         
TextDrawHideForPlayer(playeridCountText[playerid]);
         }
        return 
1;

PHP код:
forward Count(playerid);
public 
Count(playerid)
{
        if(
IsPlayerInDynamicCP(playeridCP[Town]) && UnderAttack[Town] == && IsPlayerCapturing[playerid][Town] == 1)
        {
              if(
CountVar[playerid][Town] == 0) return KillTimer(ctimer[playerid]);
            
CountVar[playerid][Town] --;
            new 
str1[124];
            
TextDrawShowForPlayer(playeridCountText[playerid]);
            
format(str1sizeof(str1),"~r~%d seconds ~w~left to ~g~capture"CountVar[playerid][Town]);
            
TextDrawSetString(CountText[playerid], str1);
                        if(
CountVar[playerid][Town] <= 0)
                       {
                           
TownCaptured(playerid);
                       }
        }
            return 
1;

Reply


Messages In This Thread
Capture zone problem rep+ - by Mijata - 09.08.2016, 16:33
Re: Capture zone problem rep+ - by K0P - 09.08.2016, 16:42
Re: Capture zone problem rep+ - by Logic_ - 09.08.2016, 16:49
Re: Capture zone problem rep+ - by Mijata - 09.08.2016, 16:52
Re: Capture zone problem rep+ - by K0P - 09.08.2016, 16:55
Re: Capture zone problem rep+ - by Mijata - 09.08.2016, 17:07
Re: Capture zone problem rep+ - by K0P - 09.08.2016, 17:10
Re: Capture zone problem rep+ - by Logic_ - 09.08.2016, 17:11
Re: Capture zone problem rep+ - by Mijata - 09.08.2016, 17:13
Re: Capture zone problem rep+ - by Logic_ - 09.08.2016, 17:16

Forum Jump:


Users browsing this thread: 1 Guest(s)