GSC reference › Built-in
GetVehicleArray()
Built-in (engine)
Server
Returns an array of all of the vehicles in a level
Signature
GetVehicleArray([name], [key])
Parameters
| Name | Required? | Details |
|---|---|---|
| name | Optional | Name to search for. |
| key | Optional | The key to search for. |
Example (from Treyarch's docs)
enemies = GetVehicleArray( "drones", "targetname" )
Real uses in BO3's scripts
Called 8 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_zm_ai_spiders.gsc, line 268
var_4b55c671 = getvehiclearray("zombie_spider", "targetname"); - scripts/zm/_zm_genesis_spiders.gsc, line 231
var_4b55c671 = getvehiclearray("zombie_spider", "targetname"); - scripts/zm/zm_genesis_skull_turret.gsc, line 812
a_vehicles = getvehiclearray(self.script_string, ""); - scripts/mp/_incendiary.gsc, line 378
all_targets = arraycombine(all_targets, getvehiclearray(), 0, 0); - scripts/cp/_debug.gsc, line 3205
vehicles = getvehiclearray();
Related built-ins
- GetVehicleNodeArray()Gets an array of vehicle nodes that have the given name, key pair
- GetVehicleTeamArray()Returns an array of all of the vehicles in a level that are not sentients
- GetVehicleSpawnerArray()Returns an array of all of the vehicle spawners in a level
- GetVehicleSpawnerTeamArray()Returns an array of all of the vehicle spawners in a level with the specified team
- array()Create an array
- GetEntArray()Looks up entities by key and name and a return an array of the matched entities
- IsArray()Checks whether this entity/variable is an array
- ArrayRemoveValue()Remove a value from an array (may affect multiple indexes)
- GetAITeamArray()Returns an array of the human AI and vehicle AI
- GetArrayKeys()Returns an array consisting of the keys of the input array.
- ArrayCombine()Combine two arrays into and returns one new array
- IsInArray()Searches an array to determine if a given value is present in that array
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).