how do i make it so that it only works when my guy fires a ak47 ?
You need to add an eventhandler type: fired to the unit by
using it's init field.
this addEventHandler ["FIRED", {_this exec "script.sqs"}]
Now create the script and put following into:
?(_this select 1 == "AK47"): whatever you want to do then here
exit
@Sui
Just noticed you're passing _this select 0,_this select 1 with
the exec command.
That's not necessary, as you can pass _this and then you can
have access to the elements of _this inside the script aswell.
If you want to check the contents of _this, then you can display
the whole array aswell by:
hint format ["%1", _this]
~S~ CD