Jump to content
Sign in to follow this  
cheezy_ofp

Fired Event handler of a specific weapon

Recommended Posts

Ive read various threads on the Fired event handler but none seem to fully answer the following.

What Im looking to do is for a player (not everyone) to have access to a radio menu item ie 1 setRadioMsg "Item1" once they have fired a specific weapon.

Details/syntax for this would be appreciated.

Cheezy

Share this post


Link to post
Share on other sites

_this select 1 defines the weapon used by the eventhandler.

?(_this select 0)==player and (_this select 1)=="weaponclassname":1 setRadioMsg "Item1" is probably what you're looking for.

Share this post


Link to post
Share on other sites

ArmA Wiki: Fired Event Handler

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

unit: Object - Object the event handler is assigned to = (_this select 0)

weapon: String - Fired weapon = (_this select 1)

muzzle: String - Muzzle which was used = (_this select 2)

mode: String - Current mode of the fired weapon = (_this select 3)

ammo: String - Ammo used = (_this select 4)

ArmA Wiki: Weapons and Class Names

Celery explained it right. wink_o.gif Only to give you some more infos, if need.

.sqf example

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

_objectWhichFiredTheWeapon = _this select 0;

_weapon = _this select 1;

if (_objectWhichFiredTheWeapon == player && _weapon == "weaponClassName") then {1 setRadioMsg "Item1"};

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  

×