OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Gruntage on 19 Feb 2010, 17:48:04
-
G'day all
For some reason when i execute setdamage from the init of a unit like this:
this setdamage -10
and then put this in front:
this addeventhandler ["hit", {this setdamage -10}];
i get an error 'type bool expected object' whenever i shoot the unit. Why does this happen ??? Ive tried it on other units on different maps and i dont get an error.
Im using an addon island do some commands not work on addon islands?
Thx in advance
Gruntage
-
Damage goes from 0 to 1, 0 being no damage and 1 being full damage.
http://www.ofpec.com/COMREF/index.php?action=details&id=291&game=All
Planck
-
in arma setdammage can have negative values as well.
-
Because there is no "this" inside the eventhandler, but rather a local _this which is an array that contains all the data for the eventhandler (who was hit, who hit him, the amount of damage, I think):
this addeventhandler ["hit", {(_this select 0) setdamage -10}];
That should work. :good:
Wolfrug out.