Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- File: saveVehicles.sqf
- Author: xBowBii (aka xbwb)
- Modified by Tom Mack - 13/06/17
- */
- _vehicles = profileNamespace getVariable ["SURV_Vehicles",[]];
- {
- private ["_log","_vtype","_vpos","_vdir","_vdam","_veh","_vFuel","_vWeap","_vMags","_vItems"]; //added "_vItems" to find item types
- _vType = _x select 0;
- _vPos = _x select 1;
- _vDir = _x select 2;
- _vDam = _x select 3;
- _vVar1 = _x select 4;
- _vFuel = _x select 5;
- _vWeap = _x select 6;
- _vMags = _x select 7;
- _hitp = _x select 8;
- _vItems = _x select 9; //added "_vItems"
- //"extLOG" callExtension format["0:VehicleLogging: %1 at %2, with dmg %3. Fuel is %4, and Cargo is %5 && %6",_vType,_vPos,_vDam,_vFuel,_vWeap,_vMags,_vItems]; //added "_vItems"
- if (_vDam == 1) exitWith {/* useless to spawn it */};
- _veh = createVehicle [_vType, _vPos, [], 0, "CAN_COLLIDE"];
- _veh setDir _vDir;
- _veh setDamage _vDam;
- removeAllWeapons _veh;
- removeAllItems _veh;
- //added to remove existing ammobox content.
- clearMagazineCargo _veh;
- clearWeaponCargo _veh;
- clearItemCargo _veh;
- _veh setVariable ["myCVar",_vVar1,true];
- {
- _veh setHitPointDamage [(_x select 0), (_x select 1)];
- } forEach _hitp;
- _veh setFuel _vFuel;
- {
- _veh addWeaponCargoGlobal [_x,1];
- } forEach _vWeap;
- {
- _veh addMagazineCargoGlobal [_x,1];
- } forEach _vMags;
- //added to add saved items.
- {
- _veh addItemCargoGlobal [_x,1];
- } forEach _vItems;
- } forEach _vehicles;
- sleep 20;
- SURV_VehiclesLoaded = true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement