Jump to content

onClientClick with markers


Tails

Recommended Posts

Hello,

I've tried many different things (including processLineOfSight) but it does not detect the marker element. It's going right through it. There's no problem with objects, though. Is there any way to detect markers with a mouse click?

function pickupItem(button,state,_,_,x,y,z,clickedElem) 
    if button == "left" and state == "down" and getKeyState("e") then 
        if isElement(clickedElem) then 
            if getElementType(clickedElem) == "marker" then 
                outputChatBox("hit marker") 
            end 
        end 
    end 
end 
addEventHandler("onClientClick",root,pickupItem) 

Link to comment
hm.. You could connect an object to the marker maybe. And use

getElementAttachedTo

Right!

Make a invisible ped. Not really attach it, you could probably use setElementParent and then getElementParent?

createPed

setElementAlpha

setElementParent

getElementParent

Link to comment

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...