Removing Text Draws
#1

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.
Reply
#2

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);
}
Reply
#3

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
Reply
#4

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
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)