SA-MP Forums Archive
[AJUDA] TextDraw '-' - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] TextDraw '-' (/showthread.php?tid=274141)



[AJUDA] TextDraw '-' - FreeGells - 04.08.2011

Tipo, criei uma TextDraw como 0000, Aqui:

pawn Код:
K1 = TextDrawCreate(561.000000, 109.000000, "0000");
    TextDrawBackgroundColor(K1, 255);
    TextDrawFont(K1, 2);
    TextDrawLetterSize(K1, 0.230000, 1.500000);
    TextDrawColor(K1, -1);
    TextDrawSetOutline(K1, 0);
    TextDrawSetProportional(K1, 1);
    TextDrawSetShadow(K1, 1);
Ai fiz o seguinte na OnPlayerDeath:

pawn Код:
PlayerInfo[killerid][Matou] ++;
    Matous(playerid);
Agora a public Matous:

pawn Код:
public Matous(playerid)
{
    new str[4];
    format(str, sizeof str, "000%d", PlayerInfo[playerid][Matou]);
    TextDrawSetString(K1, str);
    if(PlayerInfo[playerid][Matou]<10)
    {
        format(str, sizeof str, "00%d", PlayerInfo[playerid][Matou]);
        TextDrawSetString(K1, str);
    }
    if(PlayerInfo[playerid][Matou]<100)
    {
        format(str, sizeof str, "0%d", PlayerInfo[playerid][Matou]);
        TextDrawSetString(K1, str);
    }
    if(PlayerInfo[playerid][Matou]<1000)
    {
        format(str, sizeof str, "%d", PlayerInfo[playerid][Matou]);
        TextDrawSetString(K1, str);
    }
    return 1;
}
Eu queria que Fosse o seguinte:
Ex: Matou: 0001,2 .. Um por um.. Sу que ao dar Spawn fica como 0, e vai assim atй o 999, no 1000, fica como - 00010000, sei que hб uma maneira correta e mais simples, ajudem ai, obg ._.


Re: [AJUDA] TextDraw '-' - steki. - 04.08.2011

http://www.cplusplus.com/reference/c...cstdio/printf/

format( str, sizeof str, "%04d", integer );


Re: [AJUDA] TextDraw '-' - FreeGells - 04.08.2011

Valeu Luis, do jeito que eu queria ._.


Re: [AJUDA] TextDraw '-' - FreeGells - 04.08.2011

nгo to usando com playerid e estб funcionando perfeitamente.


Re: [AJUDA] TextDraw '-' - FreeGells - 04.08.2011

Ah ok, entendi, obg :]]


Re: [AJUDA] TextDraw '-' - steki. - 04.08.2011

Eu gosto de milho. Й um comeзo?


Re: [AJUDA] TextDraw '-' - RockFire - 04.08.2011

Acho que sim


Re: [AJUDA] TextDraw '-' - FreeGells - 04.08.2011

Talvez. '-'