[Ajuda] problema com sistema de Gang Zone
#1

estou tentando faze minha gang zone prolonga quando tiver um player defendendo a gangzone mais nгo ta dando certo fiz o debug mais n consegui identificar onde estб o erro.

pawn Код:
forward DominarGz(playerid, g);
public DominarGz(playerid, g)
{
    GrooveEmGz = 0;
    print("G = 0");
    BallasEmGz = 0;
    print("B = 0");
    VagosEmGz = 0;
    print("V = 0");
    AztecasEmGz = 0;
    print("A = 0");
    CopsEmGz = 0;
    print("C = 0");
    FarcEmGz = 0;
    print("F = 0");
    FaEmGz = 0;
    print("E = 0");

    for(new i; i < MAX_PLAYERS; ++i)
    {
        print("1");
        if (IsPlayerConnected(i))
        {
            print("2");
            if (IsPlayerInZone(i, GangZoneInfo[g][gzMinX], GangZoneInfo[g][gzMinY], GangZoneInfo[g][gzMaxX], GangZoneInfo[g][gzMaxY]))
            {
                print("3");
                if (PlayerInfo[i][pGang] == TEAM_GROVE)
                {
                    print("4");
                    GrooveEmGz++;
                }
                if (PlayerInfo[i][pGang] == TEAM_BALLAS)
                {
                    print("5");
                    BallasEmGz++;
                }
                if (PlayerInfo[i][pGang] == TEAM_VAGOS)
                {
                    print("6");
                    VagosEmGz++;
                }
                if (PlayerInfo[i][pGang] == TEAM_AZTECAS)
                {
                    print("7");
                    AztecasEmGz++;
                }
                if (PlayerInfo[i][pGang] == TEAM_COPS)
                {
                    print("8");
                    CopsEmGz++;
                }
                if (PlayerInfo[i][pGang] == TEAM_FARC)
                {
                    print("9");
                    FarcEmGz++;
                }
                if (PlayerInfo[i][pGang] == TEAM_FA)
                {
                    print("10");
                    FaEmGz++;
                }
            }
            if(GrooveEmGz != 0 && BallasEmGz == 0 && VagosEmGz == 0 && AztecasEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
            {
                print("11");
                if(BallasEmGz != 0 && GrooveEmGz == 0 && VagosEmGz == 0 && AztecasEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
                {
                    print("12");
                    if(VagosEmGz != 0 && GrooveEmGz == 0 && BallasEmGz == 0 && AztecasEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
                    {
                        print("13");
                        if(AztecasEmGz != 0 && GrooveEmGz == 0 && BallasEmGz == 0 && VagosEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
                        {
                            print("14");
                            if(CopsEmGz != 0 && GrooveEmGz == 0 && BallasEmGz == 0 && VagosEmGz == 0 && AztecasEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
                            {
                                print("15");
                                if(FarcEmGz != 0 && GrooveEmGz == 0 && BallasEmGz == 0 && VagosEmGz == 0 && AztecasEmGz == 0 && CopsEmGz == 0 && FaEmGz == 0)
                                {
                                    print("16");
                                    if(FaEmGz != 0 && GrooveEmGz == 0 && BallasEmGz == 0 && VagosEmGz == 0 && AztecasEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0)
                                    {
                                        print("17");
                                        new str[77];
                                        format(str, 77, "[TERRITУRIO]: O combate em %s foi prolongado.", GangZoneInfo[g][gzName]);
                                        SendRadioMessage(1, 0x00B2EEFF, str);
                                        SendRadioMessage(2, 0x00B2EEFF, str);
                                        SendRadioMessage(3, 0x00B2EEFF, str);
                                        SendRadioMessage(4, 0x00B2EEFF, str);
                                        SendRadioMessage(5, 0x00B2EEFF, str);
                                        SendRadioMessage(6, 0x00B2EEFF, str);
                                        SendRadioMessage(7, 0x00B2EEFF, str);
                                        TempoGz = SetTimerEx("DominarGz", 3000, 0, "ii", i, g);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    if(GrooveEmGz != 0 && BallasEmGz == 0 && VagosEmGz != 0 && AztecasEmGz == 0 && CopsEmGz != 0 && FarcEmGz == 0 && FaEmGz != 0)
    {
        GangZoneInfo[g][gzOwner] = PlayerInfo[playerid][pGang];
        printf("Gangzone %d atualizada: Owner: %d", g, GangZoneInfo[g][gzOwner]);
        GangZoneStopFlashForAll(GangZoneInfo[g][gzId]);
        GangZoneHideForAll(GangZoneInfo[g][gzId]);

        GangZoneShowForAll(GangZoneInfo[g][gzId], GetGangColor(playerid));
        new str[90];
        format(str, 90, "[TERRITУRIOS]: %s consegue manter o controle de %s.", GetPlayerOrg(playerid), GangZoneInfo[g][gzName]);
        SendClientMessageToAll(0xFFFF00AA, str);
        SendClientMessage(playerid, -1, "Parabйns! Agora este territуrio pertence a sua gangue!");
        KillTimer(TempoGz);
        SaveGangZone(playerid);
        return 1;
    }
    else if(GrooveEmGz == 0 && BallasEmGz == 0 && VagosEmGz == 0 && AztecasEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
    {
        new str[90];
        format(str, 90, "[TERRITУRIOS]: O territorio em %s estб livre de gangster", GangZoneInfo[g][gzName]);
        SendClientMessageToAll(0xFFFF00AA, str);
        GangZoneStopFlashForAll(GangZoneInfo[g][gzId]);
        GangZoneShowForAll(GangZoneInfo[g][gzId], 0xFFFFFF96);
        GangZoneInfo[g][gzStats] = 0;
        KillTimer(TempoGz);
        return 1;
    }
    return 1;
}
Reply
#2

Quote:

print("G = 0");

printf("G = 0"); E assim sucessivamente
Reply
#3

pawn Код:
if(BallasEmGz != 0 && GrooveEmGz == 0 && VagosEmGz == 0 && AztecasEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
{
    GangZoneInfo[g][gzOwner] = PlayerInfo[playerid][pGang];
    printf("Gangzone %d atualizada: Owner: %d", g, GangZoneInfo[g][gzOwner]);
    GangZoneStopFlashForAll(GangZoneInfo[g][gzId]);
    GangZoneHideForAll(GangZoneInfo[g][gzId]);

    GangZoneShowForAll(GangZoneInfo[g][gzId], GetGangColor(playerid));
    new str[90];
    format(str, 90, "[TERRITУRIOS]: Ballas consegue manter o controle de %s.", GangZoneInfo[g][gzName]);
    SendClientMessageToAll(0xFFFF00AA, str);
    SendClientMessage(playerid, -1, "Parabйns! Agora este territуrio pertence a sua gangue!");
    KillTimer(TempoGz);
    SaveGangZone(playerid);
    return 1;
}
else if(GrooveEmGz != 0 && BallasEmGz == 0 && VagosEmGz == 0 && AztecasEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
{
    GangZoneInfo[g][gzOwner] = PlayerInfo[playerid][pGang];
    printf("Gangzone %d atualizada: Owner: %d", g, GangZoneInfo[g][gzOwner]);
    GangZoneStopFlashForAll(GangZoneInfo[g][gzId]);
    GangZoneHideForAll(GangZoneInfo[g][gzId]);

    GangZoneShowForAll(GangZoneInfo[g][gzId], GetGangColor(playerid));
    new str[90];
    format(str, 90, "[TERRITУRIOS]: Groove consegue manter o controle de %s.", GangZoneInfo[g][gzName]);
    SendClientMessageToAll(0xFFFF00AA, str);
    SendClientMessage(playerid, -1, "Parabйns! Agora este territуrio pertence a sua gangue!");
    KillTimer(TempoGz);
    SaveGangZone(playerid);
    return 1;
}
else if(VagosEmGz != 0 && GrooveEmGz == 0 && BallasEmGz == 0 && AztecasEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
{
    GangZoneInfo[g][gzOwner] = PlayerInfo[playerid][pGang];
    printf("Gangzone %d atualizada: Owner: %d", g, GangZoneInfo[g][gzOwner]);
    GangZoneStopFlashForAll(GangZoneInfo[g][gzId]);
    GangZoneHideForAll(GangZoneInfo[g][gzId]);

    GangZoneShowForAll(GangZoneInfo[g][gzId], GetGangColor(playerid));
    new str[90];
    format(str, 90, "[TERRITУRIOS]: Vagos consegue manter o controle de %s.", GangZoneInfo[g][gzName]);
    SendClientMessageToAll(0xFFFF00AA, str);
    SendClientMessage(playerid, -1, "Parabйns! Agora este territуrio pertence a sua gangue!");
    KillTimer(TempoGz);
    SaveGangZone(playerid);
    return 1;
}
else if(AztecasEmGz != 0 && GrooveEmGz == 0 && BallasEmGz == 0 && VagosEmGz== 0 && CopsEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
{
    GangZoneInfo[g][gzOwner] = PlayerInfo[playerid][pGang];
    printf("Gangzone %d atualizada: Owner: %d", g, GangZoneInfo[g][gzOwner]);
    GangZoneStopFlashForAll(GangZoneInfo[g][gzId]);
    GangZoneHideForAll(GangZoneInfo[g][gzId]);

    GangZoneShowForAll(GangZoneInfo[g][gzId], GetGangColor(playerid));
    new str[90];
    format(str, 90, "[TERRITУRIOS]: Aztecas consegue manter o controle de %s.", GangZoneInfo[g][gzName]);
    SendClientMessageToAll(0xFFFF00AA, str);
    SendClientMessage(playerid, -1, "Parabйns! Agora este territуrio pertence a sua gangue!");
    KillTimer(TempoGz);
    SaveGangZone(playerid);
    return 1;
}


else if(GrooveEmGz != 0 && BallasEmGz != 0 && VagosEmGz != 0 && AztecasEmGz != 0 && CopsEmGz != 0 && FarcEmGz != 0 && FaEmGz != 0)
{
    print("17");
    new str[77];
    format(str, 77, "[TERRITУRIO]: A gangzone em %s foi prolongada.", GangZoneInfo[g][gzName]);
    SendRadioMessage(1, 0x00B2EEFF, str);
    SendRadioMessage(2, 0x00B2EEFF, str);
    SendRadioMessage(3, 0x00B2EEFF, str);
    SendRadioMessage(4, 0x00B2EEFF, str);
    SendRadioMessage(5, 0x00B2EEFF, str);
    SendRadioMessage(6, 0x00B2EEFF, str);
    SendRadioMessage(7, 0x00B2EEFF, str);
    TempoGz = SetTimerEx("DominarGz", 3000, 0, "ii", i, g);
    return 1;
}
else if(GrooveEmGz == 0 && BallasEmGz == 0 && VagosEmGz == 0 && AztecasEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
{
    new str[90];
    format(str, 90, "[TERRITУRIOS]: O territorio em %s estб livre de gangster", GangZoneInfo[g][gzName]);
    SendClientMessageToAll(0xFFFF00AA, str);
    GangZoneStopFlashForAll(GangZoneInfo[g][gzId]);
    GangZoneShowForAll(GangZoneInfo[g][gzId], 0xFFFFFF96);
    GangZoneInfo[g][gzStats] = 0;
    KillTimer(TempoGz);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)