Textdraws - 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: Textdraws (
/showthread.php?tid=375723)
Textdraws -
Captain_jeffree95 - 07.09.2012
We have textdraws load but for some reason they dont want to show up but they seem to be there just invisable .
Re: Textdraws -
Jessyy - 08.09.2012
https://sampwiki.blast.hk/wiki/TextDrawCreate
https://sampwiki.blast.hk/wiki/TextDrawShowForPlayer /
https://sampwiki.blast.hk/wiki/TextDrawShowForAll
Код:
// This variable is used to store the id of the textdraw
// so that we can use it throught the script
new Text:welcomeText;
public OnGameModeInit()
{
// This line is used to create the textdraw.
// Note: This creates a textdraw without any formatting.
welcomeText = TextDrawCreate(240.0,580.0,"Welcome to my SA-MP server");
return 1;
}
public OnPlayerConnect(playerid)
{
//This is used to show the player the textdraw when they connect.
TextDrawShowForPlayer(playerid,welcomeText);
}
-Important Note: Maximum length of textdraw is 800 characters. Longer text will crash the client.
-Important Note: If you use color codes (such as ~R~ ~G~) beyond 255th character the client will crash trying to display the textdraw.
-Important Note: If you choose values for y that are less than 1, the first text row will be invisible and only the shadow is visible.
-Important Note: text[] must NOT be empty or the server will crash! If you need a textdraw that shows nothing, use " " (a space) or _ (underscore)
-Note: The x,y coordinate is the top left coordinate for the text draw area based on a 640x480 "canvas" (irrespective of screen resolution). If you plan on using TextDrawAlignment with alignment 3 (right), the x,y coordinate is the top right coordinate for the text draw.
-Note: This function merely CREATES the textdraw, you must use TextDrawShowForPlayer to show it.