OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Nico [BOS] on 02 Jan 2011, 14:50:14
-
Hi,
I'm working on a training mission for Single-player.
The player learns to fly an A-10 and shoot a ground target (a wreck) with GAU-8.
I would like calculate player's accuracy.
To reach that, I need to count how many shells have hit the target.
But I don't know how to proceed, do you ?
Thanks you :)
-
Here is the solution if someone is interested :
_target = _this select 0;
impacts = 0;
_target addEventHandler["HandleDamage",{
_level = _this select 2;
_shell = _this select 4;
if ((_level > 0.7) && (_shell isKindOf "B_30mmA10_AP")) then {
impacts = impacts + 1;
};
}];
if (true) exitWith {};nul=[YourTarget] execVM "YourScript.sqf"
-
Well done!
Thanks for sharing it here!
:good: