CreateText3D: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 20: | Line 20: | ||
<syntaxhighlight lang="Lua"> | <syntaxhighlight lang="Lua"> | ||
function OnPackageStart() | function OnPackageStart() | ||
local i = 1 | |||
for _ in pairs(Shops) do | |||
Shops[i].npc = CreateNPC(Shops[i].npc_model, Shops[i].x, Shops[i].y, Shops[i].z, Shops[i].h) | |||
SetNPCAnimation(Shops[i].npc, "CROSSARMS", true) | |||
SetNPCHealth(Shops[i].npc, 999999999) | |||
CreateText3D(Shops[i].name, 17, Shops[i].x, Shops[i].y, Shops[i].z + 130, 0,0,0) | |||
i = i + 1 | |||
end | |||
end | |||
end | end | ||
AddEvent("OnPackageStart", OnPackageStart) | AddEvent("OnPackageStart", OnPackageStart) |
Revision as of 20:03, 13 November 2019
Description
Creates a 3d text (hologram) which always faces the player camera, only visible from certain range
Syntax
CreateText3D(text, size, x, y, z, rx, ry, rz)
Parameters
- text
Text you want to show - size
Size of the text - x
X position - y
Y position - z
Z position - rx
X rotation - ry
Y rotation - rz
Z rotation
Return Value
- __EDIT_ME__
Example
function OnPackageStart()
local i = 1
for _ in pairs(Shops) do
Shops[i].npc = CreateNPC(Shops[i].npc_model, Shops[i].x, Shops[i].y, Shops[i].z, Shops[i].h)
SetNPCAnimation(Shops[i].npc, "CROSSARMS", true)
SetNPCHealth(Shops[i].npc, 999999999)
CreateText3D(Shops[i].name, 17, Shops[i].x, Shops[i].y, Shops[i].z + 130, 0,0,0)
i = i + 1
end
end
AddEvent("OnPackageStart", OnPackageStart)
See also
__EDIT_ME__