Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
DroopyPiles

Locking enemy inventory

Recommended Posts

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

Use a killed eventhandler on enemies, when dead, delete all weapons, ammo and items?

Share this post


Link to post
Share on other sites

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
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

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

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

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
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 by DroopyPiles

Share this post


Link to post
Share on other sites
Sign in to follow this  

×