Noxi Posted January 24, 2020 Share Posted January 24, 2020 Hello, I would like to know how I can or if it is possible to make a marker on the map to set a handling in the player's car. I would also like to know how to place a marker with a 3d image on the map Link to comment
NoviceWithManyProblems Posted January 24, 2020 Share Posted January 24, 2020 (edited) Yes, https://wiki.multitheftauto.com/wiki/CreateMarker https://wiki.multitheftauto.com/wiki/OnMarkerHit https://wiki.multitheftauto.com/wiki/SetVehicleHandling or you can edit https://community.multitheftauto.com/index.php?p=resources&s=details&id=3716 and instead of bindKey B move to the marker sample code to replace all createMarker in any image --[[ @author script: boszboszek @author contact: - email: [email protected] - discord: boszboszek#9153 ]]-- local arrow = dxCreateTexture('images/arrow.png', 'argb', false, 'clamp') local chuj = dxCreateTexture('images/chuj.png', 'argb', false, 'clamp') local anim_state, anim_tick = 'show', getTickCount() local anim_progress addEventHandler('onClientRender', root, function() local lp_pos = {getElementPosition(localPlayer)} for _,marker in pairs(getElementsByType('marker', root, true)) do local m_pos = {getElementPosition(marker)} if getMarkerType(marker) == 'cylinder' and getDistanceBetweenPoints3D(lp_pos[1], lp_pos[2], lp_pos[3], m_pos[1], m_pos[2], m_pos[3]) <= 80 then local m_color = {getMarkerColor(marker)} setMarkerColor(marker, m_color[1], m_color[2], m_color[3], 0) -- To jest po to, zeby te klasyczne markery byly niewidoczne local m_size = getMarkerSize(marker) local render_data = { m_pos[1] - m_size, m_pos[2] + m_size, m_pos[1] + m_size, m_pos[2] - m_size, m_pos[3] + 0.090, } local tick_calculate = (getTickCount() - anim_tick) / 1500 if anim_state == 'show' then anim_progress = interpolateBetween(255, 0, 0, 60, 0, 0, tick_calculate, 'OutQuad') anim_progress1 = interpolateBetween(5, 0, 0, 90, 0, 0, tick_calculate, 'Linear') render_data[5] = interpolateBetween(m_pos[3] + 0.080, 0, 0, m_pos[3] + 0.20, 0, 0, tick_calculate, 'OutQuad') if (getTickCount() - anim_tick) / 1000 > 1 then anim_tick = getTickCount() anim_state = 'hide' end elseif anim_state == 'hide' then anim_progress = interpolateBetween(60, 0, 0, 255, 0, 0, tick_calculate, 'OutQuad') anim_progress1 = interpolateBetween(90, 0, 0, 5, 0, 0, tick_calculate, 'Linear') render_data[5] = interpolateBetween(m_pos[3] + 0.20, 0, 0, m_pos[3] + 0.080, 0, 0, tick_calculate, 'OutQuad') if (getTickCount() - anim_tick) / 1000 > 1 then anim_tick = getTickCount() anim_state = 'show' end end dxDrawMaterialLine3D(m_pos[1], m_pos[2], m_pos[3] + 2.0, m_pos[1], m_pos[2], m_pos[3] + 1.0, arrow, 1.0, tocolor(255,255,255, anim_progress1)) dxDrawMaterialLine3D(m_pos[1], m_pos[2], m_pos[3] + 2.0, m_pos[1], m_pos[2], m_pos[3] + 1.0, chuj, 1.0, tocolor(255, 255, 255, anim_progress)) for index = 1, 4 do local offsetY = ((index - 1) * 0.2) end end end end) Or check this is similar https://www26.zippyshare.com/v/4tnjYDCh/file.html usage: exports["markers"]:createCustomMarker( 2074.8703613281, -1831.4195556641, 13.554534912109, 255, 255, 0, 1.5, "payNspray", 10, 255, 255, 255, "payNspray" ) Edited January 24, 2020 by NoviceWithManyProblems Link to comment
Noxi Posted January 24, 2020 Author Share Posted January 24, 2020 11 hours ago, NoviceWithManyProblems said: Yes, https://wiki.multitheftauto.com/wiki/CreateMarker https://wiki.multitheftauto.com/wiki/OnMarkerHit https://wiki.multitheftauto.com/wiki/SetVehicleHandling or you can edit https://community.multitheftauto.com/index.php?p=resources&s=details&id=3716 and instead of bindKey B move to the marker sample code to replace all createMarker in any image Reveal hidden contents --[[ @author script: boszboszek @author contact: - email: [email protected] - discord: boszboszek#9153 ]]-- local arrow = dxCreateTexture('images/arrow.png', 'argb', false, 'clamp') local chuj = dxCreateTexture('images/chuj.png', 'argb', false, 'clamp') local anim_state, anim_tick = 'show', getTickCount() local anim_progress addEventHandler('onClientRender', root, function() local lp_pos = {getElementPosition(localPlayer)} for _,marker in pairs(getElementsByType('marker', root, true)) do local m_pos = {getElementPosition(marker)} if getMarkerType(marker) == 'cylinder' and getDistanceBetweenPoints3D(lp_pos[1], lp_pos[2], lp_pos[3], m_pos[1], m_pos[2], m_pos[3]) <= 80 then local m_color = {getMarkerColor(marker)} setMarkerColor(marker, m_color[1], m_color[2], m_color[3], 0) -- To jest po to, zeby te klasyczne markery byly niewidoczne local m_size = getMarkerSize(marker) local render_data = { m_pos[1] - m_size, m_pos[2] + m_size, m_pos[1] + m_size, m_pos[2] - m_size, m_pos[3] + 0.090, } local tick_calculate = (getTickCount() - anim_tick) / 1500 if anim_state == 'show' then anim_progress = interpolateBetween(255, 0, 0, 60, 0, 0, tick_calculate, 'OutQuad') anim_progress1 = interpolateBetween(5, 0, 0, 90, 0, 0, tick_calculate, 'Linear') render_data[5] = interpolateBetween(m_pos[3] + 0.080, 0, 0, m_pos[3] + 0.20, 0, 0, tick_calculate, 'OutQuad') if (getTickCount() - anim_tick) / 1000 > 1 then anim_tick = getTickCount() anim_state = 'hide' end elseif anim_state == 'hide' then anim_progress = interpolateBetween(60, 0, 0, 255, 0, 0, tick_calculate, 'OutQuad') anim_progress1 = interpolateBetween(90, 0, 0, 5, 0, 0, tick_calculate, 'Linear') render_data[5] = interpolateBetween(m_pos[3] + 0.20, 0, 0, m_pos[3] + 0.080, 0, 0, tick_calculate, 'OutQuad') if (getTickCount() - anim_tick) / 1000 > 1 then anim_tick = getTickCount() anim_state = 'show' end end dxDrawMaterialLine3D(m_pos[1], m_pos[2], m_pos[3] + 2.0, m_pos[1], m_pos[2], m_pos[3] + 1.0, arrow, 1.0, tocolor(255,255,255, anim_progress1)) dxDrawMaterialLine3D(m_pos[1], m_pos[2], m_pos[3] + 2.0, m_pos[1], m_pos[2], m_pos[3] + 1.0, chuj, 1.0, tocolor(255, 255, 255, anim_progress)) for index = 1, 4 do local offsetY = ((index - 1) * 0.2) end end end end) Or check this is similar https://www26.zippyshare.com/v/4tnjYDCh/file.html Reveal hidden contents usage: exports["markers"]:createCustomMarker( 2074.8703613281, -1831.4195556641, 13.554534912109, 255, 255, 0, 1.5, "payNspray", 10, 255, 255, 255, "payNspray" ) thanks man .. the marker script you sent is not working. see well I start the resource and no marker appears Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now