Home   Help Search Login Register  

Author Topic: someone killed by player  (Read 504 times)

0 Members and 1 Guest are viewing this topic.

j-man

  • Guest
someone killed by player
« on: 31 Dec 2003, 05:52:03 »
Is it possible to detect if any has been killed by the player ???

Preferably using triggers.

m21man

  • Guest
Re:someone killed by player
« Reply #1 on: 31 Dec 2003, 06:51:23 »
Add this to a unit's init field:
Code: [Select]
this addeventhandler ["killed",{_this exec "checker.sqs"}]
Now for the checker script:
Code: [Select]
_killer = _this select 1
?(_killer == player): goto "Results"
exit

#Results
;Put results in here
exit

j-man

  • Guest
Re:someone killed by player
« Reply #2 on: 31 Dec 2003, 07:20:47 »
That's just what I need :D

Is it possible to do that without having to put something in every units init field ???
« Last Edit: 31 Dec 2003, 07:22:29 by j-man »

m21man

  • Guest
Re:someone killed by player
« Reply #3 on: 31 Dec 2003, 08:28:55 »
Maybe in the group leader's init field?
Code: [Select]
"_x addeventhandler ["killed", {_this exec "checker.sqs"}]" forEach units group thisThe syntax here is definitely not guaranteed ::) .

j-man

  • Guest
Re:someone killed by player
« Reply #4 on: 31 Dec 2003, 09:34:15 »
Thanks :D

You first suggestion works fine ;D