Home   Help Search Login Register  

Author Topic: Who killed that civ? Punish him!  (Read 678 times)

0 Members and 1 Guest are viewing this topic.

Offline Blanco

  • Former Staff
  • ****
Who killed that civ? Punish him!
« on: 21 Dec 2002, 06:42:26 »
In my mission the action takes place in a town and it's full of harmless civilians. If one of the players kills a civ he has to die or cripple.
How can I detect who killed that civ? (there are 10 civs)

I saw somewhere a thread about a TeamKiller script with that new Addeventhandle thingy from Resistance. It detects who killed a teammate, So I guess it can detect who killed that civ too... :-\
But...
I don't understand "addeventhandle"... Is there somwhere a tuto?
What's the use of that command??  ???

thx in advance

Search or search or search before you ask.

Offline Blanco

  • Former Staff
  • ****
Re:Who killed that civ? Punish him!
« Reply #1 on: 22 Dec 2002, 04:34:54 »
Heloo-o

Nobody? :'(
Search or search or search before you ask.

micropilot

  • Guest
Re:Who killed that civ? Punish him!
« Reply #2 on: 22 Dec 2002, 07:51:04 »
OK,

I'll give this a try!

SETUP

Place a west soldier as player, Place a west soldier and name him s2, Place a civilian  and name him c1 - in his init line put c1 addEventHandler ["killed",{s2 dofire (_this select 1)}]

RESULT

Upon the player killing the civilian, s2 will find and shoot player!!  Give s2 some time because if he isn't facing the player he will slowly look around for him, but once he sees you he fires and makes SURE that you are dead!!!

Offline Blanco

  • Former Staff
  • ****
Re:Who killed that civ? Punish him!
« Reply #3 on: 22 Dec 2002, 17:31:40 »
Thx, for reply micropilot

I think I asked my Q wrong.

I don't want a civ to kill or cripple me, it's like the hand of God that do that, it's not a realistic mission.
It's a MP mission where civs are all around the battle and now the mission stops (for everyone who's playing) when one of the 10 unarmed civ is killed by any player (WEST or RES). I want the KILLER punished in stead of aborting the whole mission for everyone
For that I need to know WHO killed that civ...

Can I use addeventhandle? I think it's a powerfull command BIS gave us, but I don't understand it.
Is there someone who released a tuto about it? (with example mission)

Bad English I know...

Anyway, thx for reply, I apriciate it. ;)

 




Search or search or search before you ask.

micropilot

  • Guest
Re:Who killed that civ? Punish him!
« Reply #4 on: 22 Dec 2002, 20:23:10 »
OK,

Put this code inbetween the curly Braces{}:

(_this select 1) setdammage 1

This will kill whoever killed the civilian. I was just getting a little fancy with my example!!