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

# CreatePlayerTextDraw

## คำอธิบาย

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 |
| text\[\] | The text in the textdraw. |

## ส่งคืน

The ID of the created textdraw

## ตัวอย่าง

```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 SA-MP server");

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

## บันทึก

หมายเหตุ

Player-textdraws are automatically destroyed when a player disconnects.

เคล็ดลับ

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

warning

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

## ฟังก์ชั่นที่เกี่ยวข้องกัน

-   [PlayerTextDrawDestroy](https://omp.itsneufox.com/th/docs/scripting/functions/PlayerTextDrawDestroy): Destroy a player-textdraw.
-   [PlayerTextDrawColor](https://omp.itsneufox.com/th/docs/scripting/functions/PlayerTextDrawColor): Set the color of the text in a player-textdraw.
-   [PlayerTextDrawBoxColor](https://omp.itsneufox.com/th/docs/scripting/functions/PlayerTextDrawBoxColor): Set the color of a player-textdraw's box.
-   [PlayerTextDrawBackgroundColor](https://omp.itsneufox.com/th/docs/scripting/functions/PlayerTextDrawBackgroundColor): Set the background color of a player-textdraw.
-   [PlayerTextDrawAlignment](https://omp.itsneufox.com/th/docs/scripting/functions/PlayerTextDrawAlignment): Set the alignment of a player-textdraw.
-   [PlayerTextDrawFont](https://omp.itsneufox.com/th/docs/scripting/functions/PlayerTextDrawFont): Set the font of a player-textdraw.
-   [PlayerTextDrawLetterSize](https://omp.itsneufox.com/th/docs/scripting/functions/PlayerTextDrawLetterSize): Set the letter size of the text in a player-textdraw.
-   [PlayerTextDrawTextSize](https://omp.itsneufox.com/th/docs/scripting/functions/PlayerTextDrawTextSize): Set the size of a player-textdraw box (or clickable area for PlayerTextDrawSetSelectable).
-   [PlayerTextDrawSetOutline](https://omp.itsneufox.com/th/docs/scripting/functions/PlayerTextDrawSetOutline): Toggle the outline on a player-textdraw.
-   [PlayerTextDrawSetShadow](https://omp.itsneufox.com/th/docs/scripting/functions/PlayerTextDrawSetShadow): Set the shadow on a player-textdraw.
-   [PlayerTextDrawSetProportional](https://omp.itsneufox.com/th/docs/scripting/functions/PlayerTextDrawSetProportional): Scale the text spacing in a player-textdraw to a proportional ratio.
-   [PlayerTextDrawUseBox](https://omp.itsneufox.com/th/docs/scripting/functions/PlayerTextDrawUseBox): Toggle the box on a player-textdraw.
-   [PlayerTextDrawSetString](https://omp.itsneufox.com/th/docs/scripting/functions/PlayerTextDrawSetString): Set the text of a player-textdraw.
-   [PlayerTextDrawShow](https://omp.itsneufox.com/th/docs/scripting/functions/PlayerTextDrawShow): Show a player-textdraw.
-   [PlayerTextDrawHide](https://omp.itsneufox.com/th/docs/scripting/functions/PlayerTextDrawHide): Hide a player-textdraw.
