Jump to content
Sign in to follow this  
BEAKSBY

Check player loadout

Recommended Posts

HI All,

How do I check if the player has a particular item in his inventory?

if (player weapons[] == "Laserdesignator") then {code...};

Share this post


Link to post
Share on other sites

Hi,

"weapons" return an Array, used "in" for find element in an array.

if ("Laserdesignator" in weapons player) then {code...};

Share this post


Link to post
Share on other sites
Hi,

"weapons" return an Array, used "in" for find element in an array.

if ("Laserdesignator" in weapons player) then {code...};

Thanks,

I just tried player hasWeapon ""Laserdesignator" and it worked.

Share this post


Link to post
Share on other sites
Thanks,

I just tried player hasWeapon ""Laserdesignator" and it worked.

hasWeapon only works for weapons, there is no equivalent (no hasItem, hasGear) just keep in mind

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  

×