Files
DayZ-Epoch/SQF/dayz_code/actions/AdvancedTrading/functions/SC_fnc_removeCoins.sqf
icomrade 1585765ca6 Advanced trading by Zupa @Windmolders
Stock configuration and basic integration. WE still need config based
trader setups.
2016-04-27 18:23:55 -04:00

21 lines
544 B
Plaintext

private ["_player","_amount","_wealth","_newwealth", "_result"];
_player = _this select 0;
_amount = _this select 1;
_result = false;
_wealth = _player getVariable[Z_MoneyVariable,0];
if(_amount > 0)then{
if (_wealth < _amount) then {
_result = false;
} else {
_newwealth = _wealth - _amount;
_player setVariable[Z_MoneyVariable,_newwealth, true];
_player setVariable ["moneychanged",1,true];
_result = true;
PVDZE_plr_Save = [_player,(magazines _player),true,true] ;
publicVariableServer "PVDZE_plr_Save";
};
}else{
_result = true;
};
_result