Capture zone can be captured again bug help
#1

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;
}
Reply
#2

BUMP
Reply
#3

How are you defining "ActiveSupplyDepo, tCP, and pTeam?
Reply
#4

Not fixe d
Reply
#5

Bump
Reply
#6

return one under ActivePost andctiveSuply thing.


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

!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;
}
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)