From eae4376b9fa195da79ce4d09b11516936f3be89b Mon Sep 17 00:00:00 2001 From: Bones50 Date: Mon, 6 Nov 2017 13:14:19 +1100 Subject: [PATCH] Update ExileServer_object_vehicle_database_update.sqf --- ...eServer_object_vehicle_database_update.sqf | 89 ++++++++++--------- 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/Exile.Altis/Custom/ammoSave/ExileServer_object_vehicle_database_update.sqf b/Exile.Altis/Custom/ammoSave/ExileServer_object_vehicle_database_update.sqf index 6350daa..cfc8e11 100644 --- a/Exile.Altis/Custom/ammoSave/ExileServer_object_vehicle_database_update.sqf +++ b/Exile.Altis/Custom/ammoSave/ExileServer_object_vehicle_database_update.sqf @@ -9,52 +9,53 @@ * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ -private["_vehicleObject","_vehicleID","_position","_vectorDirection","_vectorUp","_availableHitpoints","_vehicleHitpoints","_data","_extDB2Message","_currentLoadout", "_magClass", "_turretPath", "_ammoCount", "_inserted", "_magInserted", "_magData"]; -_vehicleObject = _this; -_vehicleID = _vehicleObject getVariable ["ExileDatabaseID", -1]; -if (_vehicleID > -1) then -{ - _position = getPosATL _vehicleObject; - _vectorDirection = vectorDir _vehicleObject; - _vectorUp = vectorUp _vehicleObject; - _availableHitpoints = getAllHitPointsDamage _vehicleObject; - _vehicleHitpoints = []; - if!(_availableHitpoints isEqualTo [])then - { - { - _vehicleHitpoints pushBack [_x ,_vehicleObject getHitPointDamage _x]; - } - forEach (_availableHitpoints select 0); - }; - _data = - [ - _vehicleObject getVariable ["ExileIsLocked",-1], - fuel _vehicleObject, - damage _vehicleObject, - _vehicleHitpoints, - _position select 0, - _position select 1, - _position select 2, - _vectorDirection select 0, - _vectorDirection select 1, - _vectorDirection select 2, - _vectorUp select 0, - _vectorUp select 1, - _vectorUp select 2, - _vehicleObject call ExileServer_util_getItemCargo, - magazinesAmmoCargo _vehicleObject, - weaponsItemsCargo _vehicleObject, - _vehicleObject call ExileServer_util_getObjectContainerCargo, - _vehicleObject getVariable ["ExileMoney", 0], - _vehicleID +private["_vehicleObject", "_vehicleID", "_position", "_vectorDirection", "_vectorUp", "_availableHitpoints", "_vehicleHitpoints", "_data", "_extDB2Message"]; +_vehicleObject = _this; +_vehicleID = _vehicleObject getVariable ["ExileDatabaseID", -1]; +if (_vehicleID > -1) then +{ + _position = getPosATL _vehicleObject; + _vectorDirection = vectorDir _vehicleObject; + _vectorUp = vectorUp _vehicleObject; + _availableHitpoints = getAllHitPointsDamage _vehicleObject; + _vehicleHitpoints = []; + if!(_availableHitpoints isEqualTo [])then + { + { + _vehicleHitpoints pushBack [_x ,_vehicleObject getHitPointDamage _x]; + } + forEach (_availableHitpoints select 0); + }; + _data = + [ + _vehicleObject getVariable ["ExileIsLocked",-1], + fuel _vehicleObject, + damage _vehicleObject, + _vehicleHitpoints, + _position select 0, + _position select 1, + _position select 2, + _vectorDirection select 0, + _vectorDirection select 1, + _vectorDirection select 2, + _vectorUp select 0, + _vectorUp select 1, + _vectorUp select 2, + _vehicleObject call ExileServer_util_getItemCargo, + magazinesAmmoCargo _vehicleObject, + weaponsItemsCargo _vehicleObject, + _vehicleObject call ExileServer_util_getObjectContainerCargo, + _vehicleObject getVariable ["ExileMoney", 0], + _vehicleID ]; - _extDB2Message = ["updateVehicle", _data] call ExileServer_util_extDB2_createMessage; - _extDB2Message call ExileServer_system_database_query_fireAndForget; + _extDB2Message call ExileServer_system_database_query_fireAndForget; + + //Bones custoM Ammosave + _currentLoadout = _vehicleObject call Bones_fnc_getVehicleLoadout; - _currentLoadout = _vehicle call Bones_fnc_getVehicleLoadout; - _extDB2Message = ["setVehicleAmmo", [_currentLoadout, _vehicleID]] call ExileServer_util_extDB2_createMessage; _extDB2Message call ExileServer_system_database_query_fireAndForget; -}; -true \ No newline at end of file + //End Custom +}; +true