24.02.2018, 12:23 
	
	
	
		Bom minha barra de progress nгo aparece quando to em cima da gz dominando
Code:
	
	
	
	
Code:
PHP код:
//============================================================================== 
#include < a_samp > 
#inlcude < progress > 
//============================================================================== 
new Status_Progress_TR[MAX_PLAYERS] = 0; 
new Bar:Progress_TR[MAX_PLAYERS]; 
new Timer_Progress_TR[MAX_PLAYERS]; 
//============================================================================== 
public OnPlayerConnect(playerid) 
{ 
    Progress_TR[playerid] = CreateProgressBar(220.000000, 365.000000, 180.500000, 14.200000, 16711935, 100.0); // "tr" 
    return 1; 
} 
//============================================================================== 
public OnPlayerEnterCheckpoint(playerid) 
{ 
    if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING) return 0; 
    if(CP[playerid] == 1) 
    { 
        GameTextForPlayer(playerid, "~r~Alvo localizado!", 2500, 3); 
        DisablePlayerCheckpoint(playerid); 
        CP[playerid] = 0; 
        HidePlayerArrow(playerid); 
    } 
    if(CP[playerid] == 2) 
    { 
        GameTextForPlayer(playerid, "~r~GPS: ~w~VOCE CHEGOU!", 2500, 1); 
        DisablePlayerCheckpoint(playerid); 
        CP[playerid] = 0; 
        HidePlayerArrow(playerid); 
    } 
    for(new i = 0; i < MAX_GZS; i++) 
    { 
        if(GetPlayerVisibleDynamicCP(playerid) == ChecksDominio[i]) 
        { 
            if(Player[playerid][Admin] >= 1 || Player[playerid][Cargo] >= 4 || Player[playerid][Dono] >= 1 || Player[playerid][Lider] >= 1 || Player[playerid][BOPE] >= 4 || Player[playerid][PMRJ] >= 4 || Player[playerid][CORE] >= 4) 
            { 
                if(ContagemDominio[i] != 0) return 1; 
                if((strcmp(GZDono[i], "CV", true) == 0) && Player[playerid][Faccoes] == 1|| 
                (strcmp(GZDono[i], "CV", true) == 0) && Player[playerid][Faccoes] == 2 || 
                (strcmp(GZDono[i], "CV", true) == 0) && Player[playerid][Faccoes] == 3 || 
                (strcmp(GZDono[i], "ADA", true) == 0) && Player[playerid][Faccoes] == 4 || 
                (strcmp(GZDono[i], "ADA", true) == 0) && Player[playerid][Faccoes] == 5 || 
                (strcmp(GZDono[i], "ADA", true) == 0) && Player[playerid][Faccoes] == 6 || 
                (strcmp(GZDono[i], "TCP", true) == 0) && Player[playerid][Faccoes] == 7 || 
                (strcmp(GZDono[i], "TCP", true) == 0) && Player[playerid][Faccoes] == 8 || 
                (strcmp(GZDono[i], "TCP", true) == 0) && Player[playerid][Faccoes] == 9 || 
                (strcmp(GZDono[i], "MLC", true) == 0) && Player[playerid][Faccoes] == 10 || 
                (strcmp(GZDono[i], "MLC", true) == 0) && Player[playerid][Faccoes] == 11 || 
                (strcmp(GZDono[i], "MLC", true) == 0) && Player[playerid][Faccoes] == 12 || 
                (strcmp(GZDono[i], "CORE", true) == 0) && Player[playerid][CORE] >= 1 || 
                (strcmp(GZDono[i], "BOPE", true) == 0) && Player[playerid][BOPE] >= 1 || 
                (strcmp(GZDono[i], "PMRJ", true) == 0) && Player[playerid][PMRJ] >= 1) 
                return SCM(playerid, COR_ERRO, "[ERRO]: Sua organizaзгo jб dominou essa favela."); 
                SetPVarInt(playerid,"GZAtacada",i); 
                ContagemDominio[i] = SetTimerEx("Contagem",1000,1,"i",playerid); 
                GangZoneFlashForAll(GangZonas[GetPVarInt(playerid,"GZAtacada")],GetPlayerColor(playerid)); 
                SendFormattedMessageToAll(0xFFFFD2AA, "-GFInfo-: O '%s' estб tomando a favela '%s' da '%s'.", Nome(playerid), GangZone[i][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]); 
                // 
                ShowProgressBarForPlayer(playerid, Progress_TR[playerid]); 
                Timer_Progress_TR[playerid] = SetTimerEx("Dominando", 300, true, "i", playerid); 
                return 1; 
            } 
            else SCM(playerid, COR_ERRO, "[ERRO]: Vocк nгo tem permissгo para dominar essa favela!"); 
        } 
    } 
    return 1; 
} 
//============================================================================== 
public OnPlayerLeaveCheckpoint(playerid) 
{ 
    for(new i=0;i<MAX_GZS; i++) 
    { 
        if(GetPVarInt(playerid,"GZAtacada") != -1) 
        { 
            SCM(playerid, COR_ERRO, "[ERRO]: Vocк cancelou o dominio da favela."); 
            KillTimer(ContagemDominio[GetPVarInt(playerid,"GZAtacada")]); 
            ContagemDominio[GetPVarInt(playerid,"GZAtacada")] = 0; 
            GangZoneStopFlashForAll(GangZonas[GetPVarInt(playerid,"GZAtacada")]); 
            SetPVarInt(playerid,"GZAtacada",-1); 
            SetPVarInt(playerid,"Tempo",0); 
            // 
            Finalizar_Progress_TR(playerid); 
            return 1; 
        } 
    } 
    return 1; 
} 
//============================================================================== 
forward Contagem(playerid); 
public Contagem(playerid) 
{ 
    new string[128]; 
    if(GetPVarInt(playerid,"Tempo") == 30) 
    { 
        if(Player[playerid][BOPE] >= 1) 
        { 
            SendFormattedMessageToAll(0xFFFFD2AA, "-GFInfo-: A 'BOPE' pacificou a favela '%s' da facзгo '%s'.", GangZone[GetPVarInt(playerid,"GZAtacada")][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]); 
            GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor] = COR_BOPE; 
            GZDono[GetPVarInt(playerid,"GZAtacada")] = "BOPE"; 
        } 
        else if(Player[playerid][PMRJ] >= 1) 
        { 
            SendFormattedMessageToAll(0xFFFFD2AA, "-GFInfo-: A 'PMRJ' pacificou a favela '%s' da facзгo '%s'.", GangZone[GetPVarInt(playerid,"GZAtacada")][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]); 
            GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor] = COR_PMRJ; 
            GZDono[GetPVarInt(playerid,"GZAtacada")] = "PMRJ"; 
        } 
        else if(Player[playerid][CORE] >= 1) 
        { 
            SendFormattedMessageToAll(0xFFFFD2AA, "-GFInfo-: A 'CORE' pacificou a favela '%s' da facзгo '%s'.", GangZone[GetPVarInt(playerid,"GZAtacada")][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]); 
            GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor] = COR_CORE; 
            GZDono[GetPVarInt(playerid,"GZAtacada")] = "CORE"; 
        } 
        else if(Player[playerid][Faccoes] == 1 || Player[playerid][Faccoes] == 2  || Player[playerid][Faccoes] == 3) 
        { 
            SendFormattedMessageToAll(0xFFFFD2AA, "-GFInfo-: A facзгo 'CV' tomou a favela '%s' da '%s'.", GangZone[GetPVarInt(playerid,"GZAtacada")][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]); 
            GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor] = COR_CV; 
            GZDono[GetPVarInt(playerid,"GZAtacada")] = "CV"; 
        } 
        else if(Player[playerid][Faccoes] == 4 || Player[playerid][Faccoes] == 5  || Player[playerid][Faccoes] == 6) { 
            SendFormattedMessageToAll(0xFFFFD2AA, "-GFInfo-: A facзгo 'ADA' tomou a favela '%s' da '%s'.", GangZone[GetPVarInt(playerid,"GZAtacada")][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]); 
            GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor] = COR_ADA; 
            GZDono[GetPVarInt(playerid,"GZAtacada")] = "ADA"; 
        } 
        else if(Player[playerid][Faccoes] == 7 || Player[playerid][Faccoes] == 8  || Player[playerid][Faccoes] == 9) { 
            SendFormattedMessageToAll(0xFFFFD2AA, "-GFInfo-: A facзгo 'TCP' tomou a favela '%s' da '%s'.", GangZone[GetPVarInt(playerid,"GZAtacada")][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]); 
            GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor] = COR_TCP; 
            GZDono[GetPVarInt(playerid,"GZAtacada")] = "TCP"; 
        } 
        else if(Player[playerid][Faccoes] == 10 || Player[playerid][Faccoes] == 11 || Player[playerid][Faccoes] == 12) { 
            SendFormattedMessageToAll(0xFFFFD2AA, "-GFInfo-: A facзгo 'MLC' tomou a favela '%s' da '%s'.", GangZone[GetPVarInt(playerid,"GZAtacada")][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]); 
            GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor] = COR_MLC; 
            GZDono[GetPVarInt(playerid,"GZAtacada")] = "MLC"; 
        } 
        GivePlayerMoney(playerid, 10000); 
        GangZoneHideForAll(GangZonas[GetPVarInt(playerid,"GZAtacada")]); 
        GangZoneShowForAll(GangZonas[GetPVarInt(playerid,"GZAtacada")], GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor]); 
        KillTimer(ContagemDominio[GetPVarInt(playerid,"GZAtacada")]); 
        ContagemDominio[GetPVarInt(playerid,"GZAtacada")] = 0; 
        SetPVarInt(playerid,"GZAtacada",-1); 
        SetPVarInt(playerid,"Tempo",0); 
        // 
        Finalizar_Progress_TR(playerid); 
        return 1; 
    } 
    else 
    { 
        SetPVarInt(playerid,"Tempo",GetPVarInt(playerid,"Tempo")+1); 
        format(string,sizeof(string),"~w~%i / ~r~30", GetPVarInt(playerid,"Tempo")); 
        GameTextForPlayer(playerid, string, 2500, 3); 
    } 
    return 1; 
} 
//============================================================================== 
stock Finalizar_Progress_TR(playerid) 
{ 
   HideProgressBarForPlayer(playerid, Progress_TR[playerid]); 
   DestroyProgressBar(Progress_TR[playerid]); 
   KillTimer(Timer_Progress_TR[playerid]); 
} 
//============================================================================== 
forward Dominando(playerid); 
public Dominando(playerid) 
{ 
     Status_Progress_TR[playerid] ++; 
     SetProgressBarValue(Progress_TR[playerid], Status_Progress_TR[playerid]); 
     UpdateProgressBar(Progress_TR[playerid]); 
     if(Status_Progress_TR[playerid] == 100.0) 
     { 
         Status_Progress_TR[playerid] = 0; 
         UpdateProgressBar(Progress_TR[playerid]); 
         return 1; 
     } 
     return 1; 
} 





 -
-