The open.mp logo
Home
FAQ
Forums
Servers
Partners
Docs
Blog

warning Not Translated

This page has not been translated into the language that your browser requested yet. The English content is being shown as a fallback.

If you want to contribute a translation for this page then please click here.

Create3DTextLabel

warning

This function was added in SA-MP 0.3a and will not work in earlier versions!

Description

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

NameDescription
text[]The initial text string.
colorThe text Color, as an integer or hex in RGBA color format
xX-Coordinate
yY-Coordinate
zZ-Coordinate
DrawDistanceThe distance from where you are able to see the 3D Text Label
VirtualWorldThe virtual world in which you are able to see the 3D Text
testLOS0/1 Test the line-of-sight so this text can't be seen through objects

Returns

The ID of the newly created 3D Text Label, or INVALID_3DTEXT_ID if the 3D Text Label limit (MAX_3DTEXT_GLOBAL) was reached.

Examples

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;
}

Notes

tip

drawdistance seems to be a lot smaller when spectating.

tip

Use color embedding for multiple colors in the text.

warning

If text[] is empty, the server/clients next to the text might crash! If the virtualworld is set as -1 the text will not appear.

Related Functions

  • Delete3DTextLabel: Delete a 3D text label.
  • Attach3DTextLabelToPlayer: Attach a 3D text label to a player.
  • Attach3DTextLabelToVehicle: Attach a 3D text label to a vehicle.
  • Update3DTextLabelText: Change the text of a 3D text label.
  • CreatePlayer3DTextLabel: Create A 3D text label for one player.
  • DeletePlayer3DTextLabel: Delete a player's 3D text label.
  • UpdatePlayer3DTextLabelText: Change the text of a player's 3D text label.

Community

  • Discord
  • Instagram
  • Twitter
  • Twitch
  • YouTube
  • Facebook
  • VK

More

  • SA-MP
  • Blog
  • GitHub