---
title: "CreatePlayerTextDraw | open.mp"
description: "Creates a textdraw for a single player."
canonical: https://omp.itsneufox.com/vi/docs/scripting/functions/CreatePlayerTextDraw
language: vi
---

# CreatePlayerTextDraw

## Description

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

| Name | Description |
| --- | --- |
| playerid | The ID of the player to create the textdraw for |
| Float:x | X-Coordinate |
| Float:y | Y-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

```c
// 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

ghi chú

-   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](https://omp.itsneufox.com/vi/docs/scripting/functions/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](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawShow) to show it to a player.
-   Player-textdraws are automatically destroyed when a player disconnects.

mẹo

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

cảnh báo

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

## Related Functions

-   [PlayerTextDrawDestroy](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawDestroy): Destroy a player-textdraw.
-   [PlayerTextDrawColor](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawColor): Set the color of the text in a player-textdraw.
-   [PlayerTextDrawBoxColor](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawBoxColor): Set the color of a player-textdraw's box.
-   [PlayerTextDrawBackgroundColor](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawBackgroundColor): Set the background color of a player-textdraw.
-   [PlayerTextDrawAlignment](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawAlignment): Set the alignment of a player-textdraw.
-   [PlayerTextDrawFont](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawFont): Set the font of a player-textdraw.
-   [PlayerTextDrawLetterSize](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawLetterSize): Set the letter size of the text in a player-textdraw.
-   [PlayerTextDrawTextSize](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawTextSize): Set the size of a player-textdraw box (or clickable area for PlayerTextDrawSetSelectable).
-   [PlayerTextDrawSetOutline](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawSetOutline): Toggle the outline on a player-textdraw.
-   [PlayerTextDrawSetShadow](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawSetShadow): Set the shadow on a player-textdraw.
-   [PlayerTextDrawSetProportional](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawSetProportional): Scale the text spacing in a player-textdraw to a proportional ratio.
-   [PlayerTextDrawUseBox](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawUseBox): Toggle the box on a player-textdraw.
-   [PlayerTextDrawSetString](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawSetString): Set the text of a player-textdraw.
-   [PlayerTextDrawShow](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawShow): Show a player-textdraw.
-   [PlayerTextDrawHide](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawHide): Hide a player-textdraw.
-   [IsPlayerTextDrawVisible](https://omp.itsneufox.com/vi/docs/scripting/functions/IsPlayerTextDrawVisible): Checks if a player-textdraw is shown for the player.
-   [IsValidPlayerTextDraw](https://omp.itsneufox.com/vi/docs/scripting/functions/IsValidPlayerTextDraw): Checks if a player-textdraw is valid.
-   [PlayerTextDrawBackgroundColour](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawBackgroundColour): Adjust the background colour of a player-textdraw.
-   [PlayerTextDrawBoxColour](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawBoxColour): Sets the colour of a textdraw's box (PlayerTextDrawUseBox ).
-   [PlayerTextDrawColour](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawColour): Sets the text colour of a player-textdraw.
-   [PlayerTextDrawGetAlignment](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawGetAlignment): Gets the text alignment of a player-textdraw.
-   [PlayerTextDrawGetBackgroundColour](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawGetBackgroundColour): Gets the background colour of a player-textdraw.
-   [PlayerTextDrawGetBoxColour](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawGetBoxColour): Gets the box colour of a player-textdraw.
-   [PlayerTextDrawGetColour](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawGetColour): Gets the text colour of a player-textdraw.
-   [PlayerTextDrawGetFont](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawGetFont): Gets the text font of a player-textdraw.
-   [PlayerTextDrawGetLetterSize](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawGetLetterSize): Gets the width and height of the letters.
-   [PlayerTextDrawGetOutline](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawGetOutline): Get the outline size on a player-textdraw.
-   [PlayerTextDrawGetPos](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawGetPos): Gets the position of a player-textdraw.
-   [PlayerTextDrawGetPreviewModel](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawGetPreviewModel): Gets the preview model of a 3D preview player-textdraw.
-   [PlayerTextDrawGetPreviewRot](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawGetPreviewRot): Gets the rotation and zoom of a 3D model preview player-textdraw.
-   [PlayerTextDrawGetPreviewVehicleColours](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawGetPreviewVehicleColours): Gets the preview vehicle colors of a 3D preview player-textdraw.
-   [PlayerTextDrawGetShadow](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawGetShadow): Get the shadow size on a player-textdraw.
-   [PlayerTextDrawGetString](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawGetString): Gets the text of a player-textdraw.
-   [PlayerTextDrawGetTextSize](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawGetTextSize): Gets the X axis and Y axis of the player-textdraw text size.
-   [PlayerTextDrawIsBox](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawIsBox): Checks if a player-textdraw is box.
-   [PlayerTextDrawIsProportional](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawIsProportional): Checks if a player-textdraw is proportional.
-   [PlayerTextDrawIsSelectable](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawIsSelectable): Checks if a player-textdraw is selectable.
-   [PlayerTextDrawSetPos](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawSetPos): Sets the position of a player-textdraw.
-   [PlayerTextDrawSetPreviewVehicleColours](https://omp.itsneufox.com/vi/docs/scripting/functions/PlayerTextDrawSetPreviewVehicleColours): Set the color of a vehicle in a player-textdraw model preview (if a vehicle is shown).

## Related Resources

-   [TextDraw Sprites](https://omp.itsneufox.com/vi/docs/scripting/resources/textdrawsprites)
