Jump to content
Sign in to follow this  
Hank_2011

Information on Weapons

Recommended Posts

Hi all.

Description:

This script gives information "Hint": Shooter. Victim. Distance (from the shooter to the victim).

But I do not know how to add information about the weapons the shooter.

I will be glad of any help and advice.

init.sqf:

[] exec "killer.sqs"

init_unit:

this addeventhandler["killed",{obj_killed = _this select 0;obj_killer = _this select 1;{publicvariable _x}foreach["obj_killed","obj_killer"]}];

killer.sqs:

#init

obj_killed = objnull

obj_killer = objnull

@obj_killed == obj_killed && obj_killer == obj_killer

? obj_killer != obj_killed : hint format["Shooter: %1\n%2\n%3", name obj_killer, name obj_killed, round (obj_killed distance obj_killer) ]

goto "init"

Share this post


Link to post
Share on other sites

the eventhandler fired gives weapon used info, but needs to be active on the shooter to return anything afaik.

you could try primaryWeapon if you know that a unit/enemy will not have a secondary weapon, as you cannot detect what weapon is used without the EH fired.

But if you know it only has its primary weapon then guessing on the primary will be ok, now if unit has a rpg etc, i think those fall under the secondary weapons but unsure.

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  

×