Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local textures = {}
- xd = dxCreateTexture('test.png','argb',true,'clamp')
- local sx, sy = guiGetScreenSize()
- local zoom = sx / 1920 and 1 or math.min(2, 1920 / sx)
- font = dxCreateFont('f.ttf',8/zoom)
- function xd()
- for k, v in ipairs(getElementsByType("vehicle", root, true)) do
- if getElementData(v,'vehicle:salon') == true then
- data = getElementData(v,'vehicle:sell:info')
- local x, y, z = getElementPosition(localPlayer)
- local vx, vy, vz = getElementPosition(v)
- local dist = getDistanceBetweenPoints3D(x, y, z, vx, vy, vz)
- if dist < 5 then
- render(v) -- Podajesz dane auto do renderu
- else
- removeEventHandler('onClientRender',root,xd)
- end
- end
- end
- end
- addEventHandler('onClientRender',root,xd)
- local rt = dxCreateRenderTarget(253 / zoom, 123 / zoom, true)
- local tex = dxCreateTexture(253 / zoom, 123 / zoom)
- function render(Veh)
- local vx, vy, vz = getElementPosition(Veh)
- if rt then
- dxSetRenderTarget(rt, true)
- dxDrawImage(0, 0, 253 / zoom, 123 / zoom, xd, 0, 0, 0, tocolor(255, 255, 255, 255))
- dxDrawText("Model: "..getVehicleName(Veh), 15 / zoom, 10 / zoom, 253 / zoom, 123 / zoom, white, 1, font, "left", "top", false, false, false, true)
- dxDrawText("Przebieg: "..data['mileage1']..'km', 15 / zoom, 35 / zoom, 253 / zoom, 123 / zoom, white, 1, font, "left", "top", false, false, false, true)
- dxDrawText("Silnik: "..data['engine']..'dm3', 15 / zoom, 60 / zoom, 253 / zoom, 123 / zoom, white, 1, font, "left", "top", false, false, false, true)
- dxDrawText("Napęd: "..data['naped'], 15 / zoom, 85 / zoom, 253 / zoom, 123 / zoom, white, 1, font, "left", "top", false, false, false, true)
- dxDrawText("Cena: "..data['cost']..'PLN\n\nAby kupić pojazd,\npodejdź bliżej\ni kliknij K', 135 / zoom, 10 / zoom, 253 / zoom, 123 / zoom, white, 1, font, "left", "top", false, false, false, true)
- dxSetRenderTarget()
- dxSetBlendMode('modulate_add')
- dxDrawMaterialLine3D(vx, vy, vz + 2, vx, vy, vz + 1,rt, 3)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment