GSC reference › Built-in
SetVehWeapon()
Built-in (engine)
Server
Vehicle Called on: vehicle
Set the vehicle's weapon
Signature
<vehicle> SetVehWeapon(<weapon name>)
Called on an entity: vehicle SetVehWeapon(...)
Parameters
| Name | Required? | Details |
|---|---|---|
| weapon name | Required | The name of the weapon |
Example (from Treyarch's docs)
chopper setVehWeapon( "AGM_114" )
Real uses in BO3's scripts
Called 11 times in the decompiled scripts. A few, zombies first:
- scripts/zm/zm_stalingrad_dragon.gsc, line 996
var_2e1f54d4.var_caa5308f setvehweapon(weapon); - scripts/shared/vehicles/_hunter.gsc, line 1617
self setvehweapon(self.vehicle_weapon_override); - scripts/shared/vehicles/_quadtank.gsc, line 1057
self setvehweapon(getweapon("quadtank_main_turret_rocketpods_straight")); - scripts/mp/killstreaks/_helicopter.gsc, line 3109
self setvehweapon(weapon); - scripts/cp/cp_mi_cairo_aquifer_utility.gsc, line 5056
level.var_c37cadc1 setvehweapon(getweapon("vtol_fighter_player_missile_turret"));
Related built-ins
- SetVehicleWeaponWaitDuration()Sets the weapon wait duration for the players vehicle (intended for use with client side display purposes)
- SetVehicleWeaponWaitEndTime()Sets the vehicle weapon wait end time.
- SetVehGoalPos()Set the target position for this vehicle.
- GetVehicleNode()Gets a vehicle node with the given name, key pair
- ClearVehGoalPos()Clears the target position for this vehicle.
- SetVehVelocity()Sets the linear velocity on a vehicle/s.
- UseVehicle()Same as useby except you can specify a seat, 0 driver, 1-4 gunners
- FireWeapon()Fire the vehicle's weapon
- SeatGetWeapon()Returns the weapon name for the specified seat.
- FinishVehicleDamage()Does damage to an vehicle - usually as part of the damage callback
- MakeVehicleUnusable()Sets this vehicle to be not usable by the player
- FinishVehicleRadiusDamage()Does damage to an vehicle - usually as part of the damage callback
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).