DroopyPiles 10 Posted August 1, 2014 How do I lock enemy inventory, as to stop me my team looting the dead enemy for a quick ammo fix. i'm hoping its not to click on a enemy and use lock, as I have hundreds of units. Is there a nice ez way :) thx in advanced Share this post Link to post Share on other sites
barbolani 198 Posted August 1, 2014 Use a killed eventhandler on enemies, when dead, delete all weapons, ammo and items? Share this post Link to post Share on other sites
maddogx 13 Posted August 1, 2014 Alternatively, you could use the InventoryOpened event handler. The second parameter is the "container", so you could check that against a list of "allowed containers". Not sure what is passed when the player opens his own inventory, probably either null or the player object. Share this post Link to post Share on other sites
DroopyPiles 10 Posted August 1, 2014 Use a killed eventhandler on enemies, when dead, delete all weapons, ammo and items? That sounds difficult do you have a example? and does that have to be done per unit Share this post Link to post Share on other sites
barbolani 198 Posted August 1, 2014 Are the units spawning or are all editor placed allready? Share this post Link to post Share on other sites
DroopyPiles 10 Posted August 1, 2014 Are the units spawning or are all editor placed allready? all placed Share this post Link to post Share on other sites
surfer 42 Posted August 1, 2014 Not perfect but this in your init.sqf should do it: { if ((side _x) == EAST) then { _x addEventHandler ["Killed",{ (_this select 0) setVehicleAmmo 0}]; } } forEach allUnits; Share this post Link to post Share on other sites
barbolani 198 Posted August 1, 2014 Assuming you are BLUFOR, on init.sqf: {if (side _x == EAST) then {_x addEventHandler ["Killed",{_unit = _this select 0; removeAllWeapons _unit; removeAllItemsWithMagazines _unit}]}} forEach allUnits; Share this post Link to post Share on other sites
surfer 42 Posted August 1, 2014 As we're on it: How do you lock items like weapons that you place in a gun shop? Share this post Link to post Share on other sites
DroopyPiles 10 Posted August 1, 2014 (edited) Assuming you are BLUFOR, on init.sqf:{if (side _x == EAST) then {_x addEventHandler ["Killed",{_unit = _this select 0; removeAllWeapons _unit; removeAllItemsWithMagazines _unit}]}} forEach allUnits; so can I do {if (side _x == EAST) then {_x addEventHandler ["Killed",{_unit = _this select 0; removeAllWeapons _unit; removeAllItemsWithMagazines _unit; removeBackpack _unit; removeBackpack _unit; removeHeadgear _unit; removeVest _unit; removeAllItems _unit; removeAllAssignedItems _unit}]}} forEach allUnits; ---------- Post added at 13:55 ---------- Previous post was at 13:47 ---------- Assuming you are BLUFOR, on init.sqf:{if (side _x == EAST) then {_x addEventHandler ["Killed",{_unit = _this select 0; removeAllWeapons _unit; removeAllItemsWithMagazines _unit}]}} forEach allUnits; Yea it does work sorry, yea, but i'm using ALiVE so the profiled units don't which is 95% of my units lol, nevermind Edited August 1, 2014 by DroopyPiles Share this post Link to post Share on other sites