Garry's Mod Wiki

Player:SetAllowWeaponsInVehicle

  Player:SetAllowWeaponsInVehicle( boolean allow )

Description

Allows player to use their weapons in a vehicle. You need to call this before entering a vehicle.

Shooting in a vehicle fires two bullets.

Issue Tracker: 1277

Arguments

1 boolean allow
Show we allow player to use their weapons in a vehicle or not.

Example

Adds a console command to toggle the ability to use weapons in vehicles.

concommand.Add( "weps_in_car", function( ply ) ply:SetAllowWeaponsInVehicle( not ply:GetAllowWeaponsInVehicle() ) end )