{"name":"vehicles","operator":null,"title":"vehicles","type":"command","url":"https://community.bistudio.com/wiki/vehicles","revid":377110,"updated":"2026-01-01T10:06:56Z","groups":["Object Detection"],"status":"ok","replaced_by":[],"games":[{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma1","name":"Armed Assault","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":"local","server_exec":false},"exec":null,"description":"Returns an array of all vehicles available to current client. This command returns both empty and crewed vehicles but not soldiers. It will also return \"WeaponHolderSimulated\" of dead bodies (weapon on the ground). Vehicles created with createVehicleLocal will only be returned on the client that created them.","syntaxes":[{"syntax":"vehicles","since":null,"effect":null,"exec":null,"params":[],"returns":{"type":"Array of Objects","types":["Array","Object"],"description":null,"text":"Array of Objects"},"form":"nullary","operator":null,"left":null,"right":null}],"examples":[{"text":"```sqf\n_vehicles = vehicles;\n```","code":["_vehicles = vehicles;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["allGroups","allUnits","units","entities","agents","playableUnits","switchableUnits","allPlayers","allDead","allDeadMen","allUnitsUAV","allCurators","allObjects","allMissionObjects","allSimpleObjects","allMines"],"notes":[{"user":"Sa-Matra","date":"2024-06-18T06:18:00Z","text":"This command returns a lot of crap that is not really a vehicle in a common sense - simulated weapon holders, clutter cutters, etc. It also skips \"out\" vehicles (disassembled drones and statics). Be careful iterating through it as it may be expensive.\n\nHere is a list of most vehicle simulations that are returned by this command:\n\n```sqf\nairplanex\nartillerymarker\ncar\ncarx\nfire\nhelicopterrtd\nlasertarget\nmotorcycle\nnvmarker\nparachute\nparaglide\nrope\nshipx\nsubmarinex\nsuppresstarget\ntankx\nthing\nthingx\n```\n\nGenerated using this code bit:\n\n```sqf\nprivate _sims = createHashMap;\n{\n    private _sim = toLowerANSI getText(_x >> \"simulation\");\n    if!(_sim in _sims) then {\n        _sims set [_sim, configName _x];\n    };\n} forEachReversed (\"getNumber(_x >> 'scope') > 0\" configClasses (configFile >> \"CfgVehicles\"));\n\nprivate _used_sims = [];\n{\n    if(createVehicle [_y, [random 1e5,random 1e5,random 1e5], [], 0, \"CAN_COLLIDE\"] in vehicles) then {\n        _used_sims pushBack _x;\n    };\n} forEach _sims;\n\n_used_sims sort true;\ncopyToClipboard (_used_sims joinString toString [10]);\n```\n\nThere is probably more simulations not listed like non-x versions of vehicle simulations but these are ones actually used in A3."}],"categories":["ArmA: Armed Assault: New Scripting Commands","ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Detection","Introduced with Armed Assault version 1.00","Scripting Commands","Scripting Commands: Local Effect","Take On Helicopters: Scripting Commands"]}