Jump to content

Question about marker


manve1

Recommended Posts

Posted

Would there be a way to make that if a player goes a lot higher then the marker is, he wouldn't get the function for example like a GUI shown if it is created that when u hit the marker u get a gui shown

----------------------------------

--Better explanation i think--

----------------------------------

I have a problem, when i don't hit the marker ( cylinder ) i just go flying through the top of it, i get a gui visible ( which i only want to make like if you hit the marker )

Z4qqg.png

P.s. Its a cylinder, and i only want to know if it is possible to make that when the original cylinder is hit ( colored bit ) you get the gui visible, not when in mid air.

Posted (edited)

could change it to ring marker type

or add to the handler that the ped position must be within range using getElementPosition

Edited by Guest
Posted

sorry uhm, i don't get your script, but this is how mine looks ( just a small piece ):

local guiFinnish = guiCreateWindow( 0.25, 0.3, 0.5, 0.3, 'Quit Job', true ) 
local markerFinnishJob = createMarker( 321, 874, 19.3, 'cylinder', 2.0, 255, 255, 0, 170 ) 
  
addEventHandler('onClientMarkerHit', markerFinnishJob, 
function() 
guiSetVisible( guiFinnish, true ) 
showCursor( true ) 
end, false 
) 

Posted

Ok, check if this works:

local guiFinnish = guiCreateWindow( 0.25, 0.3, 0.5, 0.3, 'Quit Job', true ) 
local markerFinnishJob = createMarker( 321, 874, 19.3, 'cylinder', 2.0, 255, 255, 0, 170 ) 
  
addEventHandler('onClientMarkerHit', markerFinnishJob, 
    function(hitPlayer, matchingDimension) 
     
        -- get position of ped and marker 
        local pedx,pedy,pedz = getElementPosition(hitPlayer) 
        local cpx,cpy,cpz =  getElementPosition(source) 
         
        -- check if the player is within 10 meters below or above the checkpoint, if so execute desired code 
        -- also check for dimension since its free 
        if (matchingDimension and ((pedz - cpz < 10 and pedz - cpz > 0) or (cpz - pedz < 10 and cpz - pedz > 0))) then  
            guiSetVisible( guiFinnish, true ) 
            showCursor( true )   
        end 
    end 
, false) 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...