Jump to content
Sign in to follow this  
kocrachon

Firing My Gun Question...

Recommended Posts

So I am trying to make a sniper missions. And I was wondering if I could set a trigger that is enabled by the firing of a persons gun. Or even a specific gun at that?

Basically what I am looking to do is if the sniper doesn't kill the officer in one shot, then the officer runs off into a car and drives away. So I want to make it to where the trigger of the player firing sets it off. Because he either kills him or he doesn't...

Share this post


Link to post
Share on other sites

hmm, the only issue is that seems to go well beyond my expertise (which is really nothing) and I dont understand how it works very well...

Share this post


Link to post
Share on other sites

If you want to detect if your player fires a weapon, use this in his init line:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addEventHandler ["fired",{if (_this select 2 == "m24") then {activatetrigger=true}}]

This will detect if your unit fires the M24 sniper rifle and if he does it will set the variable "activatetrigger" to true.

You can use the variable "activaterigger" in the condition field of the waypoint of the target or a trigger, so once the shot is fired the target will move on and flee. If the target is dead, there won´t be any action.

Search for the right weaponname 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  

×