Advertisement
Thatguy5532

Get all units for each side according to mods

Jul 29th, 2023 (edited)
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.27 KB | None | 0 0
  1. span class="re5"> TRA_data = [
  2.     [ [], [], [], [], [], [], [] ], //EAST
  3.     [ [], [], [], [], [], [], [] ], //WEST
  4.     [ [], [], [], [], [], [], [] ], //INDEPENDENT
  5.     [ [], [], [], [], [], [], [] ]  //CIVILIAN
  6. ];
  7.  
  8. // Returns True/False
  9. TRA_modCheck = {
  10.     params ["_class"];
  11.     private _mod = configSourceMod (configFile >> "CfgVehicles" >> configName _class);
  12.  
  13.     if (_mod in ["@RHSUSAF", "@RHSAFRF", "@RHSGREF"]) exitWith {
  14.         true
  15.     };
  16.     false
  17. };
  18.  
  19. {
  20.     if ( getNumber( _x >> "scope" ) isEqualTo 2 ) then {
  21.         _index = switch ( true ) do {
  22.             case ( configName _x isKindOf "CAManBase" ) : {
  23.                 0
  24.             };
  25.             case ( configName _x isKindOf "Car_F" ) : {
  26.                 1
  27.             };
  28.             case ( configName _x isKindOf "Tank" ) : {
  29.                 2
  30.             };
  31.             case ( configName _x isKindOf "Helicopter" ) : {
  32.                 3
  33.             };
  34.             case ( configName _x isKindOf "Plane" ) : {
  35.                 4
  36.             };
  37.             case ( configName _x isKindOf "Ship" ) : {
  38.                 5
  39.             };
  40.             case ( configName _x isKindOf "StaticWeapon" ) : {
  41.                 6
  42.             };
  43.             default{ -1 };
  44.         };
  45.  
  46.         if ( _index > -1 ) then {
  47.             _side = getNumber( _x >> "side" );
  48.             if ( _side in [ 0, 1, 2, 3 ] ) then {
  49.                 if (_x call TRA_modCheck) then {
  50.                     TRA_data select _side select _index pushBack configName _x;
  51.                 };
  52.             };
  53.         };
  54.     };
  55. }forEach ( "true" configClasses( configFile >> "CfgVehicles" ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement