---
title: "Create3DTextLabel | open.mp"
description: "Creates a 3D Text Label at a specific location in the world."
canonical: https://omp.itsneufox.com/th/docs/scripting/functions/Create3DTextLabel
language: th
---

# Create3DTextLabel

## คำอธิบาย

Creates a 3D Text Label at a specific location in the world

| Name | Description |
| --- | --- |
| text\[\] | The initial text string. |
| color | The text Color, as an integer or hex in RGBA color format |
| x | X-Coordinate |
| y | Y-Coordinate |
| z | Z-Coordinate |
| drawDistance | The distance from where you are able to see the 3D Text Label |
| virtualWorld | The virtual world in which you are able to see the 3D Text |
| testLOS | 0/1 Test the line-of-sight so this text can't be seen through objects |

## ส่งคืน

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

## ตัวอย่าง

```c
public OnGameModeInit()
{
    Create3DTextLabel("I'm at the coordinates:\n30.0, 40.0, 50.0", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, 0);
    return 1;
}
```

## บันทึก

หมายเหตุ

drawDistance seems to be a lot smaller when spectating.

เคล็ดลับ

Use colour embedding for multiple colours in the text.

warning

-   If text\[\] is empty, the server/clients next to the text might crash! (Fixed in open.mp)
-   If the virtualworld is set as -1 the text will not appear.

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

-   [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.
-   [CreatePlayer3DTextLabel](https://omp.itsneufox.com/th/docs/scripting/functions/CreatePlayer3DTextLabel): Create A 3D text label for one player.
-   [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.
