Jump to content

[HELP] Ped on Marker


Recommended Posts

Posted

Hello Guys, I'm studying MTA, and I have a problem with my code look this:

  
        thePed = createPed(12, 0,0,0 ) 
    carIni = createVehicle ( 405, 133, 2218, 35.7,0,0, 180 ) 
    warpPedIntoVehicle ( thePed, carIni )  
        setElementVelocity (carIni , 0, -0.1, 0)     
  
enyMarker = createMarker(141.8,1944,18, "cylinder" , 15.0, 0, 0, 0, 200) 
addEventHandler("onMarkerHit" , enyMarker, 
function() 
 if getElementType(thePed) == "ped" and getPedOccupiedVehicle(thePed) then 
        outputChatBox("sdsd") 
    end 
end 
  

I need the condition of only ped touch the marker and do something

only ped not the player

Thanks!

Posted

You need to specify the parameters in your function:

element hitElement, bool matchingDimension 

Change line 9 to this:

function(thePed) 

and the hitElement will be passed to the event.

Posted
You need to specify the parameters in your function:
element hitElement, bool matchingDimension 

Change line 9 to this:

function(thePed) 

and the hitElement will be passed to the event.

Thank You!

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