Jump to content

Detecting gunshots at vehicle


patriot

Recommended Posts

Posted

Hi,

I'd like to know if there is any way to detect whether the vehicle is getting shot at it's front or rear side, or anything that can help me. (Generally, I want to detect if the vehicle's engine is getting shot at)

Thanks.

Posted

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

Posted

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)

Posted

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.

Posted
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?

Posted

If I set damage proof to true, am I still able to blow the vehicle's tires, for example?

My goal is only to set the engine health damageproof.

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