[Ajuda] Textdraw 'piscando'
#1

@RESOLVIDO
Fala pessoal, novamente.. :C
Criei uma textdraw para quando a pessoa entrar na бrea do posto, aparecer ela.
Porйm fiz o seguinte:
PHP код:
new PlayerText:NoPosto[3][MAX_PLAYERS];
new 
Float:CoordPostos[3][3] = {
    {
2115.5330,928.2172,10.8203},
    {
1936.8785,-1769.0784,13.3828},
    {
2557.9978,2194.5671,10.8203}
};
forward Locais(playerid);
public 
Locais(playerid)
{
    for (new 
0MAX_PLAYERSi++)
    {
        if (
IsPlayerConnected(playerid))
        {
            for(new 
y=0sizeof(CoordPostos); y++) 
            {
                if(
IsPlayerInRangeOfPoint(playerid,15.0,CoordPostos[y][0],CoordPostos[y][1],CoordPostos[y][2]))
                {
                    for( new 
texttext != 3text++) PlayerTextDrawShow(playeridNoPosto[text][playerid]);
                }
                else
                {
                    for( new 
texttext != 3text++) PlayerTextDrawHide(playeridNoPosto[text][playerid]);
                }
            }
        }
    }
    return 
1;
}
public 
OnGameModeInit()
{
    
SetTimer("Locais"1000true);

Porйm quando vou testar, chego perto ela da umas piscadas rбpidas.. ;/

Alguйm ai sabe oque poderia ser? rs

Atenciosamente,
TiiP
Reply
#2

Tente:
Quote:

SetTimer("Locais", 1000, false);

Reply
#3

Entгo amigo, nгo deu.
Agora ela nem chegou a aparecer. ;/
Creio que o problema esteja a partir daqui:
PHP код:
for(new y=0sizeof(CoordPostos); y++) 
            {
                if(
IsPlayerInRangeOfPoint(playerid,15.0,CoordPostos[y][0],CoordPostos[y][1],CoordPostos[y][2]))
                {
                    for( new 
texttext != 3text++) PlayerTextDrawShow(playeridNoPosto[text][playerid]);
                }
                else
                {
                    for( new 
texttext != 3text++) PlayerTextDrawHide(playeridNoPosto[text][playerid]);
                }
            } 
Quando eu tiro o else, ele fica normal.
Porйm quando saio da бrea do posto ela nao some ;c

Atenciosamente,
TiiP
Reply
#4

tente fazr ele por GangZone, ficaria mas facil, mas creio eu q nao seja isto, mas nao custa nd tentar ☺

@Edit

Quote:
Porйm quando saio da бrea do posto ela nao some ;c
Tambem iria resolver este problema.. qnd eu entra no pc, eu falo com tu pelo skype.
Reply
#5

A nгo.. rs
Gangzone nem rola.


Atenciosamente,
TiiP
Reply
#6

Ele fica piscando ou ele pisca e some uma vez ?
Reply
#7

Quote:
Originally Posted by .Skool_.
Посмотреть сообщение
Ele fica piscando ou ele pisca e some uma vez ?
Entгo amigo..
Acontece assim:
Ela aparece, dai vai piscando rapido e some.
Dai quando me movimento ela aparece, pisca rбpido e some.
;/
Reply
#8

Quote:
Originally Posted by tiiP
Посмотреть сообщение
Entгo amigo..
Acontece assim:
Ela aparece, dai vai piscando rapido e some.
Dai quando me movimento ela aparece, pisca rбpido e some.
;/
Tiip, sinceramente fiquei com dъvida no que quis dizer, mas tente isso:
PHP код:
new pLocal[MAX_PLAYERS]=0;
public 
OnPlayerUpdate(playerid)
{
    if(
pLocal[playerid] == 0)
    {
        
Locais(playerid);
    }
    return 
1;
}
forward Locais(playerid);
public 
Locais(playerid)
{
    for (new 
0MAX_PLAYERSi++)
    {
        if (
IsPlayerConnected(playerid))
        {
            for(new 
y=0sizeof(CoordPostos); y++)
            {
                if(
IsPlayerInRangeOfPoint(playerid,15.0,CoordPostos[y][0],CoordPostos[y][1],CoordPostos[y][2]) && pLocal[playerid] == 0)
                {
                    for( new 
texttext != 3text++) PlayerTextDrawShow(playeridNoPosto[text][playerid]), pLocal[playerid] = 0;
                }
                else
                {
                    for( new 
texttext != 3text++) PlayerTextDrawHide(playeridNoPosto[text][playerid]), pLocal[playerid] = 1;
                }
            }
        }
    }
    return 
1;

Reply
#9

Utilize uma variбvel para melhorar sua performasse. Se ele entrou no local, basta ativar a variбvel para 'true' e impedir que o code modifique a TW atravйs de uma condiзгo... Se ele saiu do local bota a variбvel para 'false' voltando ao normal...
Reply
#10

@RESOLVIDO

Depois de tentar returns, e etc.. Cheguei a isso: (que funcionou perfeitamente)
PHP код:
public Locais(playerid)
{
    for(new 
0MAX_PLAYERSx++)
    {
        if(!
IsPlayerConnected(x)) continue;
        {
            for(new 
y=0sizeof(CoordPostos); y++) 
            { 
                if(
IsPlayerInRangeOfPoint(playerid,15.0,CoordPostos[y][0],CoordPostos[y][1],CoordPostos[y][2]))
                {
                    for( new 
texttext != 3text++) PlayerTextDrawShow(playeridNoPosto[text][playerid]);
                    return 
1;
                }
                for( new 
texttext != 3text++) PlayerTextDrawHide(playeridNoPosto[text][playerid]);
            } 
        }
    }
    return 
1;

* Obrigado a todos que se empenharam e tentaram me ajudar *
<3


Atenciosamente,
TiiP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)