How to make textdraw hide after 10 seconds?
#1

Done.
Reply
#2

Use timer
Reply
#3

Just use SetTimerEx.
Reply
#4

Create text draw, set timer to 10 seconds, and make a forward and public of what to do when the time is up. Put destroy the text draw.

pawn Code:
// on top of your script under includes.
new Text:sample;

//on gamemode init
sample = TextDrawCreate(240.0,580.0,"Soomro");
   

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/time", true))
    {
        TextDrawShowForPlayer(playerid, sample); // show the text draw we just created above in the variable sample.
        SetTimerEx("TimeUp", 10000, false, "i", playerid); // Set 10 seconds 10000 ms = 10 sec
        return 1;
    }
    return 0;
}
forward TimeUp(playerid);
public TimeUp(playerid)
{

    TextDrawDestroy(sample); //Destroy the created text draw.
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)