SA-MP Forums Archive
Can't pass several textdraws through settimerex - 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: Can't pass several textdraws through settimerex (/showthread.php?tid=327943)



Can't pass several textdraws through settimerex - clavador - 23.03.2012

I have a problem with textdraws on SetTimerEx:

This only shows "Test" in the screen:

pawn Код:
T_Buffer[0] = TextDrawCreate(320.000000, 130.000000, "Test");
TextDrawAlignment(T_Buffer[0], 2);
TextDrawBackgroundColor(T_Buffer[0], 255);
TextDrawFont(T_Buffer[0], 1);
TextDrawLetterSize(T_Buffer[0], 1.300000, 4.000000);
TextDrawColor(T_Buffer[0], -16776961);
TextDrawSetOutline(T_Buffer[0], 0);
TextDrawSetProportional(T_Buffer[0], 1);
TextDrawSetShadow(T_Buffer[0], 1);

T_Buffer[1] = TextDrawCreate(320.000000, 160.000000, "Text");
TextDrawAlignment(T_Buffer[1], 2);
TextDrawBackgroundColor(T_Buffer[1], 255);
TextDrawFont(T_Buffer[1], 1);
TextDrawLetterSize(T_Buffer[1], 1.300000, 4.000000);
TextDrawColor(T_Buffer[1], -16776961);
TextDrawSetOutline(T_Buffer[1], 0);
TextDrawSetProportional(T_Buffer[1], 1);
TextDrawSetShadow(T_Buffer[1], 1);
pawn Код:
SetTimerEx("ShowText",500,false,"iii",playerid,_:T_Buffer[0],_:T_Buffer[1]);
pawn Код:
forward ShowText( playerid, ... );
public ShowText( playerid, ... )
{
    new cnt = numargs();

    for( new i=;i<cnt; i++ )
    {
        new Text:draw = Text:getarg(i, 0);
        TextDrawShowForPlayer( playerid, draw );
    }
}
Same function, but called directly shows all the textdraws:

pawn Код:
ShowText( playerid,_:T_Buffer[0],_:T_Buffer[1] );
That shows: "Test Text"

Is there any problem passing several textdraws through a timer?

I have to un-tag them because otherwise i get a compiler warning.


Re: Can't pass several textdraws through settimerex - Kar - 23.03.2012

You can't use ... ); with timers


Re: Can't pass several textdraws through settimerex - clavador - 23.03.2012

Quote:
Originally Posted by Kar
Посмотреть сообщение
You can't use ... ); with timers
Great.

I'll find another way

Thanks!