[FREE] Shoot your passenger | gp_passengerCombat

gp_passengerCombat gif

gp_passengerCombat

gp_passengerCombat is a combat script for FiveM that fixes and enhances the native GTA V vehicle shooting mechanics. It utilizes custom raycast and vector calculations to allow you to accurately shoot other passengers or the driver within the same vehicle.

:left_arrow_curving_right: DOWNLOAD

Features

  • Precise Hit Detection: Mathematical trajectory calculation to reliably hit players and NPCs inside the vehicle.
  • Dynamic Firing Modes: Supports both precise aiming and blind firing. Can be restricted via the config.
  • First-Person Restriction: Option to restrict interior shooting to First-Person (FP) mode. This prevents accidental friendly fire when players just want to do a regular drive-by in Third-Person.
  • ox_inventory Ammo Sync: Built-in ammo synchronization for ox_inventory to prevent “ghost bullets”, infinite ammo glitches, and desyncs.
  • Exploit-Proof: Server-side validation to avoid exploiting events.
  • Standalone: Framework agnostic! Does not require ESX, QBCore, or any other framework to work.

Requirements

  • Framework: None! (100% Standalone)
  • Optional: ox_inventory (Native ammo sync is already integrated out of the box)

Video Showcase

Installation

  • Add to resources folder
  • Add ensure gp_passengerCombat to your config file

Discord

Join now!

9 Likes

You can simplify this by setting the Relationship between Players SetRelationshipBetweenGroups.

local DEFAULT_PLAYER_RELATIONSHIP <const> = 1
---Adjusts the relationship between players in order to shoot them
---@param activate boolean
local function toggleShootingOthersInVehicles(activate)
    local relationship = activate and 2 or DEFAULT_PLAYER_RELATIONSHIP
    SetRelationshipBetweenGroups(relationship, `PLAYER`, `PLAYER`)
end

lib.onCache("vehicle", function(value, oldValue)
    local toggle = value ~= false
    toggleShootingOthersInVehicles(toggle)
end)

That’s a quick Proof of Concept that worked for me.

3 Likes

yup this is the way to do it, I originally did this by throwing it in baseevents since that already checks in/out of vehicles.

2 Likes

Thank you guys for letting me know! I did not know about that.

1 Like

Nice Release, Hex Scripts want money for this

1 Like

you use baseevents ?

1 Like

finally this has been needed sine day 1 ……nice thanks :flexed_biceps:

1 Like

Yeah, why?

1 Like

its very abusable

1 Like

Not too hard to fix, I think most of the fixes are in the old PRs they never accepted.

1 Like