Advertisement
Guest User

fn_useGangBank.sqf

a guest
Apr 21st, 2021
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. File: fn_gangWithdraw.sqf
  4. Author: Bryan "Tonic" Boardwine
  5.  
  6. Description:
  7. Withdraws money from the gang bank.
  8. */
  9. params [
  10. ["_deposit",false,[false]]
  11. ];
  12.  
  13. private _value = parseNumber(ctrlText 2702);
  14. private _gFund = GANG_FUNDS;
  15. if ((time - life_action_delay) < 0.5) exitWith {hint localize "STR_NOTF_ActionDelay"};
  16.  
  17. //Series of stupid checks
  18. if (isNil {(group player) getVariable "gang_name"}) exitWith {hint localize "STR_ATM_NotInGang"}; // Checks if player isn't in a gang
  19. if (_value > 999999) exitWith {hint localize "STR_ATM_WithdrawMax";};
  20. if (_value < 1) exitWith {};
  21. if (!([str(_value)] call TON_fnc_isnumber)) exitWith {hint localize "STR_ATM_notnumeric"};
  22. if (_deposit && _value > CASH) exitWith {hint localize "STR_ATM_NotEnoughCash"};
  23. if (!_deposit && _value > _gFund) exitWith {hint localize "STR_ATM_NotEnoughFundsG"};
  24.  
  25. if (_deposit) then {
  26. CASH = CASH - _value;
  27. [] call life_fnc_atmMenu;
  28. };
  29.  
  30. if (life_HC_isActive) then {
  31. [1,group player,_deposit,_value,player,CASH] remoteExecCall ["HC_fnc_updateGang",HC_Life]; //Update the database.
  32. } else {
  33. [1,group player,_deposit,_value,player,CASH] remoteExecCall ["TON_fnc_updateGang",RSERV]; //Update the database.
  34. };
  35.  
  36. life_action_delay = time;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement