<commit_before>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
#include "defines.sqf"
#define ERR_NOT_ENOUGH_FUNDS "There are not enough funds in the warchest."
#define ERR_LESS_THAN_ONE "The amount must be at least $1"
disableSerialization;
private ["_warchest", "_input", "_amount", "_money"];
_warchest = findDisplay IDD_WARCHEST;
if (isNull _warchest) exitWith {};

_input = _warchest displayCtrl IDC_AMOUNT;
_amount = floor parseNumber ctrlText _input;

if (_amount < 1) then
{
	[ERR_LESS_THAN_ONE, 5] call mf_notify_client;
	playSound "FD_CP_Not_Clear_F";
}
else
{
	_money = player getVariable ["cmoney", 0];

	switch (playerSide) do
	{
		case EAST:
		{
			if (pvar_warchest_funds_east < _amount) exitWith
			{
				[ERR_NOT_ENOUGH_FUNDS, 5] call mf_notify_client;
				playSound "FD_CP_Not_Clear_F";
			};
			pvar_warchest_funds_east = pvar_warchest_funds_east - _amount;
			publicVariable "pvar_warchest_funds_east";
			player setVariable["cmoney", _money + _amount, true];
			playSound "defaultNotification";
		};<commit_msg>Update withdraw.sqf<commit_after>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 <EMAIL> *
// ******************************************************************************************
#include "defines.sqf"
#define ERR_NOT_ENOUGH_FUNDS "No tienes suficiente dinero en la caja."
#define ERR_LESS_THAN_ONE "La cantidad debe ser como mínimo de $1"
disableSerialization;
private ["_warchest", "_input", "_amount", "_money"];
_warchest = findDisplay IDD_WARCHEST;
if (isNull _warchest) exitWith {};

_input = _warchest displayCtrl IDC_AMOUNT;
_amount = floor parseNumber ctrlText _input;

if (_amount < 1) then
{
	[ERR_LESS_THAN_ONE, 5] call mf_notify_client;
	playSound "FD_CP_Not_Clear_F";
}
else
{
	_money = player getVariable ["cmoney", 0];

	switch (playerSide) do
	{
		case EAST:
		{
			if (pvar_warchest_funds_east < _amount) exitWith
			{
				[ERR_NOT_ENOUGH_FUNDS, 5] call mf_notify_client;
				playSound "FD_CP_Not_Clear_F";
			};
			pvar_warchest_funds_east = pvar_warchest_funds_east - _amount;
			publicVariable "pvar_warchest_funds_east";
			player setVariable["cmoney", _money + _amount, true];
			playSound "defaultNotification";
		};
{'fraction_non_alphanumeric': 0.22888713496448304, 'fraction_numerical': 0.008287292817679558, 'mean_word_length': 6.081005586592179, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7229108', 'n_tokens_mistral': 923, 'n_tokens_neox': 828, 'n_words': 203}