<commit_before>//	@file Version: 1.1
//	@file Name: pickupMoney.sqf
//	@file Author: [404] Deadbeat, [404] Costlyy, AgentRev
//	@file Date modified: 07/12/2012 05:19
//	@file Args:

// Check if mutex lock is active.
if (mutexScriptInProgress) exitWith
{
	player globalChat "You are already performing another action.";
};

mutexScriptInProgress = true;

private ["_pickDistance", "_moneyObjects", "_moneyObj", "_money"];

_pickDistance = 5;

_moneyObjects = nearestObjects [player, ["Land_Money_F"], _pickDistance];

if (count _moneyObjects > 0) then
{
	_moneyObj = _moneyObjects select 0;
};

if (isNil "_moneyObj" || {player distance _moneyObj > _pickDistance}) exitWith
{
	titleText ["You are too far to pick the money up.", "PLAIN DOWN", 0.5];
	mutexScriptInProgress = false;
};

if (vehicle player != player) exitWith
{
	titleText ["You can't pick up money while in a vehicle", "PLAIN DOWN", 0.5];
	player action ["Eject", vehicle player];
	mutexScriptInProgress = false;
};

_money = _moneyObj getVariable ["money", 0];
deleteVehicle _moneyObj;
if (_money < 0) then { _money = 0 };
player setVariable ["cmoney", (player getVariable ["cmoney", 0]) + _money, true];

if (_money > 0) then
{
	titleText [format ["You have picked up $%1", _money], "PLAIN DOWN", 0.5];
}
else
{
	titleText ["The money was counterfeit!", "PLAIN DOWN", 0.5];
};

mutexScriptInProgress = false;
<commit_msg>Changed pickupMoney variable from "money" to "cmoney"<commit_after>//	@file Version: 1.1
//	@file Name: pickupMoney.sqf
//	@file Author: [404] Deadbeat, [404] Costlyy, AgentRev
//	@file Date modified: 07/12/2012 05:19
//	@file Args:

// Check if mutex lock is active.
if (mutexScriptInProgress) exitWith
{
	player globalChat "You are already performing another action.";
};

mutexScriptInProgress = true;

private ["_pickDistance", "_moneyObjects", "_moneyObj", "_money"];

_pickDistance = 5;

_moneyObjects = nearestObjects [player, ["Land_Money_F"], _pickDistance];

if (count _moneyObjects > 0) then
{
	_moneyObj = _moneyObjects select 0;
};

if (isNil "_moneyObj" || {player distance _moneyObj > _pickDistance}) exitWith
{
	titleText ["You are too far to pick the money up.", "PLAIN DOWN", 0.5];
	mutexScriptInProgress = false;
};

if (vehicle player != player) exitWith
{
	titleText ["You can't pick up money while in a vehicle", "PLAIN DOWN", 0.5];
	player action ["Eject", vehicle player];
	mutexScriptInProgress = false;
};

_money = _moneyObj getVariable ["cmoney", 0];
deleteVehicle _moneyObj;
if (_money < 0) then { _money = 0 };
player setVariable ["cmoney", (player getVariable ["cmoney", 0]) + _money, true];

if (_money > 0) then
{
	titleText [format ["You have picked up $%1", _money], "PLAIN DOWN", 0.5];
}
else
{
	titleText ["The money was counterfeit!", "PLAIN DOWN", 0.5];
};

mutexScriptInProgress = false;

{'fraction_non_alphanumeric': 0.1428063943161634, 'fraction_numerical': 0.026287744227353464, 'mean_word_length': 4.90356394129979, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2737211', 'n_tokens_mistral': 1038, 'n_tokens_neox': 929, 'n_words': 320}