Wysłany: 2016-05-26, 19:35
mtm
</3
Wiek: 26 Na forum: 3716 dni Posty: 181
Piwa : 252
cze??, nie mog? zrozumie? dlaczego etykieta tekstowa znika, gdy zas?oni j? jaki? element, chc? by by?a tym pierwszym elementem na stosie.
wygrzeba?em z czelu?ci internetu kod u?ytkownika shuffle;
for key , vehicle in ipairs ( getElementsByType ( "vehicle" ) ) do
if getElementDimension ( vehicle ) == dimension then
local px , py , pz = getElementPosition ( vehicle )
local distance = getDistanceBetweenPoints3D ( px , py , pz , x , y , z )
if distance <= 20 then
local text = getElementData ( vehicle , "message" )
if text and ( distance < 2 or isLineOfSightClear ( x , y , z , px , py , pz + 1.1 , true , true , true , true , false , false , true , localPlayer ) ) then
local sx , sy = getScreenFromWorldPosition ( px , py , pz + 1.8 )
if sx and sy then
local w = dxGetTextWidth ( tostring ( text ) )
local h = ( text and 2 or 1 ) * dxGetFontHeight ( )
dxDrawRectangle ( sx - w / 2 - 5 , sy - h / 2 - 1 , w + 10 , h , tocolor ( 0 , 0 , 0 , 200 ) )
dxDrawText ( tostring ( text ), sx , sy , sx , sy , tocolor ( 255 , 255 , 255 , 255 ), 1 , "default" , "center" , "center" )
end
end
end
end
end
kt?ry? z tych warunk?w odpowiada za to czy nie?
Wysłany: 2016-05-26, 19:46
Xaar
Wiek: 25 Na forum: 5451 dni Posty: 47
Nick w MP: PLWESOLYKOSTEK
Piwa : 82
isLineOfSightClear <-- odpowiada za znikanie etykiety, gdy zas?oni j? jaki? element.
Wydaje mi si?, ?e je?eli zamienisz to if text and ( distance < 2 or isLineOfSightClear ( x , y , z , px , py , pz + 1.1 , true , true , true , true , false , false , true , localPlayer ) ) then na to
if text and ( distance < 2 ) then to powinno byc dobrze
Wysłany: 2016-05-26, 21:31
mtm
</3
Wiek: 26 Na forum: 3716 dni Posty: 181
Piwa : 252
Te? mi si? tak zdawa?o, wcze?niej testowa?em i po usuni?ciu tego kompletnie nie dzia?a?o, ?adnych b??d?w a raczej brak reakcji.
[ Dodano : 2016-05-26, 21:32 ]
do zamkni?cia jako? potem ogarn?.
Tagi: etykiety :: tekstowe
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: