Disable vehicle weapons

Hey! I have been attempting to find a way to temporarily disable vehicle weapons using natives, unfortunately with no luck. I’ve tested a few different natives, but they either require me to provide specific weapon hashes (which I have many of) or they simply don’t work, like SetVehicleWeaponsDisabled().
Up until now, the only solution that has worked to some extent was to save the weapon capacities before setting them to zero. Later on, I can restore the saved data to reset the capacities back to their original values. However, this method doesn’t seem like the optimal solution to my issue.

Is there a native that can toggle every weapon on a vehicle on and off that I am missing?

Natives I’ve tried:

what are you trying to get to work. that vehicles like “toreador” can’t fire torpedos or are you trying to make so you can’t use normal guns in vehicles?

I am specifically looking for a solution that lets me temporarily disable vehicle weapons, as indicated by the title and main topic of this conversation. This is not related to player weapons in vehicles.

well im not to sure about the “code way” But you could just stream a vehicleweapon.meta file where you disable the weapons. that’s one way i know works.

I appreciate your replies, but to clarify again, I am looking for natives that can temporarily disable the weapons of a vehicle. If you have any other suggestions that meet these requirements, I am all ears! Thanks.

When you want to disable weapons do while loop in which you get current vehicle weapon via this native

and then disable it via this native

1 Like

Similar to the native description, I too am a bit confused about how exactly this native works, more specifically about the owner param. Is it just PlayerPedId(), or does it refer to the owner of something else?

It’s about driver

Thanks for the help! I figured out a working solution to my issue with the use of your suggested natives, and some other stuff. :smile:

Would love the script , if you willing to share , been looking for this too.

Hey. I don’t really have anything to share, as it’s just changing a boolean value. FYI the native shared in the solution does it’s job, but when setting it to false, the vehicle seems to “forget” its weapons until you respawn it.

I am pretty stupid comparatively speaking. Could you share the entire native you used including the content in the parenthesis just so I have an example? I am trying to disable all vehicle weapons when noclip is active in vMenu. I did this successfully with player weapons but am struggling with vehicle weapons.