18.07.2013, 07:38
Hi guys, so I made some capture zones for my server but I'm having one problem.
If you go capture it and the timer is running, if someone from your team walks into the capturing checkpoint too, he will capture aswell.
What I mean is, it will be captured twice by the same team.
What I want is, how can I make it give an error:Your team is already capturing this zone?
But if it can be made somehow so both capture the same zone on the same timer, it would be better.
Here is a sample of OnPlayerEnterDynamicCP:
Hope you can help me!
If you go capture it and the timer is running, if someone from your team walks into the capturing checkpoint too, he will capture aswell.
What I mean is, it will be captured twice by the same team.
What I want is, how can I make it give an error:Your team is already capturing this zone?
But if it can be made somehow so both capture the same zone on the same timer, it would be better.
Here is a sample of OnPlayerEnterDynamicCP:
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == CP[CityHall])
{
if(UnderAttack[CityHall] == 0) {
if(tCP[CityHall] != gTeam[playerid]) {
CountVar[playerid][CityHall] = 25;
ActiveCityHall(playerid);
} else return SendClientMessage(playerid, COLOR_RED,"*This zone is already captured by your team!");
} else return CaptureZoneMessage(playerid, 2);
}
}