King12 Posted September 6, 2014 Share 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? Link to comment
Bonsai Posted September 6, 2014 Share Posted September 6, 2014 function onPlayerTargeted ( theObject, thePlayer ) Where you got that from? Its wrong. Always read the wiki. Link to comment
WASSIm. Posted September 6, 2014 Share 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 ) Link to comment
Bonsai Posted September 6, 2014 Share Posted September 6, 2014 And another guy who didn't learn anything. Good job! Link to comment
King12 Posted September 6, 2014 Author Share 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. Link to comment
Gr0x Posted September 6, 2014 Share Posted September 6, 2014 onClientVehicleCollision Link to comment
King12 Posted September 6, 2014 Author Share Posted September 6, 2014 onClientVehicleCollision I've tried every single event, but still no bugs and not working! Link to comment
Moderators IIYAMA Posted September 7, 2014 Moderators Share Posted September 7, 2014 you can cry and learn nothing or you can debugging. https://wiki.multitheftauto.com/wiki/Debugging Link to comment
Anubhav Posted September 7, 2014 Share 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 ) Link to comment
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