Jump to content

any possiblity for onClientObjectHit??


King12

Recommended Posts

Hello there,

I'm trying to check if the car hits the object but I couldn't..

My code :

  
function onPlayerTargeted ( theObject, thePlayer ) 
    local object = getElementModel ( theObject ) 
    if object == 18450 then 
    local vehicle = getPedOccupiedVehicle ( thePlayer ) 
    blowVehicle ( vehicle ) 
    end 
end 
addEventHandler ( "onClientObjectDamage", root, onPlayerTargeted ) 
  

Any advice/suggestions?

Link to comment
function onPlayerTargeted ( _, theVehicle ) 
    local object = getElementModel ( source ) 
    if object == 18450 and getElementType(theVehicle) == "vehicle" then 
        blowVehicle ( theVehicle ) 
    end 
end 
addEventHandler ( "onClientObjectDamage", root, onPlayerTargeted ) 

Link to comment
function onPlayerTargeted ( theObject, thePlayer )

Where you got that from? Its wrong.

Always read the wiki.

Are you complaining about the function's name? or the arguments?

I don't reject any helps.

+

I didn't see any outputs in debugscript so I thought my code is correct.

Link to comment
  
  
function onPlayerTargeted ( loss, thePlayer ) 
    local object = getElementModel ( source ) 
    if object == 18450 then 
    local vehicle = getPedOccupiedVehicle ( thePlayer ) 
    blowVehicle ( vehicle ) 
    end 
end 
addEventHandler ( "onClientObjectDamage", root, onPlayerTargeted ) 
  
  

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