Jump to content
Sign in to follow this  

NearestObject WeaponHolder - Death Issue

Recommended Posts

Right I've noticed that people tend to drop their weapons into a WeaponHolder when they die. This means that my gear script won't be able to track what sort of weapon was carried in the primary weapon slot.

I've tried some simple nearestObject/NearestObjects without any luck, this is all located into an eventHandler that checks if the player is killed. When killed it launches my script which extracts all the gear and the weapon to the respawn box.

This means that the rest of the gear on the body is removed to avoid looting as the mission this is used on is based on cash from waves and something else irrelevant.

My true question would be the use of NearestObject/NearestObjects upon death to find this weaponholder and take it's weapon content and move it to the box. Moving it to the box is a small issue that is dependant on knowing the classname of the weapon and where it is, so that's my main concern!

Does any of you have any idea how to counter this new feature in A3? Help me find the missing WeaponHolder, cheers :)

Share this post

Link to post
Share on other sites

Hi Oksman,

I would try spawn a script from within the code in the EH with a short sleep in it, and then the check for the WH (in case the weapon holder hasn't spawned as soon as the EH runs).

Also, try looking for "WeaponHolderSimulated" as well. They're the physics enabled ones that allow weapons to spin about when they are dropped.

Share this post

Link to post
Share on other sites

Match the index with each killed entity.

private ["_All"];
_All = [];
 if (typeof _x in ["WeaponHolderSimulated","WeaponHolder"]) then {
   _All set [count _All,[
  getweaponcargo _x,
  getmagazinecargo _x,
  getbackpackcargo _x,
  getitemcargo _x
} forEach Vehicles;

Edited by ffur2007slx2_5

Share this post

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now
Sign in to follow this