SetText3DAttached
From Onset Developer Wiki
Description
__EDIT_ME__
Syntax
SetText3DAttached(text3d, attachtype, attachid, x, y, z [, rx, ry, rz, SocketName])
Parameters
- text3d
The text 3D indentifier. - attachtype
AttachType - attachid
The identifier of the attach type (entity) - x
Relative X location. - y
Relative Y location. - z
Relative Z location. - rx (optional)
Relative pitch rotation. - ry (optional)
Relative yaw rotation. - rz (optional)
Relative roll rotation. - SocketName (optional)
The socket name
Return Value
- Returns true on success.
Example
The example given below creates a 3D Text above a player's head!
AddCommand("text", function(playerid, ...)
local textCheck = GetPlayerPropertyValue(playerid, "_3DText")
if textCheck and IsValidText3D(textCheck) then
DestroyText3D(textCheck)
SetPlayerPropertyValue(playerid, "_3DText", nil)
return AddPlayerChat(playerid, "The text has been removed!")
end
if #{...} == 0 then
return AddPlayerChat(playerid, "Usage: /text <message>")
end
local message = table.concat({...}, " ")
local text = CreateText3D(message, 10, 0, 0, 0, 0, 0, 0)
SetText3DAttached(text, ATTACH_PLAYER, playerid, 25, 0, 0, 0, 90, -90, "head")
SetPlayerPropertyValue(playerid, "_3DText", text)
return AddPlayerChat(playerid, "Text added!")
end)
See also
- GetText3DCount
- GetAllText3D
- CreateText3D
- DestroyText3D
- IsValidText3D
- SetText3DAttached
- SetText3DDetached
- SetText3DDimension
- GetText3DDimension
- SetText3DPropertyValue
- GetText3DPropertyValue
- SetText3DText
- GetText3DText
- SetText3DLocation
- GetText3DLocation
- IsText3DStreamedIn
- GetStreamedText3D
- GetText3DActor