CreatePlayer3DTextLabel

warning

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

Description

Creates a 3D Text Label only for a specific player

NameDescription
playeridThe player which should see the newly created 3DText Label.
text[]The text to display.
colorThe text color
xX Coordinate (or offset if attached)
yY Coordinate (or offset if attached)
zZ Coordinate (or offset if attached)
DrawDistanceThe distance where you are able to see the 3D Text Label
attachedplayerThe player you want to attach the 3D Text Label to. (None: INVALID_PLAYER_ID)
attachedvehicleThe vehicle you want to attach the 3D Text Label to. (None: INVALID_VEHICLE_ID)
testLOS0/1 Test the line-of-sight so this text can't be seen through walls

Returns

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.

Examples

if (strcmp(cmd, "/playerlabel", true) == 0)
{
new
PlayerText3D: playerTextId,
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;
}

Notes

tip

drawdistance seems to be a lot smaller when spectating.

warning

If text[] is empty, the server/clients next to the text might crash!

Related Functions