Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GivePlayerAmount = {
- private ["_amount","_target","_wealth",_"player"];
- _amount = parseNumber (_this select 0);
- _target = cursorTarget;
- _wealth = player getVariable["cashMoney",0];
- _twealth = _target getVariable["cashMoney",0];
- _isMan = _target isKindOf "Man";
- _name = name _target;
- _player = _this select 0;
- if (_target getVariable ["tradingmoney", false]) exitWith {
- cutText ["You can not give to someone who is already trading.", "PLAIN DOWN"];
- diag_log format["ANTI-DUPE: %1 attempted to give coins to %2 at the same time.",name _player,_name];
- };
- if (_amount < 1 or _amount > _wealth) exitWith {
- cutText ["You can not give more than you currently have.", "PLAIN DOWN"];
- };
- if (!_isMan) exitWith {
- cutText ["You are not looking correctly at a player", "PLAIN DOWN"];
- };
- PVDZE_account_Doublecheck = [player];
- publicVariableServer "PVDZE_account_Doublecheck";
- player setVariable["cashMoney",_wealth - _amount, true];
- _target setVariable["cashMoney",_twealth + _amount, true];
- PVDZE_plr_Save = [player,(magazines player),true,true] ;
- publicVariableServer "PVDZE_plr_Save";
- PVDZE_plr_Save = [_target,(magazines _target),true,true] ;
- publicVariableServer "PVDZE_plr_Save";
- PVDG_coinlog = [player,"gave ("+_name+")",(_amount call BIS_fnc_numberText),(player getVariable ["cashMoney",0]),(player getVariable ["bankMoney",0])];
- publicVariableServer "PVDG_coinlog";
- cutText [format["You gave %1 %2.", _amount, CurrencyName], "PLAIN DOWN"];
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement