[Ajuda] Textdraw n aparece
#1

Tipo qnd chegar no rangeofpoint nгo ta aparecendo a textdraw area de carregament/descarregamento... vou passar o codigo para vcs verem, sу pra completar nem os rangeofpoint do posto ta aparecendo

pawn Код:
forward locais();
public locais()
for (new i = 0; i < MAX_PLAYERS; i++)
{
    if (IsPlayerConnected(i))
    {

        //Text de Carga e Descarga
        if (PlayerToPoint(60.0, i, -1026.4006,-625.2548,32.0078))
        {
            TextDrawShowForPlayer(i, textdescarga);
            //AreaTextD[i] = 1;
        }
        else
        {
            //if(AreaTextD[i] == 1){
            //AreaTextD[i] = 0;
            TextDrawHideForPlayer(i, textdescarga);
        }
        if (PlayerToPoint(60.0, i, 2819.81, 915.62, 11.77))
        {
            TextDrawShowForPlayer(i, textdescargalv);
            //AreaTextD[i] = 1;
        }
        else
        {
            //if(AreaTextD[i] == 1){
            //AreaTextD[i] = 0;
            TextDrawHideForPlayer(i, textdescargalv);
        }
        // Fim do Sistema
        if (PlayerToPoint(7.0, i, 70.4532, 1219.1954, 18.8117) || PlayerToPoint(7.0, i, -90.2719, -1169.9579, 2.3964) || PlayerToPoint(7.0, i, -2411.5728, 976.1896, 45.4609) || PlayerToPoint(7.0, i, 2114.8413, 919.9194, 10.8203))
        { //Fort Carson
            GameTextForPlayer(i, "~h~~w~Posto ~y~Petrobras ~n~ Digite~r~/~r~abastecer", 3000, 4);
            AreaPosto[i] = 1;
        }
        else
        {
            if (AreaPosto[i] == 1)
            {
                AreaPosto[i] = 0;
            }
            if (PlayerToPoint(7.0, i, 2638.9553, 1107.1788, 10.8203) || PlayerToPoint(7.0, i, 1595.6233, 2199.6162, 10.8203) || PlayerToPoint(7.0, i, 1940.8671, -1773.2283, 13.3906) || PlayerToPoint(5.0, i, -2243.8435, -1280.5598, 31.9219))
            { //Posto LV
                GameTextForPlayer(i, "~h~~w~Posto ~y~Shell ~n~Digite~r~/abastecer", 3000, 4);
                AreaPosto[i] = 1;
            }
            else
            {
                if (AreaPosto[i] == 1)
                {
                    AreaPosto[i] = 0;
                }
                if (PlayerToPoint(7.0, i, 1382.3647, 459.0785, 20.3452) || PlayerToPoint(8.0, i, -1675.4781, 413.1594, 7.1797) || PlayerToPoint(7.0, i, 655.5922, -565.3943, 16.3359) || PlayerToPoint(7.0, i, -1606.3616, -2713.5872, 48.5335))
                { //Posto LS/SF
                    GameTextForPlayer(i, "~h~~w~Posto ~y~Ipiranga ~n~Digite~r~/abastecer", 3000, 4);
                    AreaPosto[i] = 1;
                }
                else
                {
                    if (AreaPosto[i] == 1)
                    {
                        AreaPosto[i] = 0;
                    }
                    if (PlayerToPoint(7.0, i, 812.4763, -2217.2532, 12.4607))
                    { //Posto ilha
                        GameTextForPlayer(i, "~h~~w~Posto ~y~do ~r~Condominio ~n~Digite~r~/abastecer", 3000, 4);
                        AreaPosto[i] = 1;
                    }
                    else
                    {
                        if (AreaPosto[i] == 1)
                        {
                            AreaPosto[i] = 0;
                        }
                        if (IsPlayerInPlace(i, 576.3771, 1662.789, 619.3304, 1709.206) || PlayerToPoint(7.0, i, 1004.1403, -937.8801, 42.1797) || PlayerToPoint(7.0, i, 2202.1230, 2476.8582, 10.8203) || PlayerToPoint(6.0, i, 417.2369, -1912.7708, 1.5641))
                        { //Posto acima FC
                            GameTextForPlayer(i, "~w~Posto ~y~Ipiranga ~n~Digite~r~/abastecer", 3000, 4);
                            AreaPosto[i] = 1;
                        }
                        else
                        {
                            if (AreaPosto[i] == 1)
                            {
                                AreaPosto[i] = 0;
                            }
                        }
                    }
                }
            }
        }
    }
}

OQ pode ser? a textdraw ja ta no gamemodeinit
Reply
#2

tens um settimer a chamar a callback locais() ?
Reply
#3

Sim cara, em ongamemodeinit:

SetTimer("locais", 800, 1);
Reply
#4

muda a funcao para locais(playerid)

e aplica on SetTimeEx em OnPlayerConnect
Reply
#5

Nem era isso, era as coordenadas, arrumei sу que qnd entro na coordenada que ta no rangeofpoint, ela aparece, blz, ai eu saio desse lugar, vou bem pra longe e a textdraw continua '-'

pawn Код:
//Text de Carga e Descarga
        if (PlayerToPoint(60.0, i, -1026.4006,-625.2548,32.0078))
        {
            TextDrawShowForPlayer(i, textdescarga);
            //AreaTextD[i] = 1;
        }
        if (PlayerToPoint(60.0, i, 2760.4119, -2451.2390, 13.5409))
        {
            TextDrawShowForPlayer(i, textcarga);
            //AreaTextD[i] = 1;
        }
        // Fim do Sistema
Reply
#6

PHP код:
    if (PlayerToPoint(60.0i, -1026.4006,-625.2548,32.0078))
    {
        
TextDrawShowForPlayer(itextdescarga);
        
//AreaTextD[i] = 1;
    
}
    else
    {
        
TextDrawHideForPlayer(itextdescarga);
    } 
Reply
#7

Puts, fui tirar o Else, valeu !
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)