Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 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. switch (playerSide) do {
  35. case civilian: {
  36. _purchasePrice = _price * LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_CIVILIAN");
  37. _sellMultiplier = LIFE_SETTINGS(getNumber,"vehicle_sell_multiplier_CIVILIAN");
  38. };
  39. case west: {
  40. _purchasePrice = _price * LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_COP");
  41. _sellMultiplier = LIFE_SETTINGS(getNumber,"vehicle_sell_multiplier_COP");
  42. };
  43. case independent: {
  44. _purchasePrice = _price * LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_MEDIC");
  45. _sellMultiplier = LIFE_SETTINGS(getNumber,"vehicle_sell_multiplier_MEDIC");
  46. };
  47. case east: {
  48. _purchasePrice = _price * LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_OPFOR");
  49. _sellMultiplier = LIFE_SETTINGS(getNumber,"vehicle_sell_multiplier_OPFOR");
  50. };
  51. };
  52. _retrievePrice = _purchasePrice * _storageFee;
  53. _sellPrice = _purchasePrice * _sellMultiplier;
  54.  
  55. if (!(_sellPrice isEqualType 0) || _sellPrice < 1) then {_sellPrice = 500;};
  56. if (!(_retrievePrice isEqualType 0) || _retrievePrice < 1) then {_retrievePrice = 500;};
  57.  
  58. (CONTROL(2800,2803)) ctrlSetStructuredText parseText format [
  59. (localize "STR_Shop_Veh_UI_RetrievalP")+ " <t color='#8cff9b'>$%1</t><br/>
  60. " +(localize "STR_Shop_Veh_UI_SellP")+ " <t color='#8cff9b'>$%2</t><br/>
  61. Type d'essence : %9<br/>"
  62. " +(localize "STR_Shop_Veh_UI_Color")+ " %8<br/>
  63. " +(localize "STR_Shop_Veh_UI_MaxSpeed")+ " %3 km/h<br/>
  64. " +(localize "STR_Shop_Veh_UI_HPower")+ " %4<br/>
  65. " +(localize "STR_Shop_Veh_UI_PSeats")+ " %5<br/>
  66. " +(localize "STR_Shop_Veh_UI_Trunk")+ " %6<br/>
  67. " +(localize "STR_Shop_Veh_UI_Fuel")+ " %7
  68. ",
  69. [_retrievePrice] call life_fnc_numberText,
  70. [_sellPrice] call life_fnc_numberText,
  71. (_vehicleInfo select 8),
  72. (_vehicleInfo select 11),
  73. (_vehicleInfo select 10),
  74. if (_trunkSpace isEqualTo -1) then {"None"} else {_trunkSpace},
  75. (_vehicleInfo select 12),
  76. _vehicleColor,
  77. [classNameLife] call max_fuelstations_fnc_getFuelType
  78. ];
  79.  
  80. ctrlShow [2803,true];
  81. ctrlShow [2830,true];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement