Two people capturing?
#1

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:
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);
    }
}
Hope you can help me!
Reply
#2

Bump..
Reply
#3

i beleive you can add global variable called
pawn Код:
new BeingCaptured;
and When someone starts capturing set the variable value to 1 and when he is done from capturing it goes to 0,and add another statment in your code
pawn Код:
if(BeingCaptured == 1) return SendClientMessage(playerid, -1,"Someone is already capturing!");
hope this helped
Reply
#4

OFF: I suggest you to reduce the capture time if there are 2 or more players in the same checkpoint.
Reply
#5

Anyway how can I make it that if another player comes to the zone, it becomes half the time to capture it? Using that BeingCaptured?
Anyway I will try it.
Reply
#6

Guys, if I wanna make it that if your team is capturing and you enter the zone, you capture the same zone with him, how do I do that? I tried but failed.. It would be great to tell me how
Reply
#7

@madhi, this worked, thanks alot(Gonna rep+ when I can coz i already gave 3 reps)
But if u can help with the above, would be nicer ^^
Reply
#8

Guys, so somehow it got fixed, i have no idea how, that BeingCaptured made it worse but anyway its all fixed now
but Im having one problem
if ur team is capturing and u enter it, it says its under attack, but if u exit it, it stops the other guy from capturing it.. even if hes still in it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)