Advertisement
Guest User

Untitled

a guest
Mar 25th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.89 KB | None | 0 0
  1. /*
  2. Author: Maxence Lyon
  3. Altis DEV: https://altisdev.com/user/maxence-lyon
  4. Teamspeak 3: ts.the-programmer.com
  5. Web site: www.the-programmer.com
  6. Steam: « Une Vache Sur CS – Maxence », please leave a message on my profile who says the exact reason before adding me.
  7.  
  8. Terms of use:
  9. - This file is forbidden unless you have permission from the author. If you have this file without permission to use it please do not use it and do not share it.
  10. - If you have permission to use this file, you can use it on your server however it is strictly forbidden to share it.
  11. - Out of respect for the author please do not delete this information.
  12.  
  13. License number:
  14. Server's name:
  15. Owner's name:
  16. */
  17. disableSerialization;
  18.  
  19. if ((lbCurSel 5013) isEqualTo -1) exitWith {hint localize "STR_Global_NoSelection";};
  20.  
  21. _dataArr = lbData [5013,(lbCurSel 5013)];
  22. _vehicleData = call compile format ["%1",_dataArr];
  23. _className = _vehicleData select 1;
  24. _vehicleLife = _className;
  25.  
  26. _vid = lbValue [5013,(lbCurSel 5013)];
  27. _pid = _vehicleData select 2;
  28. _unit = player;
  29. _exit = false;
  30.  
  31. if !(_pid isEqualTo (getPlayerUID player)) then {
  32. _action = [
  33. format [(["STR_CONFIRM_UNIMPOUND_TEXT","Max_Settings_Fourriere","Fourriere_Localization"] call theprogrammer_core_fnc_localize),(_vehicleData select 5)],
  34. (["STR_CONFIRM_UNIMPOUND_HEADER","Max_Settings_Fourriere","Fourriere_Localization"] call theprogrammer_core_fnc_localize),
  35. (["STR_CONFIRM","Max_Settings_Fourriere","Fourriere_Localization"] call theprogrammer_core_fnc_localize),
  36. (["STR_CANCEL","Max_Settings_Fourriere","Fourriere_Localization"] call theprogrammer_core_fnc_localize)
  37. ] call BIS_fnc_guiMessage;
  38.  
  39. if !(_action) then {_exit = true;};
  40. };
  41. if (_exit) exitWith {};
  42.  
  43. if (isNil "_className") exitWith {hint localize "STR_Garage_Selection_Error";};
  44.  
  45. if !(isClass (missionConfigFile >> "LifeCfgVehicles" >> _vehicleLife)) then {
  46. _vehicleLife = "Default";
  47. diag_log format ["%1: LifeCfgVehicles class doesn't exist",_className];
  48. };
  49.  
  50. _price = getNumber (missionConfigFile >> "LifeCfgVehicles" >> _vehicleLife >> "price");
  51. _config = missionConfigFile >> "Max_Settings_Fourriere";
  52.  
  53. _vehicle_four_multiplier = getNumber (_config >> "price_unimpound");
  54.  
  55. if (([] call max_fourriere_fnc_checkConditionFourriere) isEqualTo "all") then {
  56. _vehicle_four_multiplier = getNumber (_config >> "price_unimpound_condition_matched");
  57. };
  58.  
  59. _purchasePrice = _price * (getNumber (missionConfigFile >> "Life_Settings" >> "vehicle_purchase_multiplier_CIVILIAN"));
  60. _price = _purchasePrice * _vehicle_four_multiplier;
  61.  
  62. if (_price < (getNumber (_config >> "minimum_retreive_price"))) then {_price = (getNumber (_config >> "minimum_retreive_price"));};
  63. if (life_atmbank < _price) exitWith {hint format [(localize "STR_Garage_CashError"),[_price] call life_fnc_numberText];};
  64.  
  65. if (life_fourriere_sp isEqualType []) then {
  66. [_vid,_pid,(life_fourriere_sp select 0),_unit,_price,(life_fourriere_sp select 1),(localize "STR_Garage_spawn_Success")] remoteExec ["TON_fnc_spawnVehicle",2];
  67. } else {
  68. [_vid,_pid,(getMarkerPos life_fourriere_sp),_unit,_price,(markerDir life_fourriere_sp),(localize "STR_Garage_spawn_Success")] remoteExec ["TON_fnc_spawnVehicle",2];
  69. };
  70.  
  71. [0,_pid,(_vehicleData select 4)] remoteExec ["max_fourriere_fnc_updateFourriere",2];
  72.  
  73. hint localize "STR_Garage_SpawningVeh";
  74. life_atmbank = life_atmbank - _price;
  75. if !(isNil "masterpay_script_enable_and_ready") then {
  76. if (masterpay_script_enable_and_ready) then {
  77. _vehicleName = getText (configFile >> "CfgVehicles" >> _vehicleLife >> "displayName");
  78. [player,(["STR_IMPOUND_MENU_FROM","The_Programmer_Settings_MasterPay","MasterPay_Localization"] call theprogrammer_core_fnc_localize),_price,format [(["STR_IMPOUND_MENU_DESCRITPION","The_Programmer_Settings_MasterPay","MasterPay_Localization"] call theprogrammer_core_fnc_localize),_vehicleName]] spawn masterpay_fnc_updateBank;
  79. };
  80. };
  81. [1] call SOCK_fnc_updatePartial;
  82. closeDialog 0;
  83.  
  84. _companyID = getNumber (_config >> "send_money_to_company_id");
  85. if !(_companyID isEqualTo -1) then {
  86. _company = objNull;
  87. {
  88. if ((_x select 0) isEqualTo _companyID) exitWith {_company = (_x select 1);};
  89. } foreach maxence_all_entreprises;
  90.  
  91. if !(isNull _company) then {
  92. _oldEntACC = _company getVariable ["entreprise_bankacc",0];
  93. _oldEntACC = _oldEntACC + _price;
  94. _company setVariable ["entreprise_bankacc",_oldEntACC,true];
  95. [(_company getVariable ["entreprise_id",0]),5,(_company getVariable ["entreprise_bankacc",0])] remoteExecCall ["max_entreprise_fnc_updateEntreprise",2];
  96. [_company,format ["%1 : %2",(name player),(["STR_UNIMPOUND_FEE","Max_Settings_Fourriere","Fourriere_Localization"] call theprogrammer_core_fnc_localize)],_price,2] remoteExecCall ["max_entreprise_fnc_insertEntrepriseLogs",2];
  97. };
  98. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement