Advertisement
Guest User

fn_garageLBChange.sqf

a guest
Dec 4th, 2015
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.40 KB | None | 0 0
  1. #include <macro.h>
  2. /*
  3.     File: fn_garageLBChange.sqf
  4.    
  5.    
  6.     Description:
  7.     Can't be bothered to answer it.. Already deleted it by accident..
  8. */
  9. disableSerialization;
  10. private["_control","_index","_className","_dataArr","_vehicleColor","_vehicleInfo","_trunkSpace","_sellPrice","_retrievePrice","_assurPrice","_assur"];
  11. _control = SEL(_this,0);
  12. _index = SEL(_this,1);
  13.  
  14. //Fetch some information.
  15. _dataArr = CONTROL_DATAI(_control,_index);
  16. _dataArr = call compile format["%1",_dataArr];
  17. _className = SEL(_dataArr,0);
  18. _assur = SEL(_dataArr, 2);
  19.  
  20. _vehicleColor = SEL(SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_className,"textures"),SEL(_dataArr,1)),0);
  21. if(isNil "_vehicleColor") then {_vehicleColor = "Default";};
  22.  
  23. _vehicleInfo = [_className] call life_fnc_fetchVehInfo;
  24. _trunkSpace = [_className] call life_fnc_vehicleWeightCfg;
  25.  
  26. _retrievePrice = switch(playerSide) do {
  27.     case civilian: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_className,"storageFee"),0)};
  28.     case west: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_className,"storageFee"),1)};
  29.     case independent: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_className,"storageFee"),2)};
  30.     case east: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_className,"storageFee"),4)};
  31. };
  32.  
  33. _sellPrice = switch(playerSide) do {
  34.     case civilian: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_className,"garageSell"),0)};
  35.     case west: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_className,"garageSell"),1)};
  36.     case independent: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_className,"garageSell"),2)};
  37.     case east: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_className,"garageSell"),4)};
  38. };
  39.  
  40. _assurPrice = switch(playerSide) do {
  41.     case civilian: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_className,"insurance"),0)};
  42.     case west: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_className,"insurance"),1)};
  43.     case independent: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_className,"insurance"),2)};
  44.     case east: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_className,"insurance"),4)};
  45. };
  46.  
  47. if(!(EQUAL(typeName _sellPrice,typeName 0)) OR _sellPrice < 1) then {_sellPrice = 1000};
  48. if(!(EQUAL(typeName _retrievePrice,typeName 0)) OR _retrievePrice < 1) then {_retrievePrice = 1000};
  49. if(!(EQUAL(typeName _assurPrice,typeName 0)) OR _assurPrice < 1) then {_assurPrice = 1000};
  50.  
  51. (CONTROL(2800,2803)) ctrlSetStructuredText parseText format[
  52.     (localize "STR_Shop_Veh_UI_RetrievalP")+ " <t color='#8cff9b'>$%1</t><br/>
  53.     " +(localize "STR_Shop_Veh_UI_SellP")+ " <t color='#8cff9b'>$%2</t><br/>
  54.     " +(localize "STR_Shop_Veh_UI_Assur")+ " <t color='#8cff9b'>%9$</t><br/>
  55.     " +(localize "STR_Shop_Veh_UI_AssurI")+ " %10<br/>
  56.     " +(localize "STR_Shop_Veh_UI_Color")+ " %8<br/>
  57.     " +(localize "STR_Shop_Veh_UI_MaxSpeed")+ " %3 km/h<br/>
  58.     " +(localize "STR_Shop_Veh_UI_HPower")+ " %4<br/>
  59.     " +(localize "STR_Shop_Veh_UI_PSeats")+ " %5<br/>
  60.     " +(localize "STR_Shop_Veh_UI_Trunk")+ " %6<br/>
  61.     " +(localize "STR_Shop_Veh_UI_Fuel")+ " %7
  62.     ",
  63. [_retrievePrice] call life_fnc_numberText,
  64. [_sellPrice] call life_fnc_numberText,
  65. SEL(_vehicleInfo,8),
  66. SEL(_vehicleInfo,11),
  67. SEL(_vehicleInfo,10),
  68. if(_trunkSpace == -1) then {"0"} else {_trunkSpace},
  69. SEL(_vehicleInfo,12),
  70. _vehicleColor,
  71. [_assurPrice] call life_fnc_numberText,
  72. if(_assur == 1) then {"<t color='#8cff9b'>Assuré</t>"} else {"<t color='#FF0000'>Pas d'assurance</t>"},
  73. SEL(_vehicleInfo,9)
  74. ];
  75.  
  76. if(_assur == 1) then {
  77. ctrlShow [97480,False];
  78. }else{
  79. ctrlShow [97480,True];
  80. };
  81.  
  82. ctrlShow [2803,true];
  83. ctrlShow [2830,true];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement