OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Terox on 24 May 2003, 10:19:38
-
player addeventhandler [{Killed},
or
player addeventhandler [{hit},
*****************************************************************
:gunman:Please tell me if my understanding of these eventhandlers is correct!
******************************************************************
In both cases, when the event occurs, an array containing 2 elements is created locally on the "Damaged" players machine
select 0 is the damaged player
select 1 is the player doing the damage
**********************************************************************
Just some clarification please.
Thx in advance
******************************************************************
-
I know for sure about the "killed" handler.
_this select 0 is player
_this select 1 is killer
Interesting thing. If you kill yourself, then you are the killer. If you are killed by a shell or mine,etc then the killer is null.
_killer=_this select 1
hint format ["%1",name _killer]
will equal "Error: No Vehicle" or something like this.
I assume "hit" works in a similar way. :)
-
"Hit"
done some testing on this
Hit only works iff player is wounded, if player is killed then it doesnt see this as a "hit" event
try it, shoot a player in the leg, then wound him some more, have a hint box activated each time, when the player is killed on the addeventhandler "hit" the hint box wont show
-
also beware that a hit event handler can activate multiple times on one shot iff different hitboxes get hit.