OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: The-Architect on 07 Feb 2007, 15:24:26

Title: fired and hit
Post by: The-Architect on 07 Feb 2007, 15:24:26
I think.

How do I get a script written that will check if one of my team has killed a badguy and then play a sound?

Obviously I can do the sound bit but what about step one?
Title: Re: fired and hit
Post by: Mandoble on 07 Feb 2007, 17:12:51
EventHandler assigned to the bad guy:  "Killed" object:killer
Just check group of "killer" (_this select 1 inside assigned script), if it is your group, play your sound.
Title: Re: fired and hit
Post by: The-Architect on 07 Feb 2007, 22:07:45
er... what?
Title: Re: fired and hit
Post by: Mandoble on 07 Feb 2007, 23:10:44
Init field of bad guy:
Code: [Select]
this addeventhandler ["Killed", {_this exec "isdead.sqs"}]
isdead.sqs
Code: [Select]
_killer = _this select 1
?group _killer == group player: _killer say "yoursound"