[AJUDA] TextDraw
#1

Bom pessoal, estou aqui novamente, pois nгo achei realmente a soluзгo pra isto, tentei trocar o SetTimer, colocar a Text em uma Loop, Mas nгo Funcionou de Qualquer modo, Tentei fazer TextDraw com MAX_PLAYERS tambйm, queria ver se algum de vocкs sabe o que pode estar dando errado nisto, olhem:

pawn Код:
// Public da Text

public KillRatio(playerid)
{
    new RUpdate[60];
    format(RUpdate, sizeof(RUpdate), "~y~Taxa K/D: ~w~%d%", PlayerInfo[playerid][pMatou] / PlayerInfo[playerid][pMorreu]);
    TextDrawSetString(TaxaKD, RUpdate);
    return 1;
}

// Text no OnGameModeInit

    TaxaKD = TextDrawCreate(60, 324, "K/D Ratio: 0.0%");
    TextDrawBackgroundColor(TaxaKD, 255);
    TextDrawFont(TaxaKD, 1);
    TextDrawLetterSize(TaxaKD, 0.300000, 1.200000);
    TextDrawColor(TaxaKD, -1);
    TextDrawSetOutline(TaxaKD, 1);
    TextDrawSetProportional(TaxaKD, 1);
    TextDrawSetShadow(TaxaKD, 0);

// SetTimer Usado

SetTimer("KillRatio", 1000, true);
Reply
#2

TaxaKD = TextDrawCreate(60, 324, "K/D Ratio: 0.0%");

So vi de errado que ou voce nao postou a definiзгo de TaxaKD ou nao Colocou xD
Reply
#3

Quote:
Originally Posted by Murilo_sousa
Посмотреть сообщение
TaxaKD = TextDrawCreate(60, 324, "K/D Ratio: 0.0%");

So vi de errado que ou voce nao postou a definiзгo de TaxaKD ou nao Colocou xD
Tem no Topo do GM lб:

pawn Код:
new Text:TaxaKD;
Reply
#4

rsrsrs Brinks la logico que voce definiu rsr й que nao vi nenhum erro
Reply
#5

Qual й o problema?
Reply
#6

Quote:
Originally Posted by zbt
Посмотреть сообщение
Qual й o problema?
Ele nгo estб atualizando conforme o SetString colocado, ele sу estб mostrando o que estб escrito no TextDrawCreate.
Reply
#7

Dei uma arrumada, testa ae.
pawn Код:
new Text:TaxaKD[MAX_PLAYERS];

public OnGameModeInit() {
    SetTimer("KillRatio", 1000, true);
    for(new i; i < MAX_PLAYERS; ++i) {
        TaxaKD[i] = TextDrawCreate(60, 324, " ");
        TextDrawBackgroundColor(TaxaKD[i], 255);
        TextDrawFont(TaxaKD[i], 1);
        TextDrawLetterSize(TaxaKD[i], 0.300000, 1.200000);
        TextDrawColor(TaxaKD[i], -1);
        TextDrawSetOutline(TaxaKD[i], 1);
        TextDrawSetProportional(TaxaKD[i], 1);
        TextDrawSetShadow(TaxaKD[i], 0);
    }
    return true;
}

public OnPlayerSpawn(playerid)
    return TextDrawShowForPlayer(playerid, TaxaKD[playerid]);

forward KillRatio();
public KillRatio() {
    new RUpdate[60];
    for(new i; i < MAX_PLAYERS; ++i) {
        format(RUpdate, sizeof(RUpdate), "~y~Taxa K/D: ~w~%d%", PlayerInfo[i][pMatou] / PlayerInfo[i][pMorreu]);
        TextDrawSetString(TaxaKD[i], RUpdate);
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by zbt
Посмотреть сообщение
Dei uma arrumada, testa ae.
pawn Код:
new Text:TaxaKD[MAX_PLAYERS];

public OnGameModeInit() {
    SetTimer("KillRatio", 1000, true);
    for(new i; i < MAX_PLAYERS; ++i) {
        TaxaKD[i] = TextDrawCreate(60, 324, " ");
        TextDrawBackgroundColor(TaxaKD[i], 255);
        TextDrawFont(TaxaKD[i], 1);
        TextDrawLetterSize(TaxaKD[i], 0.300000, 1.200000);
        TextDrawColor(TaxaKD[i], -1);
        TextDrawSetOutline(TaxaKD[i], 1);
        TextDrawSetProportional(TaxaKD[i], 1);
        TextDrawSetShadow(TaxaKD[i], 0);
    }
    return true;
}

public OnPlayerSpawn(playerid)
    return TextDrawShowForPlayer(playerid, TaxaKD[playerid]);

forward KillRatio();
public KillRatio() {
    new RUpdate[60];
    for(new i; i < MAX_PLAYERS; ++i) {
        format(RUpdate, sizeof(RUpdate), "~y~Taxa K/D: ~w~%d%", PlayerInfo[i][pMatou] / PlayerInfo[i][pMorreu]);
        TextDrawSetString(TaxaKD[i], RUpdate);
    }
    return 1;
}
Coloquei alн, mas com a string nula , nгo apareceu a Text '-'
Reply
#9

Aqui tб aparecendo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)