King12 Posted September 6, 2014 Posted September 6, 2014 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?
Bonsai Posted September 6, 2014 Posted September 6, 2014 function onPlayerTargeted ( theObject, thePlayer ) Where you got that from? Its wrong. Always read the wiki.
WASSIm. Posted September 6, 2014 Posted September 6, 2014 function onPlayerTargeted ( _, theVehicle ) local object = getElementModel ( source ) if object == 18450 and getElementType(theVehicle) == "vehicle" then blowVehicle ( theVehicle ) end end addEventHandler ( "onClientObjectDamage", root, onPlayerTargeted )
Bonsai Posted September 6, 2014 Posted September 6, 2014 And another guy who didn't learn anything. Good job!
King12 Posted September 6, 2014 Author Posted September 6, 2014 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.
King12 Posted September 6, 2014 Author Posted September 6, 2014 onClientVehicleCollision I've tried every single event, but still no bugs and not working!
Moderators IIYAMA Posted September 7, 2014 Moderators Posted September 7, 2014 you can cry and learn nothing or you can debugging. https://wiki.multitheftauto.com/wiki/Debugging
Anubhav Posted September 7, 2014 Posted September 7, 2014 function onPlayerTargeted ( loss, thePlayer ) local object = getElementModel ( source ) if object == 18450 then local vehicle = getPedOccupiedVehicle ( thePlayer ) blowVehicle ( vehicle ) end end addEventHandler ( "onClientObjectDamage", root, onPlayerTargeted )
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now