SA-MP Forums Archive
Removing Text Draws - 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: Removing Text Draws (/showthread.php?tid=345011)



Removing Text Draws - vIBIENNYx - 23.05.2012

pawn Код:
if(pickupid == arrowpickup[1])
    {
        new Text:Arrowpickup;
        Arrowpickup = TextDrawCreate(310,200, "San Fierro Prison Vehicle entrance");
        TextDrawAlignment(Arrowpickup, 2);
        TextDrawFont(Arrowpickup, 3);
        TextDrawSetOutline(Arrowpickup, 1);
        TextDrawSetShadow(Arrowpickup, -1);
        TextDrawColor(Arrowpickup,0x0066CCCC);
        TextDrawLetterSize(Arrowpickup, 0.8, 1.5);
        TextDrawShowForPlayer(playerid, Arrowpickup);
        new Text:Arrowpickup2;
        Arrowpickup2 = TextDrawCreate(310, 225, "/enter");
        TextDrawAlignment(Arrowpickup2, 2);
        TextDrawFont(Arrowpickup2, 3);
        TextDrawSetOutline(Arrowpickup2, 1);
        TextDrawSetShadow(Arrowpickup2, -1);
        TextDrawLetterSize(Arrowpickup2, 0.8, 1.5);
        TextDrawShowForPlayer(playerid, Arrowpickup2);
       
        // Remove Textdraws
        SetTimer("RemoveTextDraw", 2000, false);
       
    }
As you can see here, I would like a Timer to remove both of the text draws, can someone please help me set the function for the timer to get rid of them, I just can't do it.


Re: Removing Text Draws - Jonny5 - 23.05.2012

something like this


pawn Код:
//use SetTimerEx  to pass the td id!

SetTimerEx("RemoveTextDraw", 2000, false "i",Arrowpickup);  //set for each TD
SetTimerEx("RemoveTextDraw", 2000, false "i",Arrowpickup2); //set for each TD





// and heres the public to call.
forward RemoveTextDraw(Text:tid);
public RemoveTextDraw(Text:tid)
{
    TextDrawDestroy(tid);
}



Re: Removing Text Draws - vIBIENNYx - 23.05.2012

Thanks, but on these two lines:

pawn Код:
SetTimerEx("RemoveTextDraw", 2000, false, "i",Arrowpickup);  //set for each TD
        SetTimerEx("RemoveTextDraw", 2000, false, "i",Arrowpickup2); //set for each TD
I get the following errors:

pawn Код:
C:\Users\Ben\Desktop\SF-RP\gamemodes\bensamp.pwn(569) : warning 213: tag mismatch
C:\Users\Ben\Desktop\SF-RP\gamemodes\bensamp.pwn(570) : warning 213: tag mismatch
Any idea why? :3


Re: Removing Text Draws - Jonny5 - 23.05.2012

try it this way

pawn Код:
SetTimerEx("RemoveTextDraw", 2000, false, "i",_:Arrowpickup);  //set for each TD
SetTimerEx("RemoveTextDraw", 2000, false, "i",_:Arrowpickup2); //set for each TD



Re: Removing Text Draws - vIBIENNYx - 23.05.2012

Quote:
Originally Posted by Jonny5
Посмотреть сообщение
try it this way

pawn Код:
SetTimerEx("RemoveTextDraw", 2000, false, "i",_:Arrowpickup);  //set for each TD
SetTimerEx("RemoveTextDraw", 2000, false, "i",_:Arrowpickup2); //set for each TD
Thanks.. ^^ Repped.