Portal SAMP
[Ajuda] OnPlayerEnterDynamicArea - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] OnPlayerEnterDynamicArea (/showthread.php?tid=1282)



OnPlayerEnterDynamicArea - Levi.M - 15/06/2021

Eu fiz assim:

Código PHP:
public OnPlayerEnterDynamicArea(playerid, areaid)
{
    for(new gg = 0; gg < sizeof(Posts); gg++)
    {
        if(PostQ[gg])
        {
            new string[128];
            GetPlayerPos(playerid,PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ]);
            Get2DZoneName(Location,PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY]);
            format(string,sizeof(string),"Auto_Posto_~r~%s__~b~/Abastecer",Location);
            PlayerTextDrawSetString(playerid,ABASTECENDO[playerid][1],string);
            PlayerTextDrawShow(playerid,ABASTECENDO[playerid][1]);
            Area[playerid]=1;
        }
    }
    for(new frtw = 0; frtw < sizeof(TermsQ); frtw++)
    {
        if(TermQ[frtw])
        {
            new string[128];
            GetPlayerPos(playerid,PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ]);
            Get2DZoneName(Location,PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY]);
            format(string,sizeof(string),"Pedagio_~g~%s__~y~/PagarPedagio",Location);
            PlayerTextDrawSetString(playerid,ABASTECENDO[playerid][6],string);
            PlayerTextDrawShow(playerid,ABASTECENDO[playerid][6]);
            Area[playerid]=2;
        }
    }
    return 1;


Só que o loop está passando e quando entro em certa área, mostra os 2 textdraws sobrepostos. Já tentei de várias formas só que não deu certo.


RE: OnPlayerEnterDynamicArea - xbruno1000x - 15/06/2021

E onde você está verificando a área? se você não verificar a área em nenhum lugar, a public inteira será lida.

A área da streamer é isso aqui? if(PostQ[gg])

tente if(areaid == PostQ[gg])


RE: OnPlayerEnterDynamicArea - Levi.M - 15/06/2021

Isso. Estou no trabalho agora, assim que chegar em casa testo. Muito obrigado.


RE: OnPlayerEnterDynamicArea - Levi.M - 16/06/2021

(15/06/2021 13:48)xbruno1000x Escreveu: E onde você está verificando a área? se você não verificar a área em nenhum lugar, a public inteira será lida.

A área da streamer é isso aqui? if(PostQ[gg])

tente if(areaid == PostQ[gg])

Deu certo, era só isso. Obrigado.