0 Üye ve 1 Ziyaretçi konuyu incelemekte.
addEventHandler("onClientRender",root,function() local now = getTickCount() for i,marker in pairs(getElementsByType("marker",resourceRoot,true)) do local markerType = getMarkerType(marker) if markerType == "cylinder" then local x,y,z = getElementPosition(marker) local r,g,b,a = getMarkerColor(marker) if a ~= 0 then setMarkerColor(marker,r,g,b,0) end local size = getMarkerSize(marker) local k = interpolateBetween(.3*size,0,0,.5*size,0,0,now/4000,"CosineCurve") for i=0,6 do dxDrawOctagon3D(x,y,z+i*k/3.5,size/2,size*2,tocolor(r,g,b,255)) end end endend)--function dxDrawOctagon3D(x,y,z,radius,width,color) if type(x) ~= "number" or type(y) ~= "number" or type(z) ~= "number" then return false end local radius = radius or 1 local radius2 = radius/math.sqrt(2) local width = width or 1 local color = color or tocolor(255,255,255,150) point = {} for i=1,8 do point[i] = {} end point[1].x = x point[1].y = y-radius point[2].x = x+radius2 point[2].y = y-radius2 point[3].x = x+radius point[3].y = y point[4].x = x+radius2 point[4].y = y+radius2 point[5].x = x point[5].y = y+radius point[6].x = x-radius2 point[6].y = y+radius2 point[7].x = x-radius point[7].y = y point[8].x = x-radius2 point[8].y = y-radius2 for i=1,8 do if i ~= 8 then x, y, z, x2, y2, z2 = point[i].x,point[i].y,z,point[i+1].x,point[i+1].y,z else x, y, z, x2, y2, z2 = point[i].x,point[i].y,z,point[1].x,point[1].y,z end dxDrawLine3D(x, y, z, x2, y2, z2, color, width) end return trueend
function dxDrawCircle3D( x, y, z, radius, circle, color, width ) circle = circle or 16; -- sayı nekadar yüksekse circle okadar güzel gözükür ama fps daha fazla düşürür. color = color or tocolor( 255, 255, 0 ); width = width or 1; local Angle = 360 / circle; local fX, fY, tX, tY; for i = 1, circle do fX = x + math.cos( math.rad( Angle * i ) ) * radius; fY = y + math.sin( math.rad( Angle * i ) ) * radius; tX = x + math.cos( math.rad( Angle * (i+1) ) ) * radius; tY = y + math.sin( math.rad( Angle * (i+1) ) ) * radius; dxDrawLine3D( fX, fY, z, tX, tY, z, color, width ); end end addEventHandler("onClientRender", root, function() dxDrawCircle3D( 1603, -1696.4, 5, 3) -- test end )
birşey anlamadım