Useful console commands

Useful console commands

« posted: Jan 06, 2015, 05:41 PM »
Hi. I want to share some scripting commands that, I hope, will be useful for you.

Move object
Code: [Select]
_pos = getPosWorld cursorTarget; cursorTarget setPosWorld [(_pos select 0)-0, (_pos select 1)-0, (_pos select 2)-0];

Rotate object
Code: [Select]
_dir = getDir cursorTarget; cursorTarget setDir _dir+0.5;

Create exact same copy near the object
Code: [Select]
_pos = getPosWorld cursorTarget;
_vDir = vectorDir cursorTarget;
_vUp = vectorUp cursorTarget;
_obj = typeOf cursorTarget createVehicle _pos;
_obj allowDamage false;
_obj setVectorDirAndUp [_vDir,_vUp];
_obj setPosWorld [(_pos select 0)-5, (_pos select 1)-0, (_pos select 2)-0];

Create repeatable object (change -0 to real value (size of object))
Code: [Select]
for "_x" from 1 to 1 do {
_pos = getPosWorld cursorTarget;
_vDir = vectorDir cursorTarget;
_vUp = vectorUp cursorTarget;
_obj = typeOf cursorTarget createVehicle _pos;
_obj allowDamage false;
_obj setVectorDirAndUp [_vDir,_vUp];
_obj setPosWorld [(_pos select 0)-0*_x, (_pos select 1)-0*_x, (_pos select 2)+0];
}

Lock all cursor objects near you (500m)
Code: [Select]
{_x setVariable ["objectLocked",true,true]; _x setVariable ["ownerUID", getPlayerUID player, true]; } forEach (position player nearObjects [typeOf cursorTarget,500])

Delete all unlocked cursor objects
Code: [Select]
{if !(_x getVariable ["objectLocked",false]) then {deleteVehicle _x};} forEach (position player nearObjects [typeOf cursorTarget,500])

Remove all objects owned by player with ID in 500m range
Code: [Select]
{if (_x getVariable ["ownerUID",""]=="76561198088088293") then {deleteVehicle _x};} forEach (position player nearObjects ["All",500])

Give money to each player
Code: [Select]
{
if (isPlayer _x) then {
_cmoney = _x getVariable ["cmoney",0];
_x setVariable ["cmoney",_cmoney+1000,true]; 
}
} forEach playableUnits;

Give money to exact player
Code: [Select]
{   
if (isPlayer _x && (name _x=="USER")) then {   
_cmoney = _x getVariable ["cmoney",0];   
_x setVariable ["cmoney",_cmoney+1000,true];     

} forEach playableUnits;

Teleport self to player
Code: [Select]
{   
if (isPlayer _x && (name _x=="USER")) then {   
          player setPos (position _x);

} forEach playableUnits;

Teleport player to self
Code: [Select]
{   
if (isPlayer _x && (name _x=="USER")) then {   
          _x setPos (position player);

} forEach playableUnits;

Re: Useful console commands

« Reply #1 posted: Jan 06, 2015, 08:29 PM »
Thank you very much.  :)

Re: Useful console commands

« Reply #2 posted: Jan 10, 2015, 12:49 AM »
And some more. Well, I decided to change all prices on my server, but not just "as I want it to be", but with some maths there. I created script that does this calculations depending on class of vehicle and amount of weapons they carry. Hope it will be useful to you.

Code: [Select]
_getWeaponPrice = {
  _weaponPrice = 0;
  _mm = 25;
  _HE_Modif = 1;
  _MP_Modif = 1;
  _APDS_Modif = 1;
  _GPR_Modif = 1;
  _LG_Modif = 1;
  _APFSDS_Modif = 1.25;
  _HEAT_Modif = 1;
  _Splash_Modif = 1.25;
  _G_Modif = 2.5;
  _NonCombat_Modif = 0.20;
 
  switch (_this) do {   
    case ("200Rnd_65x39_Belt") : {_weaponPrice = 200*100};
    case ("200Rnd_65x39_Belt_Tracer_Red") : {_weaponPrice = 200*100};
    case ("200Rnd_65x39_Belt_Tracer_Green") : {_weaponPrice = 200*100};
    case ("200Rnd_65x39_Belt_Tracer_Yellow") : {_weaponPrice = 200*100};
    case ("1000Rnd_65x39_Belt") : {_weaponPrice = 1000*100};
    case ("1000Rnd_65x39_Belt_Tracer_Red") : {_weaponPrice = 1000*100};
    case ("1000Rnd_65x39_Belt_Green") : {_weaponPrice = 1000*100};
    case ("1000Rnd_65x39_Belt_Tracer_Green") : {_weaponPrice = 1000*100};
    case ("1000Rnd_65x39_Belt_Yellow") : {_weaponPrice = 1000*100};
    case ("1000Rnd_65x39_Belt_Tracer_Yellow") : {_weaponPrice = 1000*100};
    case ("2000Rnd_65x39_Belt") : {_weaponPrice = 2000*100};
    case ("2000Rnd_65x39_belt") : {_weaponPrice = 2000*100};
    case ("2000Rnd_65x39_Belt_Tracer_Red") : {_weaponPrice = 2000*100};
    case ("2000Rnd_65x39_belt_Tracer_Red") : {_weaponPrice = 2000*100};
    case ("2000Rnd_65x39_Belt_Green") : {_weaponPrice = 2000*100};
    case ("2000Rnd_65x39_Belt_Tracer_Green") : {_weaponPrice = 2000*100};
    case ("2000Rnd_65x39_Belt_Tracer_Green_Splash") : {_weaponPrice = 2000*100*_Splash_Modif};
    case ("2000Rnd_65x39_Belt_Yellow") : {_weaponPrice = 2000*100};
    case ("2000Rnd_65x39_Belt_Tracer_Yellow") : {_weaponPrice = 2000*100};
    case ("2000Rnd_65x39_Belt_Tracer_Yellow_Splash") : {_weaponPrice = 2000*100*_Splash_Modif};
   
    case ("5000Rnd_762x51_Belt") : {_weaponPrice = 5000*125};
    case ("5000Rnd_762x51_Yellow_Belt") : {_weaponPrice = 5000*125};
    case ("1000Rnd_762x51_Belt_Yellow") : {_weaponPrice = 1000*125};
    case ("2000Rnd_762x51_Belt_Green") : {_weaponPrice = 2000*125};
    case ("2000Rnd_762x51_Belt_Yellow") : {_weaponPrice = 2000*125};
   
    case ("500Rnd_127x99_mag") : {_weaponPrice = 500*200};                             
    case ("500Rnd_127x99_mag_Tracer_Red") : {_weaponPrice = 500*200};
    case ("500Rnd_127x99_mag_Tracer_Green") : {_weaponPrice = 500*200};
    case ("500Rnd_127x99_mag_Tracer_Yellow") : {_weaponPrice = 500*200};
    case ("200Rnd_127x99_mag") : {_weaponPrice = 200*200};                             
    case ("200Rnd_127x99_mag_Tracer_Red") : {_weaponPrice = 200*200};
    case ("200Rnd_127x99_mag_Tracer_Green") : {_weaponPrice = 200*200};
    case ("200Rnd_127x99_mag_Tracer_Yellow") : {_weaponPrice = 200*200};
    case ("100Rnd_127x99_mag") : {_weaponPrice = 100*200};
    case ("100Rnd_127x99_mag_Tracer_Red") : {_weaponPrice = 100*200};
    case ("100Rnd_127x99_mag_Tracer_Green") : {_weaponPrice = 100*200};
    case ("100Rnd_127x99_mag_Tracer_Yellow") : {_weaponPrice = 100*200};
   
    case ("450Rnd_127x108_Ball") : {_weaponPrice = 450*210};                   
    case ("150Rnd_127x108_Ball") : {_weaponPrice = 150*210};
    case ("50Rnd_127x108_Ball") : {_weaponPrice = 50*210};
   
    case ("200Rnd_40mm_G_belt") : {_weaponPrice = 200*40*_mm*_G_Modif};
    case ("96Rnd_40mm_G_belt") : {_weaponPrice = 96*40*_mm*_G_Modif};
    case ("64Rnd_40mm_G_belt") : {_weaponPrice = 64*40*_mm*_G_Modif};
    case ("32Rnd_40mm_G_belt") : {_weaponPrice = 32*40*_mm*_G_Modif};
   
    case ("200Rnd_20mm_G_belt") : {_weaponPrice = 200*20*_mm*_G_Modif};
    case ("40Rnd_20mm_G_belt") : {_weaponPrice = 40*20*_mm*_G_Modif};
    case ("40Rnd_20mm_g_belt") : {_weaponPrice = 40*20*_mm*_G_Modif};
   
    case ("24Rnd_PG_missiles") : {_weaponPrice = 24*5000};
    case ("12Rnd_PG_missiles") : {_weaponPrice = 12*5000};
   
    case ("24Rnd_missiles") : {_weaponPrice = 24*5000};
    case ("12Rnd_missiles") : {_weaponPrice = 12*5000};
   
    case ("32Rnd_155mm_Mo_shells") : {_weaponPrice = 32*155*_mm};
   
    case ("8Rnd_82mm_Mo_shells") : {_weaponPrice = 8*82*_mm};
    case ("8Rnd_82mm_Mo_Flare_white") : {_weaponPrice = 8*82*_mm*_NonCombat_Modif};
    case ("8Rnd_82mm_Mo_Smoke_white") : {_weaponPrice = 8*82*_mm*_NonCombat_Modif};
    case ("8Rnd_82mm_Mo_guided") : {_weaponPrice = 8*82*_mm};
    case ("8Rnd_82mm_Mo_LG") : {_weaponPrice = 8*82*_mm};
   
    case ("6Rnd_155mm_Mo_smoke") : {_weaponPrice = 6*155*_mm*_NonCombat_Modif};
    case ("2Rnd_155mm_Mo_guided") : {_weaponPrice = 2*155*_mm};
    case ("2Rnd_155mm_Mo_LG") : {_weaponPrice = 2*155*_mm};
    case ("6Rnd_155mm_Mo_mine") : {_weaponPrice = 6*155*_mm};
    case ("6Rnd_155mm_Mo_AT_mine") : {_weaponPrice = 6*155*_mm};
    case ("2Rnd_155mm_Mo_Cluster") : {_weaponPrice = 2*155*_mm};
   
    case ("300Rnd_20mm_shells") : {_weaponPrice = 300*20*_mm};
    case ("1000Rnd_20mm_shells") : {_weaponPrice = 1000*20*_mm};
    case ("2000Rnd_20mm_shells") : {_weaponPrice = 2000*20*_mm};
   
    case ("300Rnd_25mm_shells") : {_weaponPrice = 300 * 25*_mm};
    case ("1000Rnd_25mm_shells") : {_weaponPrice = 1000 * 25*_mm};
   
    case ("250Rnd_30mm_HE_shells") : {_weaponPrice = 250*30*_mm*_HE_Modif};
    case ("250Rnd_30mm_HE_shells_Tracer_Red") : {_weaponPrice = 250*30*_mm*_HE_Modif};
    case ("250Rnd_30mm_HE_shells_Tracer_Green") : {_weaponPrice = 250*30*_mm*_HE_Modif};
    case ("250Rnd_30mm_APDS_shells") : {_weaponPrice = 250*30*_mm*_APDS_Modif};
    case ("250Rnd_30mm_APDS_shells_Tracer_Red") : {_weaponPrice = 250*30*_mm*_APDS_Modif};
    case ("250Rnd_30mm_APDS_shells_Tracer_Green") : {_weaponPrice = 250*30*_mm*_APDS_Modif};
    case ("250Rnd_30mm_APDS_shells_Tracer_Yellow") : {_weaponPrice = 250*30*_mm*_APDS_Modif};
    case ("140Rnd_30mm_MP_shells") : {_weaponPrice = 140*30*_mm*_MP_Modif};
    case ("140Rnd_30mm_MP_shells_Tracer_Red") : {_weaponPrice = 140*30*_mm*_MP_Modif};
    case ("140Rnd_30mm_MP_shells_Tracer_Green") : {_weaponPrice = 140*30*_mm*_MP_Modif};
    case ("140Rnd_30mm_MP_shells_Tracer_Yellow") : {_weaponPrice = 140*30*_mm*_MP_Modif};
    case ("60Rnd_30mm_APFSDS_shells") : {_weaponPrice = 60*30*_mm*_APFSDS_Modif};
    case ("60Rnd_30mm_APFSDS_shells_Tracer_Red") : {_weaponPrice = 60*30*_mm*_APFSDS_Modif};
    case ("60Rnd_30mm_APFSDS_shells_Tracer_Green") : {_weaponPrice = 60*30*_mm*_APFSDS_Modif};
    case ("60Rnd_30mm_APFSDS_shells_Tracer_Yellow") : {_weaponPrice = 60*30*_mm*_APFSDS_Modif};
   
    case ("60Rnd_40mm_GPR_shells") : {_weaponPrice = 60*40*_mm*_GPR_Modif};
    case ("60Rnd_40mm_GPR_Tracer_Red_shells") : {_weaponPrice = 60*40*_mm*_GPR_Modif};
    case ("60Rnd_40mm_GPR_Tracer_Green_shells") : {_weaponPrice = 60*40*_mm*_GPR_Modif};
    case ("60Rnd_40mm_GPR_Tracer_Yellow_shells") : {_weaponPrice = 60*40*_mm*_GPR_Modif};
    case ("40Rnd_40mm_APFSDS_shells") : {_weaponPrice = 40*40*_mm*_APFSDS_Modif};
    case ("40Rnd_40mm_APFSDS_Tracer_Red_shells") : {_weaponPrice = 40*40*_mm*_APFSDS_Modif};
    case ("40Rnd_40mm_APFSDS_Tracer_Green_shells") : {_weaponPrice = 40*40*_mm*_APFSDS_Modif};
    case ("40Rnd_40mm_APFSDS_Tracer_Yellow_shells") : {_weaponPrice = 40*40*_mm*_APFSDS_Modif};
   
    case ("8Rnd_LG_scalpel") : {_weaponPrice = 8*100000*_LG_Modif};
    case ("6Rnd_LG_scalpel") : {_weaponPrice = 6*100000*_LG_Modif};
    case ("2Rnd_LG_scalpel") : {_weaponPrice = 2*100000*_LG_Modif};
    case ("2Rnd_LG_scalpel_hidden") : {_weaponPrice = 2*100000*_LG_Modif};
   
    case ("14Rnd_80mm_rockets") : {_weaponPrice = 14*80*_mm};
    case ("38Rnd_80mm_rockets") : {_weaponPrice = 38*80*_mm};
   
    case ("12Rnd_230mm_rockets") : {_weaponPrice = 12*230*_mm*3};
   
    case ("2Rnd_AAA_missiles") : {_weaponPrice = 2*100000};
    case ("2Rnd_AAA_missiles_MI02") : {_weaponPrice = 2*120000};
    case ("4Rnd_AAA_missiles") : {_weaponPrice = 4*100000};
    case ("4Rnd_AAA_missiles_MI02") : {_weaponPrice = 4*120000};
    case ("4Rnd_GAA_missiles") : {_weaponPrice = 4*100000};
    case ("4Rnd_Titan_long_missiles") : {_weaponPrice = 4*100000};
    case ("5Rnd_GAT_missiles") : {_weaponPrice = 5*100000};
    case ("2Rnd_GAT_missiles") : {_weaponPrice = 2*100000};
   
    case ("30Rnd_120mm_HE_shells") : {_weaponPrice = 30*120*_mm*_HE_Modif};
    case ("30Rnd_120mm_HE_shells_Tracer_Red") : {_weaponPrice = 30*120*_mm*_HE_Modif};
    case ("30Rnd_120mm_HE_shells_Tracer_Green") : {_weaponPrice = 30*120*_mm*_HE_Modif};
    case ("30Rnd_120mm_HE_shells_Tracer_Yellow") : {_weaponPrice = 30*120*_mm*_HE_Modif};
    case ("16Rnd_120mm_HE_shells") : {_weaponPrice = 16*120*_mm*_HE_Modif};
    case ("16Rnd_120mm_HE_shells_Tracer_Red") : {_weaponPrice = 16*120*_mm*_HE_Modif};
    case ("16Rnd_120mm_HE_shells_Tracer_Green") : {_weaponPrice = 16*120*_mm*_HE_Modif};
    case ("16Rnd_120mm_HE_shells_Tracer_Yellow") : {_weaponPrice = 16*120*_mm*_HE_Modif};
    case ("30Rnd_120mm_APFSDS_shells") : {_weaponPrice = 30*120*_mm*_APFSDS_Modif};
    case ("30Rnd_120mm_APFSDS_shells_Tracer_Red") : {_weaponPrice = 30*120*_mm*_APFSDS_Modif};
    case ("30Rnd_120mm_APFSDS_shells_Tracer_Green") : {_weaponPrice = 30*120*_mm*_APFSDS_Modif};
    case ("30Rnd_120mm_APFSDS_shells_Tracer_Yellow") : {_weaponPrice = 30*120*_mm*_APFSDS_Modif};
    case ("32Rnd_120mm_APFSDS_shells") : {_weaponPrice = 32*120*_mm*_APFSDS_Modif};
    case ("32Rnd_120mm_APFSDS_shells_Tracer_Red") : {_weaponPrice = 32*120*_mm*_APFSDS_Modif};
    case ("32Rnd_120mm_APFSDS_shells_Tracer_Green") : {_weaponPrice = 32*120*_mm*_APFSDS_Modif};
    case ("32Rnd_120mm_APFSDS_shells_Tracer_Yellow") : {_weaponPrice = 32*120*_mm*_APFSDS_Modif};
   
    case ("680Rnd_35mm_AA_shells") : {_weaponPrice = 680*35*_mm};
    case ("680Rnd_35mm_AA_shells_Tracer_Red") : {_weaponPrice = 680*35*_mm};
    case ("680Rnd_35mm_AA_shells_Tracer_Green") : {_weaponPrice = 680*35*_mm};
    case ("680Rnd_35mm_AA_shells_Tracer_Yellow") : {_weaponPrice = 680*35*_mm};
   
    case ("6Rnd_AAT_missiles") : {_weaponPrice = 6*50000};
    case ("4Rnd_AAT_missiles") : {_weaponPrice = 4*50000};
    case ("1Rnd_GAA_missiles") : {_weaponPrice = 1*50000};
    case ("1Rnd_GAT_missiles") : {_weaponPrice = 1*50000};
    case ("2Rnd_GBU12_LGB") : {_weaponPrice = 2*150000};
    case ("2Rnd_GBU12_LGB_MI10") : {_weaponPrice = 2*150000};

    case ("14Rnd_120mm_HE_shells") : {_weaponPrice = 14 * 120 * _mm *_HE_Modif};
    case ("14Rnd_120mm_HE_shells_Tracer_Red") : {_weaponPrice = 14 * 120 * _mm *_HE_Modif};
    case ("14Rnd_120mm_HE_shells_Tracer_Green") : {_weaponPrice = 14 * 120 * _mm *_HE_Modif};
    case ("14Rnd_120mm_HE_shells_Tracer_Yellow") : {_weaponPrice = 14 * 120 * _mm *_HE_Modif};
   
    case ("28Rnd_120mm_APFSDS_shells") : {_weaponPrice = 28 * 120 * _mm *_APFSDS_Modif};
    case ("28Rnd_120mm_APFSDS_shells_Tracer_Red") : {_weaponPrice = 28 * 120 * _mm *_APFSDS_Modif};
    case ("28Rnd_120mm_APFSDS_shells_Tracer_Green") : {_weaponPrice = 28 * 120 * _mm *_APFSDS_Modif};
    case ("28Rnd_120mm_APFSDS_shells_Tracer_Yellow") : {_weaponPrice = 28 * 120 * _mm *_APFSDS_Modif};
   
    case ("12Rnd_125mm_HE") : {_weaponPrice = 12 * 125 * _mm *_HE_Modif};
    case ("12Rnd_125mm_HE_T_Red") : {_weaponPrice = 12 * 125 * _mm *_HE_Modif};
    case ("12Rnd_125mm_HE_T_Green") : {_weaponPrice = 12 * 125 * _mm *_HE_Modif};
    case ("12Rnd_125mm_HE_T_Yellow") : {_weaponPrice = 12 * 125 * _mm *_HE_Modif};
   
    case ("24Rnd_125mm_APFSDS") : {_weaponPrice = 24 * 125 * _mm *_APFSDS_Modif};
    case ("24Rnd_125mm_APFSDS_T_Yellow") : {_weaponPrice = 24 * 125 * _mm *_APFSDS_Modif};
    case ("24Rnd_125mm_APFSDS_T_Green") : {_weaponPrice = 24 * 125 * _mm *_APFSDS_Modif};
    case ("24Rnd_125mm_APFSDS_T_Red") : {_weaponPrice = 24 * 125 * _mm *_APFSDS_Modif};

    case ("12Rnd_125mm_HEAT") : {_weaponPrice = 12 * 125 * _mm *_HEAT_Modif};
    case ("12Rnd_125mm_HEAT_T_Red") : {_weaponPrice = 12 * 125 * _mm *_HEAT_Modif};
    case ("12Rnd_125mm_HEAT_T_Green") : {_weaponPrice = 12 * 125 * _mm *_HEAT_Modif};
    case ("12Rnd_125mm_HEAT_T_Yellow") : {_weaponPrice = 12 * 125 * _mm *_HEAT_Modif};
   
    case ("1000Rnd_Gatling_30mm_Plane_CAS_01_F") : {_weaponPrice = 1000 * 30 * _mm};
    case ("2Rnd_Missile_AA_04_F") : {_weaponPrice = 2*50000};
    case ("6Rnd_Missile_AGM_02_F") : {_weaponPrice = 6*50000};
    case ("7Rnd_Rocket_04_HE_F") : {_weaponPrice = 7*30000};
    case ("7Rnd_Rocket_04_AP_F") : {_weaponPrice = 7*30000};
    case ("4Rnd_Bomb_04_F") : {_weaponPrice = 4*150000};
   
    case ("500Rnd_Cannon_30mm_Plane_CAS_02_F") : {_weaponPrice = 500*30*_mm};
    case ("2Rnd_Missile_AA_03_F") : {_weaponPrice = 2*50000};
    case ("4Rnd_Missile_AGM_01_F") : {_weaponPrice = 4*50000};
    case ("20Rnd_Rocket_03_HE_F") : {_weaponPrice = 20*30000};
    case ("20Rnd_Rocket_03_AP_F") : {_weaponPrice = 20*30000};
    case ("2Rnd_Bomb_03_F") : {_weaponPrice = 2*150000};
   
    case ("40Rnd_105mm_APFSDS") : {_weaponPrice = 40*105*_mm*_APFSDS_Modif};
    case ("40Rnd_105mm_APFSDS_T_Red") : {_weaponPrice = 40*105*_mm*_APFSDS_Modif};
    case ("40Rnd_105mm_APFSDS_T_Green") : {_weaponPrice = 40*105*_mm*_APFSDS_Modif};
    case ("40Rnd_105mm_APFSDS_T_Yellow") : {_weaponPrice = 40*105*_mm*_APFSDS_Modif};
   
    case ("20Rnd_105mm_HEAT_MP") : {_weaponPrice = 40*105*_mm*_HEAT_Modif};
    case ("20Rnd_105mm_HEAT_MP_T_Red") : {_weaponPrice = 40*105*_mm*_HEAT_Modif};
    case ("20Rnd_105mm_HEAT_MP_T_Green") : {_weaponPrice = 40*105*_mm*_HEAT_Modif};
    case ("20Rnd_105mm_HEAT_MP_T_Yellow") : {_weaponPrice = 40*105*_mm*_HEAT_Modif};
   
    case ("SmokeLauncherMag") : {_weaponPrice = 10000};
    case ("SmokeLauncherMag_boat") : {_weaponPrice = 10000};
   
    case ("120Rnd_CMFlare_Chaff_Magazine") : {_weaponPrice = 120*500};
    case ("168Rnd_CMFlare_Chaff_Magazine") : {_weaponPrice = 168*500};
    case ("192Rnd_CMFlare_Chaff_Magazine") : {_weaponPrice = 192*500};
    case ("240Rnd_CMFlare_Chaff_Magazine") : {_weaponPrice = 240*500};
   
    case ("Laserbatteries") : {_weaponPrice = 25000};
    case ("FakeWeapon") : {_weaponPrice = 0};
   
    default {diag_log format ["%1 has no price",_this]};
  };
  (_weaponPrice);
};
diag_log format ["::::::::::::::::::::::::::::"];
{
  _x = _x select 1;
  _class = _x;
  _weaponsArray=[];
  {
    _weaponsArray pushBack _x;
  } forEach (getArray(configfile >> "CfgVehicles" >> _x >> "magazines"));
 
 
  _turrets = (configfile >> "CfgVehicles" >> _x >> "Turrets" ) call BIS_fnc_getCfgSubClasses;
       
  {
    {
      _weaponsArray pushBack _x;
    } forEach (getArray(configfile >> "CfgVehicles" >> _class >> "Turrets" >> _x >> "magazines")); 
  } forEach _turrets; 
 
  _parents = ([(configFile >> "CfgVehicles" >> _x),true ] call BIS_fnc_returnParents);
   
  _price = 2000;
 
  switch (true) do {
    case ("Kart_01_Base_F" in _parents): {_price = 2000};
    case ("Quadbike_01_base_F" in _parents): {_price = 5000};
    case ("Hatchback_01_base_F" in _parents): {_price = 5000};
    case ("SUV_01_base_F" in _parents): {_price = 7500};
    case ("Offroad_01_base_F" in _parents): {
      _price = 8500;
      if (_x == "C_Offroad_01_repair_F") then {_price = _price*2};
    };
    case ("Van_01_base_F" in _parents): {
      _price = 8500;
      if ("C_Van_01_box_F" in _parents) then {_price = 10000};
      if ("C_Van_01_fuel_F" in _parents || "B_G_Van_01_fuel_F" in _parents) then {_price = 18500};
    };
    case ("Truck_01_base_F" in _parents || "Truck_03_base_F" in _parents || "Truck_02_base_F" in _parents): {
      _price = 15000;
      if ("B_Truck_01_box_F" in _parents || "O_Truck_03_box_F" in _parents || "I_Truck_02_box_F" in _parents) then {_price = 55000};
      if ("B_Truck_01_fuel_F" in _parents || "O_Truck_03_fuel_F" in _parents || "I_Truck_02_fuel_F" in _parents) then {_price = 55000};
      if ("B_Truck_01_medical_F" in _parents || "O_Truck_03_medical_F" in _parents || "I_Truck_02_medical_F" in _parents ) then {_price = 55000};
      if ("B_Truck_01_Repair_F" in _parents || "O_Truck_03_repair_F" in _parents|| "I_Truck_02_repair_F" in _parents) then {_price = 55000};
      if ("B_Truck_01_ammo_F" in _parents || "O_Truck_03_ammo_F" in _parents || "I_Truck_02_ammo_F" in _parents) then {_price = 55000};
    };
    case ("UGV_01_base_F" in _parents): {_price = 15000};   
    case ("MRAP_01_base_F" in _parents || "MRAP_02_base_F" in _parents || "MRAP_03_base_F" in _parents): {_price = 25000};
    case ("Wheeled_APC_F" in _parents): {_price = 35000};
    case ("Tank_F" in _parents): {_price = 75000};
    case ("Helicopter" in _parents): {_price = 50000};
    case ("Plane" in _parents): {_price = 100000};
    case ("Ship" in _parents): {_price = 10000};
  };
 
  {
    _price = _price + (_x call _getWeaponPrice);
  } forEach _weaponsArray;
  diag_log format ["Calculated price for %1 is %2. It has %3 weapons.",_x,_price, count(_weaponsArray)];
  if (count(_weaponsArray)>0) then {
    diag_log format ["Weapons for %1 : %2",_x,_weaponsArray];
  };
 
 
} forEach (call staticGunsArray);
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: Useful console commands

« Reply #3 posted: Jan 17, 2015, 05:04 PM »
Used your teleport to player and teleport player to me in my admin menu :)
https://github.com/LouDnl/ArmA3_Wasteland.Altis/commit/c1d7525aaa68eee14f5d348cca0e8157feb7f411
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: Useful console commands

« Reply #4 posted: Feb 20, 2015, 09:04 PM »
Set sticky
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: Useful console commands

« Reply #5 posted: Apr 14, 2015, 09:12 AM »
Post locked.

Got any new additions? Send em to me in a private message and I will add them to the post.