Jump to content

Nome do Ped


Recommended Posts

Boa tarde, estou tentando colocar o nome do ped na sua cabeça.. porém to tentando de tudo e não consigo de jeito nenhum. Teriam uma base para me ajudar? Obrigado desde já!

Tenho isto.

addEventHandler( "onClientRender", root,
	function( )
	
		local ped = { getPedBonePosition( ped, 8 ) }

		ped[ 3 ] = ped[ 3 ] + 0.3

		local x, y = getScreenFromWorldPosition( ped[ 1 ], ped[ 2 ], ped[ 3 ] )
		local dist = getDistanceBetweenPoints3D( ped[ 1 ], ped[ 2 ], ped[ 3 ], getElementPosition( localPlayer ) )
		local cam = { getCameraMatrix( ) }

		if x and y then

			if dist < 30 then

				if isLineOfSightClear( cam[ 1 ], cam[ 2 ], cam[ 3 ], ped[ 1 ], ped[ 2 ], ped[ 3 ] + 0.3, true, false, false ) then

					local scale = math.min( 5 / dist, 1 )
					local alpha = math.min( 400 / dist, 255 )

					dxDrawText( "(NPC) Empregos", x + 2, y + 2, x, y, tocolor(35, 35, 35, alpha), scale, fonts[ 2 ], "center", "center" )
					dxDrawText( "#b070ff(NPC)#FFFFFF Empregos", x, y, x, y, tocolor(255, 255, 255, alpha), scale, fonts[ 2 ], "center", "center", false, false, false, true )

				end

			end

		end

	end
)

 

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...