Jump to content
Sign in to follow this  
Tuliq

Get Weapon Used by Killer

Recommended Posts

Is it possible to determine the weapon a player used to kill another unit with? Need this for a simple killticker I am creating. Have been experimenting by using currentWeapon, and works like a charm, but in the event of a player using a timed or remotely detonated weapon like a grenade or satchel charge, this would not work. Are there any commands that can give me the exact weapon used in a kill?

Share this post


Link to post
Share on other sites

Scratch what I said, won't work.

Edited by Horner
Won't work.

Share this post


Link to post
Share on other sites

You could try to detect what weapon the killer used in the last few seconds before the player died.

In pseudocode:

1. when killer throws grenade, start some script that catches any kill up to several seconds after it. Not sure how to do it

Share this post


Link to post
Share on other sites

Yeah, I was thinking something along those two points myself. Will give it a shot. Ultimately it would be easier if the MPKilled eventhandler also passed the weapon type, but one can dream... anyway, thanks! :)

Share this post


Link to post
Share on other sites
...it would be easier if the MPKilled eventhandler also passed the weapon type...

It passes the killer though. So maybe something like:

_Weapon = CurrentWeapon _This Select 1;
Player SideChat Format ["%1", _Weapon];

Or

_Weapon = PrimaryWeapon _This Select 1;
Player SideChat Format ["%1", _Weapon];

Edited by Iceman77

Share this post


Link to post
Share on other sites

Yes I am using the currentWeapon method right now, which works, but is not reliable for the specific cases mentioned in the OP. I will experiment using the handledamage EH.

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  

×