Advertisement
skotracker

ExileClient_util_gear_calculateSellPrice

Apr 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.60 KB | None | 0 0
  1. /**
  2.  * ExileClient_util_gear_calculateSellPrice
  3.  *
  4.  * Exile Mod
  5.  * www.exilemod.com
  6.  * © 2015 Exile Mod Team
  7.  *
  8.  * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  9.  * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  10.  */
  11.  
  12. private["_className","_amount"];
  13. _className = _this;
  14. _amount = 0;
  15. if (isNumber (missionConfigFile >> "CfgExileArsenal" >> _className >> "sellPrice")) then
  16. {
  17.     _amount = getNumber (missionConfigFile >> "CfgExileArsenal" >> _className >> "sellPrice");
  18. }
  19. else
  20. {
  21.     if (isNumber (missionConfigFile >> "CfgExileArsenal" >> _className >> "price")) then
  22.     {
  23.         _amount = getNumber (missionConfigFile >> "CfgExileArsenal" >> _className >> "price");
  24.        
  25.         _sellType = 0;
  26.         _sellTypeConfig = "sellPriceFactor";
  27.         if(_className isKindOf ["LandVehicle", configFile >> "CfgVehicles"]) then {
  28.             _sellTypeConfig = "LandVehicleSellPriceFactor";
  29.         };
  30.         if(_className isKindOf ["Air", configFile >> "CfgVehicles"]) then {
  31.             _sellTypeConfig = "AirSellPriceFactor";
  32.         };
  33.         if(_className isKindOf ["Ship", configFile >> "CfgVehicles"]) then {
  34.             _sellTypeConfig = "ShipSellPriceFactor";
  35.         };
  36.         if(_className isKindOf ["Default", configFile >> "CfgWeapons"]) then {
  37.             _sellTypeConfig = "WeaponsSellPriceFactor";
  38.         };
  39.         if(_className isKindOf ["Default", configFile >> "CfgMagazines"]) then {
  40.             _sellTypeConfig = "MagazinesSellPriceFactor";
  41.         };
  42.  
  43.         _amount = _amount * (getNumber (missionConfigFile >> "CfgTrading" >> _sellTypeConfig));
  44.  
  45.         _amount = (floor _amount) max 1;
  46.     };
  47. };
  48. _amount
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement