Home   Help Search Login Register  

Author Topic: Who did it?  (Read 1086 times)

0 Members and 1 Guest are viewing this topic.

marcus3

  • Guest
Who did it?
« on: 15 Dec 2005, 18:47:12 »
i need a some code the check if the player killed a certan unit...more of a script that u would put in the init line..so u dont have to name everysingle unit :)
so help would be helpfull :D
thanks

Offline 456820

  • Contributing Member
  • **
Re:Who did it?
« Reply #1 on: 15 Dec 2005, 18:51:22 »
like this with a Killed EH

put this in the init line of the soldier you want to check who died
Code: [Select]
this AddEventHandler ["fired",{_this exec "check.sqs"}]
create check.sqs
and put this in it

Code: [Select]
_this select 0 : _deadguy
_this select 1 : _who

? _who == player : exit

#rest of script from below here

i beleive thats how it would be done
Check out the Event Handler tutorial here

Read that tut it also gives many cool things to add to missions

hope any of this helps

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Who did it?
« Reply #2 on: 15 Dec 2005, 19:03:48 »
Give the loon an eventhandler "killed".     If he is killed the script launched by the EH checks whether his killer was the player and enacts consequences accordingly.
Plenty of reviewed ArmA missions for you to play

marcus3

  • Guest
Re:Who did it?
« Reply #3 on: 15 Dec 2005, 19:21:55 »
Nvm i miss'd typ'd :)
thanks guys
#solve
« Last Edit: 15 Dec 2005, 19:26:57 by Big Boss Marcus »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Who did it?
« Reply #4 on: 15 Dec 2005, 19:27:14 »
It does work, you've just done something silly.    ;D  You're giving the game an object (like a unit) when its expecting an array.    We really need more detail before we can help you, but its the kind situation where, in extracting that information, you'll probably find the mistake yourself anyway.


Edit:  See!  ;D
« Last Edit: 15 Dec 2005, 19:27:36 by macguba »
Plenty of reviewed ArmA missions for you to play