Files
DayZ-Epoch/dayz_code/compile/player_gearSync.sqf
vbawol f5c738b74d 0.976
+ added allowed objects list for mpkilled and publishing objects
+ added missing vaultstorage to gear sync
+ fixed broken maxLocalZombies override via mission init.sqf
2013-02-22 09:01:35 -06:00

46 lines
1.2 KiB
Plaintext

private ["_objects"];
_objects = nearestObjects [getPosATL player, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage","VaultStorage"], 10];
{
["dayzUpdateVehicle",[_x,"gear"]] call callRpcProcedure;
} foreach _objects;
private["_dialog","_magazineArray","_control","_item","_val","_max"];
disableSerialization;
_dialog = _this select 0;
_magazineArray = [];
//Primary Mags
for "_i" from 109 to 120 do
{
_control = _dialog displayCtrl _i;
_item = gearSlotData _control;
_val = gearSlotAmmoCount _control;
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
if (_item != "") then {
if (_val != _max) then {
_magazineArray set [count _magazineArray,[_item,_val]];
} else {
_magazineArray set [count _magazineArray,_item];
};
};
};
//Secondary Mags
for "_i" from 122 to 129 do
{
_control = _dialog displayCtrl _i;
_item = gearSlotData _control;
_val = gearSlotAmmoCount _control;
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
if (_item != "") then {
if (_val != _max) then {
_magazineArray set [count _magazineArray,[_item,_val]];
} else {
_magazineArray set [count _magazineArray,_item];
};
};
};
dayz_unsaved = true;
dayz_Magazines = _magazineArray;