Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2015
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. /*
  2. File: fn_bankDeposit.sqf
  3. Author: Bryan "Tonic" Boardwine
  4.  
  5. Description:
  6. Figure it out.
  7. */
  8. private["_value"];
  9. _value = parseNumber(ctrlText 2702);
  10.  
  11. //Series of stupid checks
  12. if(_value > 999999) exitWith {hint localize "STR_ATM_GreaterThan";};
  13. if(_value < 0) exitWith {};
  14. if(!([str(_value)] call life_fnc_isnumeric)) exitWith {hint localize "STR_AIM_notnumeric"};
  15. if(_value > life_cash) exitWith {hint "Du hast nicht so viel Geld dabei."};
  16.  
  17. life_cash = life_cash - _value;
  18. life_atmcash = life_atmcash + _value;
  19.  
  20. hint format["You have deposited $%1 into your bank account",[_value] call life_fnc_numberText];
  21. [] call life_fnc_atmMenu;
  22. [] call SOCK_fnc_updateRequest; //Silent Sync
  23.  
  24.  
  25. /*
  26. File: fn_bankTransfer.sqf
  27. Author: Bryan "Tonic" Boardwine
  28.  
  29. Description:
  30. Figure it out again.
  31. */
  32. private["_val","_unit","_tax"];
  33. _val = parseNumber(ctrlText 2702);
  34. _unit = call compile format["%1",(lbData[2703,(lbCurSel 2703)])];
  35. if(isNull _unit) exitWith {};
  36. if((lbCurSel 2703) == -1) exitWith {hint "You need to select someone to transfer to"};
  37. if(isNil "_unit") exitWith {hint "The player selected doesn't seem to exist?"};
  38. if(_val > 999999) exitWith {hint "You can't transfer more then $999,999";};
  39. if(_val < 0) exitwith {};
  40. if(!([str(_val)] call life_fnc_isnumeric)) exitWith {hint "That isn't in an actual number format."};
  41. if(_val > life_atmcash) exitWith {hint "You don't have that much in your bank account!"};
  42. _tax = [_val] call life_fnc_taxRate;
  43. if((_val + _tax) > life_atmcash) exitWith {hint format["You do not have enough money in your bank account, to transfer $%1 you will need $%2 as a tax fee.",_val,_tax]};
  44.  
  45. life_atmcash = life_atmcash - (_val + _tax);
  46.  
  47. [[_val,player getVariable["realname",name player]],"clientWireTransfer",_unit,false] spawn life_fnc_MP;
  48. [] call life_fnc_atmMenu;
  49. hint format["You have transfered $%1 to %2.\n\nA tax fee of $%3 was taken for the wire transfer.",[_val] call life_fnc_numberText,_unit getVariable["realname",name _unit],[_tax] call life_fnc_numberText];[] call SOCK_fnc_updateRequest; //Silent Sync
  50.  
  51.  
  52. /*
  53. COPY PASTE TIME
  54. */
  55. private["_val"];
  56. _val = parseNumber(ctrlText 2702);
  57. if(_val > 999999) exitWith {hint "You can't withdraw more then $999,999";};
  58. if(_val < 0) exitwith {};
  59. if(!([str(_val)] call life_fnc_isnumeric)) exitWith {hint "That isn't in an actual number format."};
  60. if(_val > life_atmcash) exitWith {hint "You don't have that much in your bank account!"};
  61. if(_val < 100 && life_atmcash > 20000000) exitWith {hint "You can't withdraw less then $100"}; //Temp fix for something.
  62.  
  63. life_cash = life_cash + _val;
  64. life_atmcash = life_atmcash - _val;
  65. hint format ["You have withdrawn $%1 from your bank account",[_val] call life_fnc_numberText];
  66. [] call life_fnc_atmMenu;
  67. [] call SOCK_fnc_updateRequest; //Silent Sync
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement