Bnae 1431 Posted October 27, 2017 Well I would get current magazine type, remove all magazines and add couple of current magazines back. Keep it simple. 2 Share this post Link to post Share on other sites
Tajin 349 Posted October 27, 2017 Not a bad idea. Try this: addMissionEventHandler ["EntityKilled", { params["_killed"]; private ["_allmags","_uniquemags"]; if (_killed isKindOf "Man") then { _allmags = magazines _killed; _uniquemags = _allmags arrayIntersect _allmags; _allmags = _allmags - _uniquemags - _uniquemags; { _killed removeMagazine _x; } forEach _allmags; }; }]; Not the most elegant solution but it should leave only 2 of each type of magazine and remove all others. 1 Share this post Link to post Share on other sites
pierremgi 4923 Posted October 27, 2017 Modified mine which seems to be sufficient enough (tested) Player addEventHandler ["inventoryOpened",{ params ["_plyr","_cont"]; [ _plyr, _cont ] spawn { params ["_plyr","_cont"]; waitUntil {!isnull findDisplay 602}; if (!isNull _cont && {cursorTarget isKindOf _x} count ["CAManBase","WeaponHolderSimulated"] > 0) then { (findDisplay 602) closeDisplay 2 } } }]; inGameUISetEventHandler ["action", " _cont = _this select 0; _act = _this select 3; if ( {cursorTarget isKindOf _x} count ['CAManBase','weaponHolderSimulated'] > 0 && _act in ['Rearm','TakeWeapon','Gear','Inventory'] ) then {true} else {false} " ]; 3 Share this post Link to post Share on other sites
katipo66 94 Posted October 27, 2017 really nice guys! I look forward to trying these out later... much like I have been all thread [thumbsUp] 1 Share this post Link to post Share on other sites
Cpt.Price21 0 Posted June 10, 2018 35 minutes ago, Cpt.Price21 said: Could you tell nightvision id too ? İ mean number of slot nv goggles ? Share this post Link to post Share on other sites
anfo 118 Posted December 4, 2019 On 10/28/2017 at 12:02 AM, pierremgi said: Modified mine which seems to be sufficient enough (tested) @pierremgi Bit on the late side, but I tried this today and I like it very much. Would it be too difficult to add the possibility of ignoring a side, e.g. blufor? 1 Share this post Link to post Share on other sites
pierremgi 4923 Posted December 4, 2019 Looting on BLUFOR only: Spoiler Player addEventHandler ["inventoryOpened",{ params ["_plyr","_cont"]; [ _plyr, _cont ] spawn { params ["_plyr","_cont"]; waitUntil {!isnull findDisplay 602}; if (!isNull _cont && {!(cursorObject isKindOf "CAManBase" && [cursorObject,true] call BIS_fnc_objectSide isEqualTo WEST) or cursorObject isKindOf "weaponHolderSimulated"}) then { (findDisplay 602) closeDisplay 2 } } }]; inGameUISetEventHandler ["action", " _cont = _this select 0; _act = _this select 3; if ( (cursorObject isKindOf 'CAManBase' && !([cursorObject,true] call BIS_fnc_objectSide isEqualTo WEST)) or cursorObject isKindOf 'weaponHolderSimulated' && _act in ['Rearm','TakeWeapon','Gear','Inventory'] ) then {true} else {false} " ]; The loot on BLUFOR corpse is now possible but you need to aim an accurate area of the corpse. If the primary weapon is too close, it may fails. Try it also farer or nearer. 3 1 Share this post Link to post Share on other sites
anfo 118 Posted December 7, 2019 @pierremgi If you are still interested in further developing this code, the blufor is allowed to loot blufor, but not opfor aspect of the script works well. A strange side effect of the script however, is no inventory in crate or vehicle is accessible now! 😊 Share this post Link to post Share on other sites
pierremgi 4923 Posted December 7, 2019 Should work with: Player addEventHandler ["inventoryOpened",{ params ["_plyr","_cont"]; [ _plyr, _cont ] spawn { params ["_plyr","_cont"]; waitUntil {!isnull findDisplay 602}; if (!isNull _cont && (cursorTarget distanceSqr _plyr < 16) && {!(_cont isKindOf "ReammoBox_F" or [_cont,true] call BIS_fnc_objectSide isEqualTo WEST) && !(_cont isKindOf "groundWeaponHolder")}) then { (findDisplay 602) closeDisplay 2 } } }]; inGameUISetEventHandler ["action", " _cont = _this select 0; _act = _this select 3; if (_act in ['Rearm','TakeWeapon','Gear','Inventory'] && (cursorTarget distanceSqr player < 16) && {!(_cont isKindOf 'ReammoBox_F' or [_cont,true] call BIS_fnc_objectSide isEqualTo WEST) && !(_cont isKindOf 'groundWeaponHolder')} ) then {true} else {false} " ]; EDITED This script disable also the loot for weapons on ground (except if inside a blufor corpse inventory). This script enable the loot for weapons on ground except for those belonging to a non-BLUFOR corpse inventory. For BLUFOR corpse, you will not grab the primary weapon on ground but you can pick it in inventory. All crates are enabled. There is no immediate solution to make difference between a blufor gun and opfor gun. (Giving a side to weapons will be a future topic). 3 1 Share this post Link to post Share on other sites
anfo 118 Posted December 8, 2019 10 hours ago, pierremgi said: Should work Thank you, will give it a shot and report back 😀 Share this post Link to post Share on other sites
anfo 118 Posted December 30, 2019 On 12/7/2019 at 11:43 PM, pierremgi said: EDITED This script disable also the loot for weapons on ground (except if inside a blufor corpse inventory). This script enable the loot for weapons on ground except for those belonging to a non-BLUFOR corpse inventory. For BLUFOR corpse, you will not grab the primary weapon on ground but you can pick it in inventory. All crates are enabled. There is no immediate solution to make difference between a blufor gun and opfor gun. (Giving a side to weapons will be a future topic). As promised but not delivered. Bug found and reproduced in the following order: 1. Blufor Player can open own inventory, 2. Blufor Player checks EAST/GUER AI corpse inventory - blocked as designed, 3. Now Player cannot open own inventory. Share this post Link to post Share on other sites
pierremgi 4923 Posted December 30, 2019 I don't understand. Share this post Link to post Share on other sites
anfo 118 Posted December 31, 2019 10 hours ago, pierremgi said: I don't understand. The test I set up, was me killing an EAST and GUERRILA AI. Before I kill them, I can access my own inventory. After I kill them I can't access their inventory (good!). However, after I kill them, I can't access my own inventory. Share this post Link to post Share on other sites
pierremgi 4923 Posted December 31, 2019 1 hour ago, anfo said: The test I set up, was me killing an EAST and GUERRILA AI. Before I kill them, I can access my own inventory. After I kill them I can't access their inventory (good!). However, after I kill them, I can't access my own inventory. I can't reproduce that. Do you have a video? There is no reason for such change in behavior! Which script are you using? Share this post Link to post Share on other sites
anfo 118 Posted December 31, 2019 1 hour ago, pierremgi said: Do you have a video? I will produce a video Looks like I owe you my second apology.😞 Perhaps it was a late night of editing or any other flimsy reason, but it appears to work now. Sorry to set off a false alarm, I guess I should have double checked. It seems the only issue was the dead blufor weapon being inaccessible, but I am appreciative none the less. 🙂 Share this post Link to post Share on other sites
pierremgi 4923 Posted December 31, 2019 Just a point. The contextual BI menu like ream, take weapon, gear (with icons in middle on screen) are based on cursortarget. For some reason, you can access to these menus if the container (crate/corpse/vehicle) in behind you. Imho, it's a BI bug. CursorObject could be better but... not used by BI. If I don't want to have a cheat when the container is behind the player, I must work with cursortarget also. It's a choice: - use of cursorObject for a better aiming of the container, but BI allows you some unwanted menu when the container is behind you; - use of cursortarget to be compliant with BI action menus, then you'll fail to open your own inventory, if any blocked container is behind you. This is the option I opted for. 3 Share this post Link to post Share on other sites
anfo 118 Posted December 31, 2019 I see what you might be saying. I was possibly briefly looking at a corpse when I attempted to open my own inventory? Share this post Link to post Share on other sites
pierremgi 4923 Posted December 31, 2019 4 hours ago, anfo said: I see what you might be saying. I was possibly briefly looking at a corpse when I attempted to open my own inventory? Not briefly. With BI, you can look at a corpse even if the corpse is behind you. (same for crates or vehicles). That's a problem. There is a distance condition, fortunately. Share this post Link to post Share on other sites
TroyT 6 Posted June 1, 2020 Is it possible to prevent the looting of just the uniform? We have a custom uniform for an AI "faction" on our Exile servers that we don't want players to have. Share this post Link to post Share on other sites
pierremgi 4923 Posted June 1, 2020 6 hours ago, TroyT said: Is it possible to prevent the looting of just the uniform? We have a custom uniform for an AI "faction" on our Exile servers that we don't want players to have. Sure But it's not exactly the same problem because you want to access the inventory and avoid a shift between you uniform and the uniform on the corpse (if the class is met). Share this post Link to post Share on other sites
TroyT 6 Posted June 2, 2020 I'll create a new topic. Share this post Link to post Share on other sites
Mathieu Trudel 0 Posted November 20, 2020 On 4/6/2016 at 7:04 AM, Bnae said: player addMPEventHandler ["MPKilled",{_unit = _this select 0; removeAllWeapons _unit; removeAllAssignedItems _unit; clearMagazineCargo _unit}]; This can be used to limit what you can take hello Bnae, this script is very nice to what I need!!! Is there a way to make the headgear, and clothing to be not lootable and keep the ammo and weapon to BE lootable ?? i have tried this but failed .. : player addMPEventHandler ["MPKilled",{_unit = _this select 0; removeAllHeadgears _unit; removeAllClothings _unit; clearMagazineCargo _unit}]; thx Share this post Link to post Share on other sites