OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Trash Can Man on 03 Jun 2007, 20:51:45
-
I am makinga mission that involves terrorist activity. What I want to do is come up with some way to differentiate between the terrorist killing civilians or Blufors killing them. If the Blufor kills a civilian, then the mission ends in failure. Vice Versa if the terrorist kills a civilian, the mission continues. Can this be done first of all. If so, how?!?!?! ???
TCM
-
You need to put killed eventhandlers on the civilians. The killed evenHandler returns the victim and the killer. For a group of civilians, put this code in the group leader's init field:
{_x addEventHandler ["killed",{_this exec "civKill.sqs"}]} foreach units group this;
civKill.sqs would be your script where you would put the code to see who killed the civilian. The first two lines of your civKill.sqs should be:
_victim = _this select 0;
_killer = _this select 1;
Now the script knows who the victim was and who the killer was. You can now add code to test if the _killer is Blufor and end the mission.
Learn more about eventhandlers on the BIKI:
http://community.bistudio.com/wiki/addEventHandler
-
??? ??? ??? Well, I understand everything that goes in the init field, but you lost me after that!
TCM
-
alternatively learn even more about event handlers (http://www.ofpec.com/ed_depot/admin_list2.php?type=tu&cat=sc) on our very own site - explains it a bit better.
-
4 every civi put dis line in da init line
this addEventHandler ["killed",{_this exec "civKill.sqs"}]
now u got a script civkill.sqs
_killer = _this select 1;
? side _killer == west : blokill = true
exit
now use da blokill in da condition line 4 nything u wanna happen wen west ppl kill civies
also dont forget 2 rite blokill = false in da players init line or somin like dat
LCD OUT