13.01.2015, 04:55
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:
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.
}