Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.35 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. File: fn_garageLBChange.sqf
  4. Author: Bryan "Tonic" Boardwine
  5.  
  6. Description:
  7. Can't be bothered to answer it.. Already deleted it by accident..
  8. */
  9. disableSerialization;
  10. private ["_control","_index","_className","_classNameLife","_dataArr","_vehicleColor","_vehicleInfo","_trunkSpace","_sellPrice","_retrievePrice","_sellMultiplier","_price","_storageFee","_purchasePrice"];
  11. _control = _this select 0;
  12. _index = _this select 1;
  13.  
  14. //Fetch some information.
  15. _dataArr = CONTROL_DATAI(_control,_index);
  16. _dataArr = call compile format ["%1",_dataArr];
  17. _className = (_dataArr select 0);
  18. _classNameLife = _className;
  19.  
  20. if (!isClass (missionConfigFile >> "LifeCfgVehicles" >> _classNameLife)) then {
  21. _classNameLife = "Default"; //Use Default class if it doesn't exist
  22. diag_log format ["%1: LifeCfgVehicles class doesn't exist",_className];
  23. };
  24.  
  25. _vehicleColor = ((M_CONFIG(getArray,"LifeCfgVehicles",_classNameLife,"textures") select (_dataArr select 1)) select 0);
  26. if (isNil "_vehicleColor") then {_vehicleColor = "Default";};
  27.  
  28. _vehicleInfo = [_className] call life_fnc_fetchVehInfo;
  29. _trunkSpace = [_className] call life_fnc_vehicleWeightCfg;
  30.  
  31. _price = M_CONFIG(getNumber,"LifeCfgVehicles",_classNameLife,"price");
  32. _storageFee = LIFE_SETTINGS(getNumber,"vehicle_storage_fee_multiplier");
  33.  
  34. _insuranceMultiplier = 0.2;
  35. _insurance = (_dataArr select 2);
  36. switch (playerSide) do {
  37. case civilian: {
  38. _purchasePrice = _price * LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_CIVILIAN");
  39. _sellMultiplier = LIFE_SETTINGS(getNumber,"vehicle_sell_multiplier_CIVILIAN");
  40. _insuranceMultiplier = LIFE_SETTINGS(getNumber,"vehicle_insurance_multiplier_CIVILIAN");
  41. };
  42. case west: {
  43. _purchasePrice = _price * LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_COP");
  44. _sellMultiplier = LIFE_SETTINGS(getNumber,"vehicle_sell_multiplier_COP");
  45. _insuranceMultiplier = LIFE_SETTINGS(getNumber,"vehicle_insurance_multiplier_COP");
  46. };
  47. case independent: {
  48. _purchasePrice = _price * LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_MEDIC");
  49. _sellMultiplier = LIFE_SETTINGS(getNumber,"vehicle_sell_multiplier_MEDIC");
  50. _insuranceMultiplier = LIFE_SETTINGS(getNumber,"vehicle_insurance_multiplier_MEDIC");
  51. };
  52. case east: {
  53. _purchasePrice = _price * LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_OPFOR");
  54. _sellMultiplier = LIFE_SETTINGS(getNumber,"vehicle_sell_multiplier_OPFOR");
  55. _insuranceMultiplier = LIFE_SETTINGS(getNumber,"vehicle_insurance_multiplier_OPFOR");
  56. };
  57. };
  58. _retrievePrice = _purchasePrice * _storageFee;
  59. _sellPrice = _purchasePrice * _sellMultiplier;
  60. _insurancePrice = _purchasePrice * _insuranceMultiplier;
  61.  
  62. if (!(_sellPrice isEqualType 0) || _sellPrice < 1) then {_sellPrice = 500;};
  63. if (!(_retrievePrice isEqualType 0) || _retrievePrice < 1) then {_retrievePrice = 500;};
  64. if (!(_insurancePrice isEqualType 0) || _insurancePrice < 1) then {_insurancePrice = 500;};
  65.  
  66. (CONTROL(2800,2803)) ctrlSetStructuredText parseText format [
  67. (localize "STR_Shop_Veh_UI_RetrievalP")+ " <t color='#8cff9b'>$%1</t><br/>
  68. " +(localize "STR_Shop_Veh_UI_SellP")+ " <t color='#8cff9b'>$%2</t><br/>
  69. Etat du controle technique: %9<br/>
  70. Prix de l'assurance: <t color='#8cff9b'>%9€</t><br/>
  71. Etat de l'assurance: %10 <br/>
  72. " +(localize "STR_Shop_Veh_UI_Color")+ " %8<br/>
  73. " +(localize "STR_Shop_Veh_UI_MaxSpeed")+ " %3 km/h<br/>
  74. " +(localize "STR_Shop_Veh_UI_HPower")+ " %4<br/>
  75. " +(localize "STR_Shop_Veh_UI_PSeats")+ " %5<br/>
  76. " +(localize "STR_Shop_Veh_UI_Trunk")+ " %6<br/>
  77. " +(localize "STR_Shop_Veh_UI_Fuel")+ " %7
  78. ",
  79. [_retrievePrice] call life_fnc_numberText,
  80. [_sellPrice] call life_fnc_numberText,
  81. (_vehicleInfo select 8),
  82. (_vehicleInfo select 11),
  83. (_vehicleInfo select 10),
  84. if (_trunkSpace isEqualTo -1) then {"None"} else {_trunkSpace},
  85. (_vehicleInfo select 12),
  86. _vehicleColor,
  87. [(_dataArr select 3)] call max_controltech_fnc_inspectionStatus,
  88. [_insurancePrice] call life_fnc_numberText,
  89. if (_insurance isEqualTo 1) then {"<t color='#8cff9b'>Assuré</t>"} else {"<t color='#FF0000'>Pas d'assurance</t>"}
  90. ];
  91.  
  92. ctrlShow [2803,true];
  93. ctrlShow [2830,true];
  94.  
  95. if (_insurance isEqualTo 1) then {
  96. ctrlShow [2804,false];
  97. } else {
  98. ctrlShow [2804,true];
  99. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement