{"name":"setVehicleCargo","operator":null,"title":"setVehicleCargo","type":"command","url":"https://community.bistudio.com/wiki/setVehicleCargo","revid":349523,"updated":"2023-11-08T17:15:54Z","groups":["Vehicle in Vehicle Transport"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.62"}],"since":{"game":"arma3","name":"Arma 3","version":"1.62"},"arma3_since":"1.62","branch":null,"locality":{"argument":null,"effect":"global","server_exec":false},"exec":null,"description":"Load cargo vehicle inside vehicle if possible, returns bool based on whether the vehicle was able to be loaded.  Can also be used to unload a specific loaded vehicle or all loaded vehicles.","syntaxes":[{"syntax":"vehicle setVehicleCargo cargo","since":null,"effect":null,"exec":null,"params":[{"name":"vehicle","type":"Object","optional":false,"default":null,"description":"vehicle for carrying cargo, objNull to unload specific loaded cargo","types":["Object"],"since":null,"text":"vehicle: Object - vehicle for carrying cargo, objNull to unload specific loaded cargo"},{"name":"cargo","type":"Object","optional":false,"default":null,"description":"cargo to put/loaded in vehicle, objNull to unload all loaded cargo","types":["Object"],"since":null,"text":"cargo: Object - cargo to put/loaded in vehicle, objNull to unload all loaded cargo"}],"returns":{"type":"Boolean","types":["Boolean"],"description":"whether or not operation was a success","text":"Boolean - whether or not operation was a success"},"form":"binary","operator":null,"left":{"text":"vehicle","types":["Object"]},"right":{"text":"cargo","types":["Object"]}}],"examples":[{"text":"Blackfish with no vehicle cargo loaded\n\n```sqf\nprivate _success = blackfish setVehicleCargo offroad; // true\n```","code":["private _success = blackfish setVehicleCargo offroad; // true"]},{"text":"Blackfish with full cargo already loaded\n\n```sqf\nprivate _success = blackfish setVehicleCargo offroad; // false\n```","code":["private _success = blackfish setVehicleCargo offroad; // false"]},{"text":"Unload specific loaded vehicle (will paradrop if dropped from high altitude)\n\n```sqf\nprivate _success = objNull setVehicleCargo offroad;\n```","code":["private _success = objNull setVehicleCargo offroad;"]},{"text":"Unload all vehicles (will paradrop if dropped from high altitude)\n\n```sqf\nprivate _success = blackfish setVehicleCargo objNull;\n```","code":["private _success = blackfish setVehicleCargo objNull;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["Arma 3: Vehicle in Vehicle Transport","canVehicleCargo","enableVehicleCargo","getVehicleCargo","isVehicleCargo","vehicleCargoEnabled"],"notes":[{"user":"ImperialAlex","date":"2016-07-04T18:46:00Z","text":"`objNull setVehicleCargo _cargoVehicle` - will unload specific loaded vehicle, and `_trasportVehicle setVehicleCargo objNull` will unload all vehicles. The unloaded vehicles will be paradropped if the altitude is high enough. See: [BIforums](https://forums.bistudio.com/topic/191678-vehicle-in-vehicle-transport-feedback/page-5#entry3056397)"}],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Vehicle in Vehicle Transport","Introduced with Arma 3 version 1.62","Scripting Commands","Scripting Commands: Global Effect"]}