Wysłany: 2021-06-28, 21:47
Mis123
Uczeń LUA
Wiek: 31 Na forum: 3093 dni Posty: 24
Nick w MP: Misiu
Piwa : 14
local sw , sh = guiGetScreenSize ()
function napis ( msg )
local rx , ry , rz = getCameraMatrix ()
msg = {}
local x , y , z = getElementPosition ( v )
local distance = getDistanceBetweenPoints3D ( rx , ry , rz , x , y , z )
if distance <= 25 then
local sx , sy = getScreenFromWorldPosition ( x , y , z , 200 )
if sx and sy then
dxDrawText ( msg , sx -( sw / 5 ), sy , sx +( sw / 5 ), sy , tocolor ( 255 , 255 , 255 , 155 ), 1.2 , "default-small" , "center" , "center" , false , true )
end
end
end
addCommandHandler ( "tekst" , napis )]
Po stronie clienta b??d w 16 i 19 linijce
Wysłany: 2021-06-29, 13:11
DaVeCS
Mapper
Wiek: 31 Na forum: 3386 dni Posty: 193
Nick w MP: DaVe
Piwa : 59
Jak mo?esz to wska? 16 i 19 linijk?.
Wysłany: 2021-07-03, 12:37
JakisPolak199
wieczny student
Wiek: 20 Na forum: 3510 dni Posty: 131
Nick w MP: bover.
Piwa : 905
local sw , sh = guiGetScreenSize ()
teksty = {}
addCommandHandler ( 'tekst' , function( cmd , ...)
local msg = table . concat ({...}, " " )
local x , y , z = getElementPosition ( localPlayer )
teksty [ #teksty + 1] = {
position = { x , y , z },
name = msg
}
end )
addEventHandler ( "onClientRender" , root , function()
for _ , v in ipairs ( teksty ) do
local cx , cy , cz = getCameraMatrix ( localPlayer )
local distance = getDistanceBetweenPoints3D ( cx , cy , cz , v . position [ 1 ], v . position [ 2 ], v . position [ 3 ])
if distance <= 25 then
local sx , sy = getScreenFromWorldPosition ( v . position [ 1 ], v . position [ 2 ], v . position [ 3 ], 200 )
if sx and sy then
dxDrawText ( v . name , sx -( sw / 5 ), sy , sx +( sw / 5 ), sy , white , 1.2 , "default-small" , "center" , "center" , false , true )
end
end
end
end )
Pami?taj, by najlepiej to przepisa? pod SQL bo po restarcie skryptu tekst zniknie
Tagi: 3dtext :: komende :: :((
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: