Jump to content

Client and Source


GhostXoP

Recommended Posts

  • MTA Team
Posted

It's just a name, you can call it "cakeface" if you want, refer to the wiki for their actual values. For example, onColShapeHit has a source value that is a marker (source values have variable name "source" that can be changed if re-declared) and first argument is the hit element so:

  
addEventHandler("onColShapeHit", root, function( hitElement ) 
       outputChatBox( "A " .. getElementType(hitElement) .. " hit a " .. getElementType(source) ) 
    end 
) 

To redeclare the source and call it "marker" (in most cases you wont need to do this):

  
addEventHandler("onColShapeHit", root, function( hitElement ) 
        local marker = source 
        outputChatBox( "A " .. getElementType(hitElement) .. " hit a " .. getElementType(marker) ) 
    end 
) 

Nearly all the time source is predefined, and client is manually defined (client = x, source is created by MTA)

It depends on what the wiki says and what you call the variables.

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