Hello,
I've gotten this code from a friend, but it does't seem to add the action. Here is the code:
_loc = _this select 0;
_area = _this select 1;
_qty = _this select 2;
for "_i" from 1 to _qty step 1 do {
_animals = ["Fin","pastor"] call BIS_fnc_selectrandom;
_xpos = (getpos _loc select 0) + (random _area)-(_area/2);
_ypos = (getpos _loc select 1) + (random _area)-(_area/2);
animalSP = createAgent [_animals,[_xpos,_ypos,0], [], 0, "none"];
animalSP setdir random 360;
animalsp addeventhandler ["killed",{(_this select 0) addaction ["Gut " + typeof (_this select 0),"Gut.sqf"]}];
};
I put the code into a mission file, and call it. The animals spawn in, but when they die, it doesn't give the addaction.
Any help would be greatly appreciated.