Jump to content

Recommended Posts

Hi to everyone,

is it possible to know what weapon or ammo a unit fire?
and is it possible to show it in the debug window for an easy copy and paste?

Because I remember there was something like this

I hope anyone can help me on this

Share this post


Link to post
Share on other sites

You can get them without using an event handler if that suits you better. "currentweapon player" will get you the classname of the weapon, if you need display name you can use

((configFile >> "CfgWeapons" >> currentWeapon player >> "displayName") call BIS_fnc_GetCfgData)

magazinesAmmo might be useful for getting magtypes and ammo of all mags on player, currentMagazine just gets you the magazine class, and

player ammo currentWeapon player;

will give you the ammo count for the player's current weapon.

 

To get the display name of the current magazine use:

((configFile >> "CfgMagazines" >> currentMagazine player >> "displayName") call BIS_fnc_GetCfgData)

 

If you copy any of these into the debug "watch" bit, it'll give you the result

bmewIQi.png

 

Hope that helps you out (:

Share this post


Link to post
Share on other sites
2 hours ago, manofwar82 said:

What about to know the weapon a vehicle use?

this should do:

((configFile >> "CfgWeapons" >> (vehicle player) currentWeaponTurret [0] >> "displayName") call BIS_fnc_GetCfgData)

In a hunter this gives "RCWS HMG 12.7 mm". I'm not all too sure about turret paths (the "[0]", bit).

It might also work with "weapons (vehicle player) select X" or "(vehicle player) weaponsTurret [0] select X" instead of the currentWeaponTurret bit, where x is whichever one you'd need, depending on what your goal is.

And no worries, glad I can help (:

Share this post


Link to post
Share on other sites

weapons cursorTarget // or vehicle player, or....

currentWeapon cursorTarget // or vehicle player, or...

Share this post


Link to post
Share on other sites

Sorry guys, what about the ammo type?

ok I figured it out sorry :P

 

Share this post


Link to post
Share on other sites

I'm using the unit "commandartilleryfire" but it doesn't work because when I start the mission and the artillery should fire I get the msg that said noentry in bin/config/nameofthemagazzine. I'm using it with rhs vehicle

Can anyone help ?

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

×