Jump to content
Sign in to follow this  
frosties

Executing a SQF if carrying certain equipment

Recommended Posts

Hello,

Would it be possible to have a code in INIT.sqf that ran if a player picks up a certain item?

such as a backpack or something?

Something like

[{typeOf (unitBackpack player) == "ITEM"}] execVM execVM "SCRIPT TO BE RUN";

Been sitting here looking and putting something together with no luck...

Share this post


Link to post
Share on other sites

im asuming you dont have to much scripting knowledge, so the easiest for you would be to use a trigger.

trigger condition:

(typeOf (unitBackpack player)) == "desired_backpack_classname"

on act:

_null = [] execVM "scriptname.sqf";

or if you just need a weapon instead of backpack, use this as condition:

"weapon_or_item_classname" in (weapons player)

NOTE: maps, documents etc in the item section of gear menu is also in weapons list.

player can also be unitname if such control is needed.

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  

×