{"name":"vehicles","title":"vehicles","type":"command","url":"https://community.bistudio.com/wiki/vehicles","revid":377110,"updated":"2026-01-01T10:06:56Z","groups":["Object Detection"],"status":"ok","games":{"arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma1 1.00","arma3_since":"0.50","locality":{"effect":"local"},"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","params":[],"returns":{"type":"Array of Objects","type_expr":"Array<Object>"},"form":"nullary"}],"examples":[{"code":["_vehicles = vehicles;"]}],"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."}]}