Jump to content

How to use this event!?


GamerDeMTA

Recommended Posts

Posted

How to use onClientMarkerHit? where do I put My marker? Because the wiki says:

addEventHandler("onClientMarkerHit", getRootElement, thefunction)

Where do i put my marker??

Posted
marker = createMarker 
function functionName() 
--ELEMNTS WHEN THE MARKER(marker) IS HIT 
addEventHandler("onClinetMarkerHit", marker, functionName) 

XajVsWV.png

168_zps269f1907.gif[Dev]BloWnRPG - We BloW the World [1%]168_zps269f1907.gif

Posted

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!

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

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