Jump to content

Detecting gunshots at vehicle


patriot

Recommended Posts

You can debug the event and check the "bodypart". I'm not sure if this will be part of the ped's or vehicle's body. If it works with vehicles too then you don't need anything else but if it works with peds only then you'll need to calculate angle of where you got hit with the collisionX/Y/Z and current vehicle's position. You can use findRotation to help you a little.

https://wiki.multitheftauto.com/wiki/FindRotation

Link to comment

I've got to another idea: Attatching a hidden object to the front side of each vehicle model, then checking if it gets hit (or nearly hit, by distance) Is this possible? If yes, what functions and events would help in this case? Thanks!

To make this clear, I want to check when player shoots at any vehicles' bonnet (hood)

Link to comment
When the player or ped shoots the vehicle, use this function:
processLineOfSight 

It lets you know the part of the vehicle which is hit first by the line of sight.

Great!

How do I freeze vehicle's engine health when it doesn't get hit in the hood?

We already got the way to check whether the hood was hit or not; but is this possible to freeze engine's health without preventing the vehicles frame (inc. tires) from

being damaged?

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