Przejdź do głównej zawartości

Create3DTextLabel

Description

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

NameDescription
const text[]The initial text string.
colourThe text Color, as an integer or hex in RGBA color format
Float:xX-Coordinate
Float:yY-Coordinate
Float:zZ-Coordinate
Float: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
bool:testLOSTest the line-of-sight so this text can't be seen through objects (true/false)
OPEN_MP_TAGS:...Indefinite number of arguments of any tag.

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, false);
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/mark", true))
{
new name[MAX_PLAYER_NAME];
new Float:x, Float:y, Float:z;
new worldid;

GetPlayerName(playerid, name, sizeof(name));
GetPlayerPos(playerid, x, y, z);
worldid = GetPlayerVirtualWorld(playerid);

Create3DTextLabel("%s marked this place", 0xFF0000FF, x, y, z, 15.0, worldid, false, name);
return 1;
}
return 0;
}

Notes

wskazówka

drawDistance seems to be a lot smaller when spectating.

wskazówka

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.