Jump to content

How to use this event!?


GamerDeMTA

Recommended Posts

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

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