Ana içeriğe geç

CreatePlayerTextDraw

Description​

Creates a textdraw for a single player. This can be used as a way around the global text-draw limit.

NameDescription
playeridThe ID of the player to create the textdraw for
Float:xX-Coordinate
Float:yY-Coordinate
const format[]The text in the textdraw.
OPEN_MP_TAGS:...Indefinite number of arguments of any tag.

Returns​

The ID of the created textdraw

Examples​

// This variable is used to store the id of the textdraw
// so that we can use it throught the script
new PlayerText:welcomeText[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
// First, create the textdraw
welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server");

// Now show it
PlayerTextDrawShow(playerid, welcomeText[playerid]);
return 1;
}

Notes​

not
  • 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 PlayerTextDrawAlignment with alignment 3 (TEXT_DRAW_ALIGN_RIGHT), the x, y coordinate is the top right coordinate for the text draw.
  • This function merely CREATES the textdraw, you must use PlayerTextDrawShow to show it to a player.
  • Player-textdraws are automatically destroyed when a player disconnects.
ipucu

It is recommended to use WHOLE numbers instead of decimal positions when creating player textdraws to ensure resolution friendly design.

uyarı

Keyboard key mapping codes (such as ~k~~VEHICLE_ENTER_EXIT~) Doesn't work beyond 255th character.