mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Continuation of 8035df0
This is important to have on publish to identify cheaters who spam
create objects in the database or create objects with bad inventory.
- Renamed variables to backport to vanilla
- Removed % and & due to code filtering in publicvariableval.txt
Changes in modular_build.sqf were the same as player_build.sqf.
Tested with building, upgrading buildable/vehicle/tent, downgrading,
buying a vehicle, destroying tent and removing an object.
69 lines
2.4 KiB
Plaintext
69 lines
2.4 KiB
Plaintext
private ["_localResult2","_VehKey2","_keyArr","_deleteRet","_vehicle","_delType","_containerFindKey"];
|
|
_VehKey2 = (_this select 0) select 0;
|
|
_delType = _this select 1;
|
|
|
|
_containerFindKey = {
|
|
private ["_keys","_weapTypes"];
|
|
_keys = [];
|
|
_weapTypes = (_this select 1) select 0;
|
|
{
|
|
if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"]) then {
|
|
if (str(getNumber(configFile >> "CfgWeapons" >> _x >> "keyid")) == (_this select 0)) then {
|
|
_keys set [count _keys, _x];
|
|
};
|
|
};
|
|
} forEach _weapTypes;
|
|
_keys;
|
|
};
|
|
|
|
if ((count _VehKey2) > 0) then {
|
|
if ((_VehKey2 select 0) == "0" || _delType in DZE_tradeVehicleKeyless || DZE_keepVehicleKey) then {
|
|
_localResult2 = 1;
|
|
} else {
|
|
{
|
|
if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"]) then {
|
|
if (str(getNumber(configFile >> "CfgWeapons" >> _x >> "keyid")) == (_VehKey2 select 0)) then {
|
|
_localResult2 = [player,_x,1] call BIS_fnc_invRemove;
|
|
};
|
|
};
|
|
} forEach (items player);
|
|
if ((typeOf (unitBackPack player)) != "") then {
|
|
_keyArr = [(_VehKey2 select 0), (getWeaponCargo (unitBackpack player))] call _containerFindKey;
|
|
_deleteRet = [unitBackpack player,[],_keyArr,[]] call ZUPA_fnc_removeWeaponsAndMagazinesCargo;
|
|
if (isNil "_localResult2") then {
|
|
_localResult2 = ((_deleteRet select 1) select 0);
|
|
} else {
|
|
if (_localResult2 == 0) then {
|
|
_localResult2 = ((_deleteRet select 1) select 0);
|
|
};
|
|
};
|
|
};
|
|
_vehicle = DZE_myVehicle;
|
|
if (count _this > 2 && {isNull _vehicle}) then {
|
|
_vehicle = _this select 2;
|
|
};
|
|
if (!isNull _vehicle) then {
|
|
_keyArr = [(_VehKey2 select 0), (getWeaponCargo _vehicle)] call _containerFindKey;
|
|
_deleteRet = [_vehicle,[],_keyArr,[]] call ZUPA_fnc_removeWeaponsAndMagazinesCargo;
|
|
if (isNil "_localResult2") then {
|
|
_localResult2 = ((_deleteRet select 1) select 0);
|
|
} else {
|
|
if (_localResult2 == 0) then {
|
|
_localResult2 = ((_deleteRet select 1) select 0);
|
|
};
|
|
};
|
|
};
|
|
if (!DZE_SaleRequiresKey) then {_localResult2 = 1;};
|
|
};
|
|
if (isNil "_localResult2") then {
|
|
_localResult2 = 0;
|
|
} else {
|
|
PVDZ_obj_Destroy = [(_VehKey2 select 2),(_VehKey2 select 3),player,(_VehKey2 select 1),dayz_authKey];
|
|
publicVariableServer "PVDZ_obj_Destroy";
|
|
//deleteVehicle (_VehKey2 select 1);
|
|
};
|
|
} else {
|
|
_localResult2 = 0;
|
|
};
|
|
_localResult2;
|