Jump to content

How can I check is hitelement a ped?


Recommended Posts

I maked something like this:

addEventHandler("onColShapeHit", bank_col, function(he, md)
    if he == player then
        outputChatBox("good")
    else
        cancelEvent()
    end
end)

but this doesn't work.

 

I solved it myself

Working code:

addEventHandler("onColShapeHit", bank_col, function(he, md)
    if getElementType(he) == "ped" then
        cancelEvent()
    else
        outputChatBox("good")
    end
end)

 

Edited by NoviceWithManyProblems
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...