J.S. Posted October 24, 2013 Share Posted October 24, 2013 I'm just wondering if anyone has a list of the bodyPart IDs returned by onClientVehicleCollision. There doesn't seem to be any documentation on this and using debug lines doesn't seem to be helpful as it is just continually returning 0's. So if you do have the IDs, please do share as it's fairly important to what I'm working on. Thanks Link to comment
denny199 Posted October 24, 2013 Share Posted October 24, 2013 3: Torso 4: Ass 5: Left Arm 6: Right Arm 7: Left Leg 8: Right leg 9: Head https://wiki.multitheftauto.com/wiki/GetBodyPartName https://wiki.multitheftauto.com/wiki/OnPlayerWasted As far I know these are valid bodyparts???? -- if i'm right. Link to comment
Driggero Posted October 24, 2013 Share Posted October 24, 2013 I think he's talking about the vehicle body parts, not the ped body parts. The best way I found to check this is to write a simple script that outputs what body part you hit in the chat, so you can check where on the car these parts correspond to. addEventHandler("onClientVehicleCollision", root, function(element, force, part) if element then if getElementByType("vehicle") then outputChatBox("Body part was "..part) end end end ) As for the body parts themselves, it seems pretty difficult to tell where they are. Hitting a car head on will often trigger 2-3 body parts at once (i think they were 1,3 and 17). EDIT: you might also want to remove that if statement "if getElementByType("vehicle") then", as that is in there to make it only trigger when hitting other vehicles. Good luck! Link to comment
J.S. Posted October 24, 2013 Author Share Posted October 24, 2013 I appreciate your response Driggero, unfortunately I tried that before I posted this thread and it didn't give very definitive results (mostly just returned 0's). I'm fairly surprised that the IDs aren't documented anywhere. Link to comment
Moderators IIYAMA Posted October 25, 2013 Moderators Share Posted October 25, 2013 The reason for that is that you can't hit arms with a vehicle. Arms don't have collisions for vehicles or objects. Just like many other bodyparts. Maybe you noticed this: When you go sprint against a wall, 40% of your head is in the wall. Well here is one with a car ^^ http://img708.imageshack.us/img708/8164/4w9i.png ------------------------------------------------------------------------------------------- On the other hand everything can be calculated..... collisionX/Y/Z: the position the collision took place normalX/Y/Z: the surface normal of the hit object getPedBonePosition getDistanceBetweenPoints3D -- or processLineOfSight 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