TextDraw Help
#1

How can I make a textdraw appear after using a command?

I want the textdraw to go away after a few seconds on its own too

(Just like a short message that shows up for a few seconds then goes away)
Reply
#2

EXAMPLE (textdraw at bottom like this after typing a cmd):

Reply
#3

make it with scanff2
Reply
#4

How can I make it with scanff2? Sorry, I'm extremely new to scripting, can you show me a short example?
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=376758
https://sampforum.blast.hk/showthread.php?tid=442095
These are some textdraw editors you can use to make your textdraw.

I have made something to demonstrate how you could do what you're asking. I don't know where this textdraw is located as I have made up the coordinates, but this should give you an idea:
pawn Код:
#include <a_samp>
#include <zcmd>

new Text:ExampleText;//Here You Are Using A Variable To Store The Textdraw ID.
new tdhidetimer[MAX_PLAYERS];//This is the variable holding the timer information, you will see this used later.

forward TDHide(playerid);//We Are Forwarding A Public Function, You Will See Where This Comes In Handy.

public OnGameModeInit()
{
    ExampleText = TextDrawCreate(200.0,200.0,"Example Textdraw");
    //This Creates The Textdraw Using The Variable And The Function.
    //The Variable (ExampleText) Will Be Used Later On In The Script.
    return 1;
}

public OnGameModeExit()
{
    TextDrawDestroy(ExampleText);//When The Gamemode Exits, This Destroys The Textdraw.
    return 1;
}

//Below Is Our Example Command.
CMD:example(playerid,params[])
{
    KillTimer(tdhidetimer[playerid]);//Here We Are Killing The Timer If There Is One Running
    //To prevent the timer from running over and over from command spam.
    TextDrawShowForPlayer(playerid,ExampleText);//This Is What Shows The Textdraw We Created Above.
    SetPlayerHealth(playerid,98.0);//This is our example function, this will refill the player's health.
    tdhidetimer[playerid] = SetTimerEx("TDHide",3*1000,false,"i",playerid);
    //Above Is Our Timer, Notice How We Used The Timer Variable Above To Declare What It Equals.
    /*
    The SetTimerEx Calls This Way:
    "TDHide" - The Forwarded Function Above And The Public Below This Command.
    3*1000 - Says How Long It Will Be Before The public TDHide(playerid) function is called.
    false - Means the timer will only run once, if set to true, it will continute to run at the time defined above.
    "i" - You are passing a playerid for the timer, so use "i".
    playerid - The Player To Set The Timer For. This is what "i" is meaning. Here we're using this timer,
    on the player that typed the command, so playerid is appropriate.
    */

    return 1;
}

//This is the function that is called once the timer has passed the 3 seconds we defined above.
public TDHide(playerid)
{
    TextDrawHideForPlayer(playerid,ExampleText);//This will then hide the textdraw, and the player should no longer see it.
}
Reply
#6

This command worked but the textdraw doesnt go away



I have the public, new and forward lines too

never the less, +repped
Reply
#7

nevermind, it worked. I forgot to add the last public at the bottom
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)