Wysłany: 2014-12-26, 05:03
LordKamis
Wiek: 26 Na forum: 4340 dni Posty: 107
Piwa : 190
Witam prosi?bym o kod albo wskaz?wki na napis nad markerem
Za pomoc respekt i piwo.
Wysłany: 2014-12-26, 10:05
monio
Wiek: 30 Na forum: 4887 dni Posty: 319
Nick w MP: Monio99
Piwa : 3565
Wysłany: 2014-12-26, 11:05
LordKamis
Wiek: 26 Na forum: 4340 dni Posty: 107
Piwa : 190
Nadal nic , napisz mi jakiej funkcji musz? u?y? ?eby zrobi? tekst w powietrzu kt?ry zawsze jest skierowany w moim kierunku, to sam wykminie.
Wysłany: 2014-12-26, 12:42
TheTroll
Pan Majster
Wiek: 38 Na forum: 4764 dni Posty: 219
Nick w MP: TheTroll
Piwa : 1114
Mo?esz pobra? pozycj? markera funkcj? getElementPosition, nast?pnie u?ywasz funkcji getScreenFromWorldPosition a potem ju? tworzysz tekst funkcj? dxDrawText.
Ma?y przyk?ad
addEventHandler ( "onClientRender" , getRootElement (),function ()
local x , y , z = getElementPosition ( element ) -- element = marker
local xs , ys , ds = getScreenFromWorldPosition ( x , y , z + 2 )
dxDrawText ( "Jaki? tam tekst" , xs , ys + 15 , xs , ys , tocolor ( 255 , 255 , 255 ), 1.2 , "default" , "center" )
end )
Nie testowane ale powinno dzia?a?
Wysłany: 2014-12-26, 12:59
LordKamis
Wiek: 26 Na forum: 4340 dni Posty: 107
Piwa : 190
TheTroll , Niestety nie dzia?a :{ , a w db3 nic nie ma.
Wysłany: 2014-12-26, 15:09
Fanciak
BOT
Wiek: 25 Na forum: 4446 dni Posty: 728
Nick w MP: Fanciak
Piwa : 1572
Zr?b to skryptem na 3dtexty dajac pozycje troch? wyzsza od markera, jak si? tekst nie poja znaczy, ze musisz wy?ej podnie?? gdy? teksty jak s? nisko to teleportuja si? przez market tak jak gracze. Je?eli to chodzi o marker teleportujacy. Skrypt 3dtext byl gdzie? na forum jakby co.
Wysłany: 2014-12-26, 17:52
Bingwin
LUA MTA
Wiek: 27 Na forum: 4191 dni Posty: 95
Nick w MP: Bingwin
Piwa : 2070
Ja to mam zrobione w 2 osobnych plikach od strony Client .
Tu masz same napisy i pozycje napis?w
local marker1 = createMarker ( - 2178.84058 , 651.20593 , 49.43750 , "cylinder" , 1.5 , 0 , 0 , 0 , 0 )
setElementData ( marker1 , "message" , "**Regulamin Licytacji w ciemno**\n 1.Jesli wylicytowales garaz , a nie chcesz zaplacic za pojazd ktory wygrales = ban 7dni \n 2.Jak wyjdziesz z serwera [Quit] a nie zakupisz wygranego garazu = ban 7dni \n\n ** Informacje *** \n Licytujesz w ciemno ,raz trafisz super auto \n raz zlom , nie wiesz jaki ma przebieg oraz jaki to pojazd.\n Do wyboru masz tylko jeden garaz : ZIELONY oraz CZERWONY \n Licytujac zgadzasz sie na regulamin Licytajci. \n Licytacja moze byc codziennie ,jak tylko osoba ktora prowadzi\nlicytacje jest na serwerze.\n Licytacje prowadzi : Pingwin799e" )
local marker2 = createMarker ( - 2184.32031 , 711.01123 , 53.89063 , "cylinder" , 1.5 , 0 , 0 , 0 , 0 )
setElementData ( marker2 , "message" , "== ZIELONY ==" )
local marker3 = createMarker ( - 2178.85303 , 711.00830 , 53.89063 , "cylinder" , 1.5 , 0 , 255 , 255 , 0 )
setElementData ( marker3 , "message" , "== CZERWONY ==" )
local marker4 = createMarker ( - 2243.72461 , 643.46002 , 49.0 , "cylinder" , 1.5 , 0 , 0 , 0 , 0 )
setElementData ( marker4 , "message" , ">> LICYTACJE <<" )
A tu masz reszcze tego skryptu | pokazuje tez czy gra jest zminimalizowana
-- Edit dla SecondLife ( 2014 ) by Pingwin799
function isEmpty ( vehicle )
local passengers = getVehicleMaxPassengers ( vehicle )
if type ( passengers ) == 'number' then
for seat = 0 , passengers do
if getVehicleOccupant ( vehicle , seat ) then
return false
end
end
end
return true
end
function renderIng ( )
local x , y , z = getCameraMatrix ( )
local dimension = getElementDimension ( localPlayer )
for key , pickup in ipairs ( getElementsByType ( "pickup" ) ) do
if getElementDimension ( pickup ) == dimension then
local px , py , pz = getElementPosition ( pickup )
local distance = getDistanceBetweenPoints3D ( px , py , pz , x , y , z )
if distance <= 20 then
local text = getElementData ( pickup , "message" )
if text and ( distance < 2 or isLineOfSightClear ( x , y , z , px , py , pz + 0.7 , true , true , true , true , false , false , true , localPlayer ) ) then
local sx , sy = getScreenFromWorldPosition ( px , py , pz + 0.7 )
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 - 5 , w + 10 , h + 10 , tocolor ( 0 , 0 , 0 , 200 ) )
dxDrawText ( tostring ( text ), sx , sy , sx , sy , tocolor ( 255 , 255 , 255 , 255 ), 1 , "default-bold" , "center" , "center" )
end
end
end
end
end
for key , vehicle in ipairs ( getElementsByType ( "player" ) ) do -- infa
if getElementDimension ( vehicle ) == dimension then
local px , py , pz = getElementPosition ( vehicle )
local distance = getDistanceBetweenPoints3D ( px , py , pz , x , y , z )
if distance <= 10 then
if ( 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.5 )
if sx and sy then
local w = dxGetTextWidth ( tostring ( text ) )
local h = ( text and 2 or 1 ) * dxGetFontHeight ( )
-- dxDrawRectangle ( sx - w / 2 - 200 , sy - h / 2 - 5 , w + 395 , h + 15 , tocolor ( 0 , 0 , 0 , 200 ) )
if getElementData ( vehicle , "afk" ) then
dxDrawText ( tostring ( "Gra zminimalizowana" ), sx , sy , sx , sy , tocolor ( 247 , 245 , 188 , 200 ), 2.2 , "default-bold" , "center" , "center" )
end
end
end
end
end
end
for key , marker in ipairs ( getElementsByType ( "marker" ) ) do
if getElementDimension ( marker ) == dimension then
local px , py , pz = getElementPosition ( marker )
local distance = getDistanceBetweenPoints3D ( px , py , pz , x , y , z )
if distance <= 20 then
local text = getElementData ( marker , "message" )
if text and ( distance < 2 or isLineOfSightClear ( x , y , z , px , py , pz + 1.7 , true , true , true , true , false , false , true , localPlayer ) ) then
local sx , sy = getScreenFromWorldPosition ( px , py , pz + 1.7 )
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 - 5 , w + 10 , h + 10 , tocolor ( 0 , 0 , 0 , 200 ) )
dxDrawText ( tostring ( text ), sx , sy , sx , sy , tocolor ( 255 , 255 , 255 , 255 ), 1.0 , "default-bold" , "center" , "center" )
end
end
end
end
end
for key , player in ipairs ( getElementsByType ( "player" ) ) do
if getElementDimension ( player ) == dimension then
local px , py , pz = getElementPosition ( player )
local distance = getDistanceBetweenPoints3D ( px , py , pz , x , y , z )
if distance <= 20 then
local text = getElementData ( player , "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 + 0.2 )
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 - 5 , w + 10 , h + 10 , tocolor ( 0 , 0 , 0 , 200 ) )
dxDrawText ( tostring ( text ), sx , sy , sx , sy , tocolor ( 255 , 255 , 255 , 255 ), 1.2 , "default" , "center" , "center" )
end
end
end
end
end
for key , ped in ipairs ( getElementsByType ( "ped" ) ) do
if getElementDimension ( ped ) == dimension then
local px , py , pz = getElementPosition ( ped )
local distance = getDistanceBetweenPoints3D ( px , py , pz , x , y , z )
if distance <= 20 then
local text = getElementData ( ped , "message" )
if text and ( distance < 2 or isLineOfSightClear ( x , y , z , px , py , pz + 0 , true , true , true , true , false , false , true , localPlayer ) ) then
local sx , sy = getScreenFromWorldPosition ( px , py , pz + 0.2 )
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 ), 2 , "default" , "center" , "center" )
end
end
end
end
end
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 + 0 )
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.0 , "default-bold" , "center" , "center" )
end
end
end
end
end
for key , object in ipairs ( getElementsByType ( "object" ) ) do
local px , py , pz = getElementPosition ( object )
local distance = getDistanceBetweenPoints3D ( px , py , pz , x , y , z )
if distance <= 20 then
local text = getElementData ( object , "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 + 0.0 )
if sx and sy then
local w = dxGetTextWidth ( tostring ( text ) )
local h = ( text and 2 or 1 ) * dxGetFontHeight ( )
-- dxDrawRectangle ( sx - w / 0.8 - 5 , sy - h / 2 - 1 , w + 150 , h , tocolor ( 0 , 0 , 0 , 200 ) )
dxDrawText ( tostring ( text ), sx , sy , sx , sy , tocolor ( 255 , 255 , 255 , 255 ), 1 , "default-bold" , "center" , "center" )
end
end
end
end
end
addEventHandler ( "onClientRender" , getRootElement ( ), renderIng )
Licze na piwo ;-)
Więcej szczegółów
Wystawiono 1 piw(a):Prever77
Wysłany: 2014-12-26, 22:37
Dixers
No-Life
Wiek: 26 Na forum: 4313 dni Posty: 549
Nick w MP: Dixers
Piwa : 412
Bingwin , super. Je?li pozwolisz te? skorzystam z tego kodu.
Wysłany: 2014-12-27, 01:04
Bingwin
LUA MTA
Wiek: 27 Na forum: 4191 dni Posty: 95
Nick w MP: Bingwin
Piwa : 2070
Dixers , No spoko nie ma sprawy
Wysłany: 2014-12-27, 23:36
Fanciak
BOT
Wiek: 25 Na forum: 4446 dni Posty: 728
Nick w MP: Fanciak
Piwa : 1572
Bingwin , te opisy dzia?aj?, ale "Gra zminimalizowana" nie dzia?a. Gracz ma zminimalizowan? i stoi przede mn? lecz ja tego nie widze, ?e ma zminimalizowan?. Mam folder, a w nim 2 pliki i meta. S-side i C-side, w meta mam to wpisane i oby dwa po stronach clienta. Prosi?bym o pomoc, dlaczego nie wy?wietla si? to.
Wysłany: 2014-12-28, 09:14
Bingwin
LUA MTA
Wiek: 27 Na forum: 4191 dni Posty: 95
Nick w MP: Bingwin
Piwa : 2070
Wysłany: 2014-12-28, 12:20
Fanciak
BOT
Wiek: 25 Na forum: 4446 dni Posty: 728
Nick w MP: Fanciak
Piwa : 1572
W?a?nie nie. DB3 nie pokazuje ?adnego b??du. Napisy si? pojawiaj?, ale jedyny b??d to ten z gr? zminimalizowan?. Albo ja co? robie ?le, albo nie wiem. Je?eli mo?esz to prosi?bym o zapakowanie tego do zipu i podes?anie mi nawet na PM lub tutaj. Mo?e wtedy si? uda.
Tagi: napis :: nad :: markerem
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: