GamerDeMTA Posted August 9, 2013 Share Posted August 9, 2013 How to use onClientMarkerHit? where do I put My marker? Because the wiki says: addEventHandler("onClientMarkerHit", getRootElement, thefunction) Where do i put my marker?? Link to comment
golanu21 Posted August 9, 2013 Share Posted August 9, 2013 marker = createMarker function functionName() --ELEMNTS WHEN THE MARKER(marker) IS HIT addEventHandler("onClinetMarkerHit", marker, functionName) Link to comment
tosfera Posted August 9, 2013 Share Posted August 9, 2013 You can use a few different ways; addEventHandler("onClientMarkerHit", MARKER_NAME, function() -- todo end ); Using that way, you've to create the function everytime, over and over again for all your markers. To make it alittle more simple you can add an if-statement in it; addEventHandler("onClientMarkerHit", root, function ( source ) if ( source == MARKER_NAME ) then elseif ( source == MARKER_NAME2 ) then end end ); I'm not sure if Lua has a switch-case system built in. If it does, it would be a great way to use it! 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