Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: Calculate accuracy of GAU-8 shot.  (Read 1870 times)

0 Members and 1 Guest are viewing this topic.

Offline Nico [BOS]

  • Members
  • *
    • Communauté Francophone ArmA
Calculate accuracy of GAU-8 shot.
« 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  :)

Offline Nico [BOS]

  • Members
  • *
    • Communauté Francophone ArmA
Re: Calculate accuracy of GAU-8 shot.
« Reply #1 on: 18 Jan 2011, 06:17:13 »
Here is the solution if someone is interested :

Code: [Select]
_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"

Offline fleepee

  • Members
  • *
  • Enter the Matrix!
Re: Calculate accuracy of GAU-8 shot.
« Reply #2 on: 18 Jan 2011, 19:08:01 »
Well done!
Thanks for sharing it here!
 :good: