Przejdź do głównej zawartości

CreatePlayer3DTextLabel

Description

Creates a 3D Text Label only for a specific player

NameDescription
playeridThe player which should see the newly created 3DText Label.
const text[]The text to display.
colourThe text color
Float:xX Coordinate (or offset if attached)
Float:yY Coordinate (or offset if attached)
Float:zZ Coordinate (or offset if attached)
Float: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)
bool:testLOS0/1 Test the line-of-sight so this text can't be seen through walls
OPEN_MP_TAGS:...Indefinite number of arguments of any tag.

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

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/playerlabel", true))
{
new
PlayerText3D:playerTextId,
name[MAX_PLAYER_NAME],
Float:x, Float:y, Float:z,
string[64];

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

format(string, sizeof(string), "Hello %s!\nI'm at your position", name);
playerTextId = CreatePlayer3DTextLabel(playerid, string, 0x008080FF, x, y, z, 40.0);
return 1;
}
return 0;
}

Notes

wskazówka

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)