Epoch/Sources/epoch_code/compile/EPOCH_QuickTakeAll.sqf

44 lines
1.3 KiB
Plaintext
Raw Normal View History

2015-12-07 16:24:52 +00:00
/*
Author: Aaron Clark - EpochMod.com
Contributors:
Description:
Quick take concept for underwater looting
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
2016-06-13 16:54:19 +00:00
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_QuickTakeAll.sqf
2015-12-07 16:24:52 +00:00
*/
2016-09-01 00:29:08 +00:00
//[[[cog import generate_private_arrays ]]]
private ["_items","_magazines","_weapons"];
//[[[end]]]
2015-09-14 20:55:36 +00:00
closeDialog 0;
{
2017-10-12 20:48:32 +00:00
if ((_x getvariable ["EPOCH_Loot",false]) || _x iskindof "container_epoch") then {
_nearplayers = (player nearEntities ["Man", 12]) select {alive _x && isplayer _x && !(_x == player)};
if (count _nearplayers > 0) exitwith {
["Take all not allowed near other Players",5] call Epoch_message;
};
_magazines = magazinesAmmoCargo _x;
clearMagazineCargoGlobal _x;
{
[_x select 0,1] call EPOCH_fnc_addItemOverflow;
} foreach _magazines;
_items = itemCargo _x;
clearItemCargoGlobal _x;
{
_x call EPOCH_fnc_addItemOverflow;
} foreach _items;
_weapons = weaponCargo _x;
clearWeaponCargoGlobal _x;
{
_x call EPOCH_fnc_addItemOverflow;
} foreach _weapons;
};
} foreach nearestObjects[player, ["container_epoch","weaponholdersimulated","GroundWeaponHolder"], 5];