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
- ammo box classnames:: https://community.bistudio.com/wiki/Arma_3_CfgVehicles_Equipment
- (ctrl+F "ammo".)
- */
- SURV_VehiclesLoaded = false;
- profileNamespace setVariable ["SURV_Vehicles",[]];
- {
- _Vehs = profileNamespace getVariable ["SURV_Vehicles",[]];
- _vehicle = _x;
- _xType = typeOf _x;
- _xPos = getPos _x;
- _xDir = getDir _x;
- _xDmg = damage _x;
- _xOwns = _x getVariable ["myCVar",[]];
- _xFuel = fuel _x;
- _weapons = weaponCargo _x;
- _magazines = magazineCargo _x;
- _hitPoints = [];
- _cachekey = format["%1_HP", _xType];
- _hitpoints = missionNamespace getVariable[_cachekey, []];
- _items = itemCargo _x; //added to copy "items" types
- if (_hitpoints isEqualTo []) then
- {
- _na = configProperties[configFile >> "CfgVehicles" >> _xType >> "HitPoints", "_hitpoints pushBack configName _x; true", true];
- missionNamespace setVariable[_cachekey, _hitpoints];
- };
- _finalHitPs = [];
- {
- _finalHitPs = _finalHitPs + [[_x,_vehicle getHitPointDamage _x]];
- } forEach _hitPoints;
- profileNamespace setVariable ["SURV_Vehicles",(_vehs + [[_xtype,_xpos,_xdir,_xdmg,_xowns,_xFuel,_weapons,_magazines,_finalHitPs,_items]])];
- } ForEach (nearestObjects [getmarkerpos "mymarker",["Box_IND_AmmoOrd_F", "Box_IND_Wps_F", "Box_NATO_Wps_F", "Box_NATO_WpsSpecial_F", "Box_NATO_Ammo_F"],100]); //add ammo box classnames to this array.
- saveProfileNamespace;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement