SA-MP Forums Archive
Capture zone can be captured again bug help - 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: Capture zone can be captured again bug help (/showthread.php?tid=488661)



Capture zone can be captured again bug help - FireWarrior101 - 18.01.2014

BUG happens for This SUPPLY DEPO CHECKPOINT so it can be captured again even if it was captured.The First Post Checkpoint works fine.
pawn Код:
//===========================OnPlayerEnterDynamicCP=============================
forward OnPlayerEnterDynamicCP(playerid, checkpointid);//abandoned Post
public OnPlayerEnterDynamicCP(playerid, checkpointid)//abandoned Post
{
//Supply Depo
if(checkpointid == CP[POST])
    {
        if(UnderAttack[POST] == 0)
        {
            if(tCP[POST] != pTeam[POST])
            {
                CountVar[playerid][POST] = 25;
                ActivePOST(playerid);

            } else return SendClientMessage(playerid, COLOR_RED,"*This zone is already captured by your team!");
        } else return CaptureZoneMessage(playerid, 2);
    }

//BUG happens for This SUPPLY DEPO CHECKPOINT so it can be captured again even if it was captured.The First Post Checkpoint works fine.

else if (checkpointid == CP[SUPPLYDEPO])
    {
        if(UnderAttack[SUPPLYDEPO] == 0)
        {
            if(tCP[SUPPLYDEPO] != pTeam[SUPPLYDEPO])
            {
                CountVar[playerid][SUPPLYDEPO] = 25;
                ActiveSUPPLYDEPO(playerid);
               
            } else  return SendClientMessage(playerid, COLOR_RED,"*This zone is already captured by your team!");
        } else return CaptureZoneMessage(playerid, 2);
    }
return true;
}



Re: Capture zone can be captured again bug help - FireWarrior101 - 18.01.2014

BUMP


Re: Capture zone can be captured again bug help - Blademaster680 - 18.01.2014

How are you defining "ActiveSupplyDepo, tCP, and pTeam?


Re: Capture zone can be captured again bug help - FireWarrior101 - 18.01.2014

Not fixe d


Re: Capture zone can be captured again bug help - FireWarrior101 - 20.01.2014

Bump


Re: Capture zone can be captured again bug help - ACI - 20.01.2014

return one under ActivePost andctiveSuply thing.


Note that I am on my tablet. So it would be difficult to understand.


Re: Capture zone can be captured again bug help - Sawalha - 20.01.2014

!pTeam[POST] or other zone ? that's incorrect,
variable pTeam Correct definition is
pawn Код:
new pTeam[MAX_PLAYERS]
Players, not zones, so it's pTeam[playerid]
here's my code i'm using, it's works fine:
pawn Код:
forward OnPlayerEnterDynamicCP(playerid, checkpointid);
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == CP[AREA])
    {
        if(UnderAttack[AREA] == 0)
        {
            if(tCP[AREA] !=gTeam[playerid])
            {
                CountVar[playerid][CAPZONE] = 25;
                ActiveAREA(playerid);
            }else return SendClientMessage(playerid, -1, "[ZONE] This Zone is already Captured by your team");
        }else return SendClientMessage(playerid, -1, "This zone is already Under Attack!");
    }
    return 1;
}



Re: Capture zone can be captured again bug help - FireWarrior101 - 20.01.2014

it was a variable in script that was causing other then the first capzone to be captured twice
*fixed