You -caaan- also use the
rating command (I use it in my DSAI scripts to spot kills). It only increases naturally via kills. The caveat is, of course, that if you're using it for anything else (
addRating that is), it'll activate your script. ALSO, it's preciseness is a bit so-and-so, since you'd basically have to watch very closely for any changes all the time (i.e. waitUntil commands). Of course, the Rating command has the bonus of automatically scaling itself according to the rank and type of unit killed (more points for armor, higher ranking officers, more important units etc - it's how the ArmA AI keeps track of who to target first).
So from that perspective, eventhandlers will be considerably more resource friendly
However if you're -only- watching for kills from one unit (=the player) then I don't see how a single simple waitUntil could be -that- bad. But when it comes to whole squads of units and such, it might not be so good. Example (simple) code:
_unit = _this select 0;
while {alive _unit} do
{
_rating = rating _unit;
waitUntil ((rating _unit) > _rating};
// Add code here on what to do. I'll use Mandoble's example here. Note that "score to add" could as well be something like: ((rating _unit) - _rating) to get the difference in ratings (so that you get more score for more valuable targets etc).
_score_to_add = 100;
if (isNil "_var") then
{
_unit setVariable ["my_score", _score_to_add];
}
else
{
_unit setVariable ["my_score", (_unit getVariable "my_score") + _score_to_add];
};
sleep 0.02;
};
Untested, but should work
Good luck!
Wolfrug out.