Advertisement
Guest User

faf

a guest
Aug 28th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. GivePlayerAmount = {
  2. private ["_amount","_target","_wealth",_"player"];
  3.  
  4. _amount = parseNumber (_this select 0);
  5. _target = cursorTarget;
  6. _wealth = player getVariable["cashMoney",0];
  7. _twealth = _target getVariable["cashMoney",0];
  8. _isMan = _target isKindOf "Man";
  9. _name = name _target;
  10. _player = _this select 0;
  11.  
  12. if (_target getVariable ["tradingmoney", false]) exitWith {
  13. cutText ["You can not give to someone who is already trading.", "PLAIN DOWN"];
  14. diag_log format["ANTI-DUPE: %1 attempted to give coins to %2 at the same time.",name _player,_name];
  15. };
  16. if (_amount < 1 or _amount > _wealth) exitWith {
  17. cutText ["You can not give more than you currently have.", "PLAIN DOWN"];
  18. };
  19. if (!_isMan) exitWith {
  20. cutText ["You are not looking correctly at a player", "PLAIN DOWN"];
  21. };
  22.  
  23.  
  24. PVDZE_account_Doublecheck = [player];
  25. publicVariableServer "PVDZE_account_Doublecheck";
  26. player setVariable["cashMoney",_wealth - _amount, true];
  27. _target setVariable["cashMoney",_twealth + _amount, true];
  28.  
  29. PVDZE_plr_Save = [player,(magazines player),true,true] ;
  30. publicVariableServer "PVDZE_plr_Save";
  31. PVDZE_plr_Save = [_target,(magazines _target),true,true] ;
  32. publicVariableServer "PVDZE_plr_Save";
  33.  
  34. PVDG_coinlog = [player,"gave ("+_name+")",(_amount call BIS_fnc_numberText),(player getVariable ["cashMoney",0]),(player getVariable ["bankMoney",0])];
  35. publicVariableServer "PVDG_coinlog";
  36.  
  37. cutText [format["You gave %1 %2.", _amount, CurrencyName], "PLAIN DOWN"];
  38. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement