m = createMarker(-2056.095703125, -90.3876953125, 35.3203125,"cylinder", 5, 255, 100, 0, 255)
function wystawa(plr,cmd, ...)
if isElementWithinMarker(plr, m) then
local pojazd=getPedOccupiedVehicle(plr)
if pojazd and getVehicleController(pojazd)==plr then
vname = getVehicleName(pojazd)
sprzedajacy = getPlayerName(plr)
przebieg = getElementData(pojazd,"przebieg") or 0
local tresc = tonumber(...)
setElementData(pojazd, "opis_aut",vname.."\nW?a?ciciel: "..sprzedajacy.."\nPrzebieg: "..przebieg.." km\nCena: "..tresc.." Z?")
end
end
end
addCommandHandler("wystaw", wystawa)
Brak?o jednej warto?ci w markerze, a dok?adnie - alphy.
Nie potrzeba alphy
//edit
To jest m?j kod kt?ry dzia?a, ty co? pokr?ci?e? z tym markerem.
Co? mi si? zdaje ze nie masz opcji kt?ra daje napisz na pojazd wiec ?ap
local sw,sh = guiGetScreenSize()
addEventHandler("onClientRender", root, function()
local rx,ry,rz = getCameraMatrix()
for i,v in ipairs(getElementsByType("vehicle", root)) do
local opis = getElementData(v, "opis_aut")
if opis then
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(opis, sx-(sw/5),sy,sx+(sw/5),sy, tocolor(255, 255, 255, 155), 1.1, "default-small", "center", "center", false, true)
end
end
end
end
end)
Bo na nadawaniu napisu(funkcja po??czona z markerem) ma elementDate 'opis_aut', a za? w funkcji wy?wietlania(ta od Gizma) ma 'opis', zmienie jedn? z nich.
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach