#include "..\script_component.hpp" /* * Function: forge_client_bank_fnc_withdraw * Author: IDSolutions * * [Description] * Withdraws money from the bank * * Arguments: * None * * Return Value: * None * * Examples: * None * * Public: Yes */ private _display = findDisplay IDD_BANKDIALOG; private _input = _display displayCtrl IDC_AMOUNTINPUT; private _amount = parseNumber (ctrlText _input); private _bank = GETVAR(player,FORGE_Bank,0); private _cash = GETVAR(player,FORGE_Cash,0); if (_amount > 0 && _amount <= _bank) then { _bank = _bank - _amount; _cash = _cash + _amount; SETPVAR(player,FORGE_Bank,_bank); SETPVAR(player,FORGE_Cash,_cash); [] call FUNC(refresh); [format ["Money withdrawn successfully"], "info", 3, "right"] call EFUNC(misc,notify); } else { [format ["Invalid amount"], "warning", 3, "right"] call EFUNC(misc,notify); };