Jump to content
Sign in to follow this  
thegunnysgt

Adding an Action to a Weapon

Recommended Posts

Simple question, how can I add an action to a weapon?

Update

Okay, forget that last question.

How can I check if a squad has a particular weapon. I know of the group command and the hasweapon command. How can I combine them to be a condition for a trigger?

Also, how can I make a trigger only available during night time.

Share this post


Link to post
Share on other sites

Define (in a GamE logic or init.sqf/sqs):

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

hasWeaponBLAH = 0;

Script (executed from wanted Squad via <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">nil = [this] execVM "script.sqf";

------

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_group = group _this select 0;

while {alive _this select 0} do

{

{if (_x hasWeapon "BLAH") then {hasWeaponBLAH = 1;}} forEach units _group;

sleep 10.0;

};

Trigger:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

Condition: hasWeaponBlah == 1 && daytime > 19

onAct: Your Code Here

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  

×