Advertisement
Guest User

fn_InsureCar.sqf

a guest
Dec 4th, 2015
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.13 KB | None | 0 0
  1. #include <macro.h>
  2.  
  3. private["_vehicle","_vid","_pid","_unit","_price"];
  4. disableSerialization;
  5. if(EQUAL(lbCurSel 2802,-1)) exitWith {hint localize "STR_Global_NoSelection"};
  6. _vehicle = lbData[2802,(lbCurSel 2802)];
  7. _vehicle = (call compile format["%1",_vehicle]) select 0;
  8. _vid = lbValue[2802,(lbCurSel 2802)];
  9. _pid = steamid;
  10. _unit = player;
  11.  
  12.  
  13. if(isNil "_vehicle") exitWith {hint localize "STR_Garage_Selection_Error"};
  14.  
  15. _Price = switch(playerSide) do {
  16.     case civilian: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_vehicle,"insurance"),0)};
  17.     case west: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_vehicle,"insurance"),1)};
  18.     case independent: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_vehicle,"insurance"),2)};
  19.     case east: {SEL(M_CONFIG(getArray,CONFIG_VEHICLES,_vehicle,"insurance"),4)};
  20. };
  21.  
  22. if(!(EQUAL(typeName _Price,typeName 0)) OR _Price < 1) then {_Price = 1000};
  23. if(BANK < _price) exitWith {hint format[(localize "STR_GNOTF_NotEnoughMoney"),[_price] call life_fnc_numberText];};
  24.  
  25. [[_vid,_pid,_unit,_price],"TON_fnc_InsureCar",false,false] spawn life_fnc_MP;
  26.  
  27.  
  28. hint localize "STR_GNOTF_nowinsure";
  29. SUB(BANK,_price);
  30. closeDialog 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement