AmLotte.
Wiek: 21 Na forum: 2184 dni Posty: 134
Nick w MP: AmLotte
Piwa : 443
Witam, mam problem taki i?, skrypt nie czyta eldat na markerach, dla testu zrobi?em if not data then i faktycznie wtedy ikona mi wyskoczy?a
robie markery dlatego te? przyda?by mi si? dla wygl?du obrazki nad nimi
Stawiam piwko za pomoc
W taki spos?b nadaje eldate po stronie clienta
Kod: setElementData(marker, "marker:custom", "jedzenie")
a to kod marker?w
Kod: addEventHandler("onClientRender", root,
function()
for i, v in ipairs(getElementsByType("marker")) do
local x, y, z = getElementPosition(v)
local x2, y2, z2 = getElementPosition(localPlayer)
setElementAlpha(v, 0)
local data = getElementData(v, "marker:costum")
local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
if (distanceBetweenPoints < distance) then
local size = getMarkerSize(v)
if anim_type == "back" then
local progress = (getTickCount() - animTime) / 3500
position = math.floor(interpolateBetween(0, 0, 0, 200, 0, 0, progress, "InQuad"))
if(progress > 1) then
anim_type = "foward"
animTime = getTickCount()
end
else
local progress = (getTickCount() - animTime) / 3500
position = math.floor(interpolateBetween(200, 0, 0, 0, 0, 0, progress, "OutQuad"))
if(progress > 1) then
anim_type = "back"
animTime = getTickCount()
end
end
dxDrawMaterialLine3D(x, y, z+1+1+(position/1000), x, y, z+1+(position/1000), g[1], 1, tocolor(255,255,255, 250))
if not data then
dxDrawMaterialLine3D(x, y, z+1+1+(position/1000), x, y, z+1+(position/1000), g[3], 1, tocolor(255,255,255, 250))
elseif data == "jedzenie" then
dxDrawMaterialLine3D(x, y, z+1+1+(position/1000), x, y, z+1+(position/1000), g[4], 1, tocolor(255,255,255, 250))
elseif data == "prawko" then
dxDrawMaterialLine3D(x, y, z+1+1+(position/1000), x, y, z+1+(position/1000), g[3], 1, tocolor(255,255,255, 250))
end
dxDrawMaterialLine3D(x+size, y+size, z+0.04, x-size, y-size, z+0.04, g[2], size*3, tocolor(255,255,255, 255), x, y, z)
end
end
end
)