Home   Help Search Login Register  

Author Topic: Counting deaths  (Read 507 times)

0 Members and 1 Guest are viewing this topic.

pazuzu

  • Guest
Counting deaths
« on: 07 Apr 2005, 03:30:05 »
I'm making a mission in which I have several civilians. I want the mission to end if a certain number of civilians die but I dont want it to be any specific units just a certain number of any civ deaths to end mission.

How would I count how many civilians have died?

Thanks.

Offline Blanco

  • Former Staff
  • ****
Re:Counting deaths
« Reply #1 on: 07 Apr 2005, 07:21:04 »
This can be done via a killed EH and a variable.

In your init.sqs put :

Code: [Select]
Civdied = 0
Give all civilians a "killed" eventhandler

Code: [Select]
this addeventhandler ["killed",{civdied = civdied + 1}]
Then your End# trigger

Condition
Code: [Select]
civdied >= 10
When 10 civilians got killed the mission ends.  :)








« Last Edit: 07 Apr 2005, 07:27:29 by Blanco »
Search or search or search before you ask.

pazuzu

  • Guest
Re:Counting deaths
« Reply #2 on: 12 Apr 2005, 23:23:57 »
Hey thanks...

This worked perfectly.