SA-MP Forums Archive
textdraw problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: textdraw problem (/showthread.php?tid=444001)



textdraw problem - ajwar - 14.06.2013

So i want to run 4 similar functions on a 1ms timer.

Function:

pawn Код:
stock TD2(playerid,create,string1[]) // 3,8,10,11
{
    if(create)
    {

            if(PTD[playerid][td8] == 1){
                TextDrawSetString(textdraws[Textdraw8][playerid],string1);
            }

            if(PTD[playerid][cekis8]==0)
            {
                PTD[playerid][td8] = 1;
                textdraws[Textdraw8][playerid] = TextDrawCreate(500.000000, 313.000000, "TOTAL: 565$");
                TextDrawBackgroundColor(textdraws[Textdraw8][playerid], 255);
                TextDrawFont(textdraws[Textdraw8][playerid], 1);
                TextDrawLetterSize(textdraws[Textdraw8][playerid], 0.209999, 1.100000);
                TextDrawColor(textdraws[Textdraw8][playerid], -1);
                TextDrawSetOutline(textdraws[Textdraw8][playerid], 0);
                TextDrawSetProportional(textdraws[Textdraw8][playerid], 1);
                TextDrawSetShadow(textdraws[Textdraw8][playerid], 1);
                TextDrawUseBox(textdraws[Textdraw8][playerid], 1);
                TextDrawBoxColor(textdraws[Textdraw8][playerid], -206);
                TextDrawTextSize(textdraws[Textdraw8][playerid], 622.000000, 0.000000);
            }
            TextDrawShowForPlayer(playerid,textdraws[Textdraw8][playerid]);

    }
    else
    {
        TextDrawHideForPlayer(playerid,textdraws[Textdraw8][playerid]);
        TextDrawDestroy(textdraws[Textdraw8][playerid]);
        PTD[playerid][td8] = 0;
        textdraws[Textdraw8][playerid] = Text:INVALID_TEXT_DRAW;
       
    }
}
pawn Код:
public Timer(playerid);
{
 format string1, 2, 3, 4...
 TD2(playerid,create,string1[]);
 TD3(playerid,create,string2[]);
 TD4(playerid,create,string3[]);
 TD5(playerid,create,string4[]);
}
TD1, TD2, TD3, TD4 are not the same textdraws..., but the result is that only TD5(playerid,create,string4[]); is shown. I tested to replace TD5 with TD4 and it shows & updates only last timer function. Any ideas what am i doing wrong?