[AJUDA] 3DTextLabel
#1

o problema й que quando a 3DText й atualizada (Update3DTextLabelText) a nova string sobrepхe a antiga invйz de substituir ficando uma por cima da outra



pawn Код:
new Text3D:TEXT1[MAX_PLAYERS];
new Zstring[128];

public OnPlayerSpawn(playerid)
{
    format(Zstring, sizeof(Zstring), "Matou %d || Morreu %d", pInfo[i][matou],pInfo[i][morreu]);
    TEXT1[playerid] = Create3DTextLabel(Zstring,0x00FF00FF,0.0,0.0,5,10.0,0,0);
    Attach3DTextLabelToPlayer(TEXT1[playerid], playerid, 0.0, 0.0, 0.42);
    return 1;
}

[IMG]http://i1081.photobucket.com/albums/j350/marcos997gt/sa-mp-006.png[/IMG]

forward TextStats();
public TextStats()
{
    for(new i; i < MAX_PLAYERS; ++i)
    {
        format(Zstring, sizeof(Zstring), "Matou %d || Morreu %d", pInfo[playerid][matou],pInfo[playerid][morreu]);
        Update3DTextLabelText(TEXT1[i], 0x00FF00FF, Zstring);
    }
    return 1;
}
como resolvo isso
Reply
#2

Nгo sei se isto resolverб, porйm vocк pode comeзar corrigindo a callback.

pawn Код:
forward TextStats();
public TextStats()
{
    for(new i; i < MAX_PLAYERS; ++i)
    {
        format(Zstring, sizeof(Zstring), "Matou %d || Morreu %d", pInfo[i][matou],pInfo[i][morreu]);
        Update3DTextLabelText(TEXT1[i], 0x00FF00FF, Zstring);
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Pedro_Miranda
Посмотреть сообщение
Nгo sei se isto resolverб, porйm vocк pode comeзar corrigindo a callback.

pawn Код:
forward TextStats();
public TextStats()
{
    for(new i; i < MAX_PLAYERS; ++i)
    {
        format(Zstring, sizeof(Zstring), "Matou %d || Morreu %d", pInfo[i][matou],pInfo[i][morreu]);
        Update3DTextLabelText(TEXT1[i], 0x00FF00FF, Zstring);
    }
    return 1;
}
nгo entendi :S
Reply
#4

loop em TextStats pra que?
Se for para aparecer em todos os players do server deleta ela pra criaзao de outra!
Reply
#5

Quote:
Originally Posted by Don_Speed
Посмотреть сообщение
loop em TextStats pra que?

se nгo por sу pega pro id 0 '-'

#edit

LOOL agora que eu reparei que tem uns player ids ja editei
Reply
#6

Quote:
Originally Posted by BlackDonelly
Посмотреть сообщение
se nгo por sу pega pro id 0 '-'

#edit

LOOL agora que eu reparei que tem uns player ids ja editei
malz dei edit olha la /\
Reply
#7

Quote:

Se for para aparecer em todos os players do server deleta ela pra criaзao de outra!

sim + aparecer em todos, cada um com seus stats '-'
Reply
#8

@Edit
pawn Код:
static
    striger[60]
;
new
    Text3D:TEXT1[MAX_PLAYERS] = {Text3D:-1, ...}
;

//Use um timer para atualizar essa callback!
forward TextStats();
public TextStats() {
    for(new i = 0, y = GetMaxPlayers(); i != y; i++) {
        format(striger, sizeof(striger), "Matou %d || Morreu %d", pInfo[i][matou], pInfo[i][morreu]);
        if(TEXT1[i] != (Text3D:-1)) Delete3DTextLabel(TEXT1[i]);
        TEXT1[i] = Create3DTextLabel(striger, 0x00FF00FF, 0.0, 0.0, 5, 10.0, 0, 0);
        Attach3DTextLabelToPlayer(TEXT1[i], i, 0.0, 0.0, 0.42);
        Update3DTextLabelText(TEXT1[i], 0x00FF00FF, striger);
    }
    return 1;
}
Reply
#9

Quote:
Originally Posted by BlackDonelly
Посмотреть сообщение
nгo entendi :S
Vocк usa 'playerid' nesta callback sendo que o mesmo nгo estб declarado.

Й como eu fazer

stock oi(i)
{
return SendClientMessage(playerid, -1, "oi");
}
Reply
#10

Quote:
Originally Posted by Pedro_Miranda
Посмотреть сообщение
Vocк usa 'playerid' nesta callback sendo que o mesmo nгo estб declarado.

Й como eu fazer

stock oi(i)
{
return SendClientMessage(playerid, -1, "oi");
}
escrevi errado ja arrumei + mesmo com "i" ainda continua igual :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)