Textdraw - 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: Textdraw (
/showthread.php?tid=380225)
Textdraw -
x96664 - 24.09.2012
How can I make a textdraw which will be showed by a command for example the command will be "/text" and when I type it to be shown a textdraw which will disappear in 10 seconds ? ( I don't need GameTextForPlayer)
Re: Textdraw -
XtremeR - 24.09.2012
pawn Код:
CMD:text(playerid,params[])
{
TextDrawShowForPlayer(playerid,TDid);
SetTimerEx("HideMessage", timehere, 0, "i", playerid);
return 1;
}
forward HideMessage(playerid);
public HideMessage(playerid)
{
TextDrawHideForPlayer(playerid, TextdrawID);
}
Re: Textdraw -
x96664 - 24.09.2012
Quote:
Originally Posted by XtremeR
pawn Код:
CMD:text(playerid,params[]) { TextDrawShowForPlayer(playerid,TDid); SetTimerEx("HideMessage", timehere, 0, "i", playerid);
return 1; }
forward HideMessage(playerid); public HideMessage(playerid) { TextDrawHideForPlayer(playerid, TextdrawID); }
|
Thank you a lot!
Re: Textdraw - Jarnu - 24.09.2012
3 Tips:
-Create a textdraw
-TextDrawShowForPlayer in command Ex:
pawn Код:
CMD:text(playerid, params[])
{
TextDrawShowForPlayer(playerid, TextDraw1);
return 1;
}
-
SetTimerEx -EDITTED forgot that it will be better
Ex:
pawn Код:
CMD:text(playerid, params[])
{
TextDrawShowForPlayer(playerid, TextDraw1);
SetTimerEx("TextDrawHide", 10000,"d", playerid false); //10 Seconds
return 1;
}
pawn Код:
forward TextDrawHide(playerid);
public TextDrawHide(playerid)
{
TextDrawHideForPlayer(playerid, TextDraw1);
return 1;
}
WARNING: You need to create the textdraw first
EDIT: Just a minute of difference between post of me and XtremeR
Re: Textdraw -
Lordzy - 24.09.2012
You can create a timer.
Example
pawn Код:
CMD:text(playerid,params[]) //Creating the command.
{ //Opening brackets to execute functions
TextdrawShowForPlayer(L-text); //Replace with your textdraw.
SetTimerEx("RemoveText", 50000, false, "d", playerid); //Creating a timer.
return 1; //Returning functions.
} //Closing command.
forward RemoveText(playerid) //Forwarding the remove text timer.
public RemoveText(playerid) //Adding functions to the timer to perform after the timer used in the test command.
{ //Opening brackets to execute function.
TextdrawHideForPlayer(L-text); //Removing textdraw, replace with your textdraw code.
return 1; //Returning functions.
} //Closing brackets
This might.
Edit:O.o I was too late.