---
title: "CreatePlayer3DTextLabel | open.mp"
description: "Creates a 3D Text Label only for a specific player."
canonical: https://omp.itsneufox.com/th/docs/scripting/functions/CreatePlayer3DTextLabel
language: th
---

# CreatePlayer3DTextLabel

## คำอธิบาย

Creates a 3D Text Label only for a specific player

| Name | Description |
| --- | --- |
| playerid | The player which should see the newly created 3DText Label. |
| text\[\] | The text to display. |
| color | The text color |
| x | X Coordinate (or offset if attached) |
| y | Y Coordinate (or offset if attached) |
| z | Z Coordinate (or offset if attached) |
| drawDistance | The distance where you are able to see the 3D Text Label |
| attachedplayer | The player you want to attach the 3D Text Label to. (None: INVALID\_PLAYER\_ID) |
| attachedvehicle | The vehicle you want to attach the 3D Text Label to. (None: INVALID\_VEHICLE\_ID) |
| testLOS | 0/1 Test the line-of-sight so this text can't be seen through walls |

## ส่งคืน

The ID of the newly created Player 3D Text Label, or INVALID\_3DTEXT\_ID if the Player 3D Text Label limit (MAX\_3DTEXT\_PLAYER) was reached.

## ตัวอย่าง

```c
if (strcmp(cmd, "/playerlabel", true) == 0)
{
    new PlayerText3D:playertextid;
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    playertextid = CreatePlayer3DTextLabel(playerid, "Hello\nI'm at your position", 0x008080FF, X, Y, Z, 40.0);
    return 1;
}
```

## บันทึก

หมายเหตุ

drawDistance seems to be a lot smaller when spectating.

warning

If text\[\] is empty, the server/clients next to the text might crash! (Fixed in open.mp)

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

-   [Create3DTextLabel](https://omp.itsneufox.com/th/docs/scripting/functions/Create3DTextLabel): Create a 3D text label.
-   [Delete3DTextLabel](https://omp.itsneufox.com/th/docs/scripting/functions/Delete3DTextLabel): Delete a 3D text label.
-   [Attach3DTextLabelToPlayer](https://omp.itsneufox.com/th/docs/scripting/functions/Attach3DTextLabelToPlayer): Attach a 3D text label to a player.
-   [Attach3DTextLabelToVehicle](https://omp.itsneufox.com/th/docs/scripting/functions/Attach3DTextLabelToVehicle): Attach a 3D text label to a vehicle.
-   [Update3DTextLabelText](https://omp.itsneufox.com/th/docs/scripting/functions/Update3DTextLabelText): Change the text of a 3D text label.
-   [DeletePlayer3DTextLabel](https://omp.itsneufox.com/th/docs/scripting/functions/DeletePlayer3DTextLabel): Delete a player's 3D text label.
-   [UpdatePlayer3DTextLabelText](https://omp.itsneufox.com/th/docs/scripting/functions/UpdatePlayer3DTextLabelText): Change the text of a player's 3D text label.
