Jump to content
Sign in to follow this  
FriZY_SK

Shooting modes

Recommended Posts

Hi,

How can i find out weapon and shooting mod (single, burst, full ) which currently using AI ?

Thx

Share this post


Link to post
Share on other sites

you can put a eventhandler fired on your Ai

it returns the following.

* unit: Object - Object the event handler is assigned to

* weapon: String - Fired weapon

* muzzle: String - Muzzle that was used

* mode: String - Current mode of the fired weapon

* ammo: String - Ammo used

Share this post


Link to post
Share on other sites

Yep, that's the method. If you need to get more information about the details of the current mode, then use the configFile commands, e.g.:

_roundsInBurst = getNumber (configFile >> "cfgWeapons" >> _weapon >> _mode >> "burst");
_isAutomatic = getNumber (configFile >> "cfgWeapons" >> _weapon >> _mode >> "autoFire");

etc.

That code is not all-encompassing, so you'd need to include checks for weapons that don't have a mode (_mode == _weapon) and for weapons that are using a different muzzle (_muzzle != _weapon) and have the config paths set up for those as well. But the gist is the same.

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  

×