OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: rgordon on 26 Mar 2003, 21:47:17

Title: Detect who killed unit
Post by: rgordon on 26 Mar 2003, 21:47:17
I need to detect who killed a specific unit and assign the unit name to a variable.

If this has been covered in another thread, can you please give me a link.

Thanks in advance for any help.
Title: Re:Detect who killed unit
Post by: imemyself on 05 May 2003, 02:00:44
This might works
Code: [Select]
PersonWhoWasKilled unit1 addEventHandler["killed",{PersonWhoDidTheKilling=_killer}]


personwhowaskilled is the unit that will be killed
personwhodidthekilling would be the person who killed unit1.

Title: Re:Detect who killed unit
Post by: DrStrangelove on 05 May 2003, 19:33:15
I'm sorry, but that would mean you'd have to script that line before you'd even know who would kill who, wouldn't you ?  :P
Title: Re:Detect who killed unit
Post by: hurlothrumbo on 06 May 2003, 12:34:02
no, you just put it in init of the unit that he wants to be killed.