add license plate persistence

note: consider alternate plate number system at spawn if duplicates are
found using the stock system.
This commit is contained in:
vbawol 2018-04-30 14:34:15 -05:00
parent c04724239b
commit 42515e3c56
2 changed files with 9 additions and 4 deletions

View File

@ -18,7 +18,7 @@ private ["_actualHitpoints","_allHitpoints","_allVehicles","_allowDamage","_arr"
params [["_maxVehicleLimit",0]];
_diag = diag_tickTime;
_dataFormat = ["", [], 0, [], 0, [], [], 0, ""];
_dataFormat = ["", [], 0, [], 0, [], [], 0, "", ""];
_dataFormatCount = count _dataFormat;
EPOCH_VehicleSlots = [];
_allVehicles = [];
@ -64,7 +64,7 @@ for "_i" from 1 to _maxVehicleLimit do {
if !((_arr select _forEachIndex) isEqualType _x) then {_arr set[_forEachIndex, _x]};
} forEach _dataFormat;
_arr params ["_class","_worldspace","_damage","_hitpoints","_fuel","_inventory","_ammo","_color","_baseClass"];
_arr params ["_class","_worldspace","_damage","_hitpoints","_fuel","_inventory","_ammo","_color","_baseClass",["_plateNumber",""]];
if (_class != "" && _damage < 1) then {
// remove location from worldspace and set to new var
@ -211,6 +211,11 @@ for "_i" from 1 to _maxVehicleLimit do {
};
};
// add previous license plate
if !(_plateNumber isEqualTo "") then {
_vehicle setPlateNumber _plateNumber;
};
if (_allowDamage) then {
_vehicle allowDamage true;
};

View File

@ -28,10 +28,10 @@ if (!isNull _vehicle) then {
_hitpoints = (getAllHitPointsDamage _vehicle) param [2,[]];
_inventory = _vehicle call EPOCH_server_CargoSave;
_colorSlot = _vehicle getVariable ["VEHICLE_TEXTURE",0];
_baseType = _vehicle getVariable ["VEHICLE_BASECLASS",""];
_VAL = [typeOf _vehicle,[getposworld _vehicle,vectordir _vehicle,vectorup _vehicle,true],damage _vehicle,_hitpoints,fuel _vehicle,_inventory,[true,magazinesAllTurrets _vehicle],_colorSlot,_baseType];
_VAL = [typeOf _vehicle,[getposworld _vehicle,vectordir _vehicle,vectorup _vehicle,true],damage _vehicle,_hitpoints,fuel _vehicle,_inventory,[true,magazinesAllTurrets _vehicle],_colorSlot,_baseType, getPlateNumber _vehicle];
["Vehicle", _vehHiveKey, EPOCH_expiresVehicle, _VAL] call EPOCH_fnc_server_hiveSETEX;
};
};