CreateText3D: Difference between revisions

From Onset Developer Wiki
(Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|CreateText3D(text, size, x, y, z, rx, ry, rz)}} {{FuncParameters}} {{FuncParam|text|__EDIT_ME__}}...")
 
No edit summary
Line 1: Line 1:
{{Info|Function|Server|1.0}}
{{Info|Function|Server|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Creates a 3d text (hologram) which always faces the player camera, only visible from certain range}}


{{FuncSyntax|CreateText3D(text, size, x, y, z, rx, ry, rz)}}
{{FuncSyntax|CreateText3D(text, size, x, y, z, rx, ry, rz)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|text|__EDIT_ME__}}
{{FuncParam|text|Text you want to show}}
{{FuncParam|size|__EDIT_ME__}}
{{FuncParam|size|Size of the text}}
{{FuncParam|x|__EDIT_ME__}}
{{FuncParam|x|X position}}
{{FuncParam|y|__EDIT_ME__}}
{{FuncParam|y|Y position}}
{{FuncParam|z|__EDIT_ME__}}
{{FuncParam|z|Z position}}
{{FuncParam|rx|__EDIT_ME__}}
{{FuncParam|rx|X rotation}}
{{FuncParam|ry|__EDIT_ME__}}
{{FuncParam|ry|Y rotation}}
{{FuncParam|rz|__EDIT_ME__}}
{{FuncParam|rz|Z rotation}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|__EDIT_ME__}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
function OnPackageStart()
 
Delay(5000, function ()
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
AddEvent("OnPackageStart", OnPackageStart)
</syntaxhighlight>
 


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
__EDIT_ME__

Revision as of 20:02, 13 November 2019

CreateText3D

Type: Function
Context: Server
Introduced: v1.0

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()

	Delay(5000, function ()
		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
AddEvent("OnPackageStart", OnPackageStart)


See also

__EDIT_ME__