isplayerindynamicarea problem
#1

i have a problem when someone starts capturing a zone with all the team, if the player who started capturing dies the zone fails to be captured!!!
i wanna do it only if all the team dies then the zone will fail...
so can anyone help ? thanks

pawn Код:
public onplayerdeath...
{
   if(IsPlayerInDynamicArea(playerid, testRect))
    {
        UnderAttack[test] = 0;
        GangZoneStopFlashForAll(Zone[test]);
        KillTimer(timer[playerid][test]);
    }
        return 1;
}
Reply
#2

anyone know how can i fix this?
Reply
#3

Create a lobal var per team.

Each time a player who has a team enter a dynamic area, you increment the team's var.
Each time a player who has a team exits a dynamic area, you decrement the team's var.
Each time a player who has a team dies in a dynamic area, you decrement the team's var.

Kill the timer, stop flashing etc only when it was the last player of the team in the area (so basically when the var's value is 1).
Reply
#4

example like this?

pawn Код:
public OnPlayerLeaveDynamicArea(playerid, areaid)
{
    new players;
    for (new i; i < MAX_PLAYERS; i++)
    {
    if (gTeam[i] != dini_Int(pFile(playerid),"nameoffaction")) players++;
    {
    //ocean
    if(areaid == oceanRect)
    {
        UnderAttack[ocean] = 0;
        capturedrecently[ocean] = 1;
        GangZoneStopFlashForAll(Zone[ocean]);
        KillTimer(timer[playerid][ocean]);
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)