iSoJu Posted September 29, 2014 Report Share Posted September 29, 2014 I have a issue where if another player is giving another player coins it does it takes money out of the givers coins but then the person who recieved it either gets it then loses it right after getting it. I have sc 2.0 installed. Link to comment Share on other sites More sharing options...
Gr8 Posted September 30, 2014 Report Share Posted September 30, 2014 Replace your init.sqf by this BankDialogTransferAmount = 13000; BankDialogPlayerBalance = 13001; BankDialogBankBalance = 13002; SCTraderDialogCatList = 32000; SCTraderDialogItemList = 32001; SCTraderDialogBuyPrice = 32002; SCTraderDialogSellPrice = 32003; GivePlayerDialogTransferAmount = 14000; GivePlayerDialogPlayerBalance = 14001; BankDialogUpdateAmounts = { ctrlSetText [BankDialogPlayerBalance, format["%1 %2", (player getVariable ['cashMoney', 0] call BIS_fnc_numberText), CurrencyName]]; ctrlSetText [BankDialogBankBalance, format["%1 %2", (player getVariable ['bankMoney', 0] call BIS_fnc_numberText), CurrencyName]]; }; GivePlayerDialogAmounts = { ctrlSetText [GivePlayerDialogPlayerBalance, format["%1 %2", (player getVariable ['cashMoney', 0] call BIS_fnc_numberText), CurrencyName]]; ctrlSetText [14003, format["%1", (name cursorTarget)]]; }; BankDialogWithdrawAmount = { private ["_amount","_bank","_wealth"]; _amount = parseNumber (_this select 0); _bank = player getVariable ["bankMoney", 0]; _wealth = player getVariable["cashMoney",0]; if(_amount > 999999) exitWith { cutText ["You can not withdraw more then 999,999 gold coins at once.", "PLAIN DOWN"]; }; if(_amount < 1 or _amount > _bank) exitWith { cutText ["You can not withdraw more than is in your bank.", "PLAIN DOWN"]; }; player setVariable["cashMoney",(_wealth + _amount),true]; player setVariable["bankMoney",(_bank - _amount),true]; PVDZE_plr_Save = [player,(magazines player),true,true] ; publicVariableServer "PVDZE_plr_Save"; PVDZE_bank_Save = [player]; publicVariableServer "PVDZE_bank_Save"; cutText [format["You have withdrawn %1 %2.", [_amount] call BIS_fnc_numberText, CurrencyName], "PLAIN DOWN"]; }; BankDialogDepositAmount = { private ["_amount","_bank","_wealth"]; _amount = parseNumber (_this select 0); _bank = player getVariable ["bankMoney", 0]; _wealth = player getVariable["cashMoney",0]; if(_amount > 999999) exitWith { cutText ["You can not deposit more then 999,999 gold coins at once.", "PLAIN DOWN"]; }; if (_amount < 1 or _amount > _wealth) exitWith { cutText ["You can not deposit more than you have.", "PLAIN DOWN"]; }; if( LimitOnBank && ((_bank + _amount ) > MaxBankMoney)) then{ if( (getPlayerUID player in DonatorListZupa ) && ((_bank + _amount ) < MaxDonatorBankMoney)) then{ player setVariable["cashMoney",(_wealth - _amount),true]; player setVariable["bankMoney",(_bank + _amount),true]; cutText [format["You have deposited %1 %2.", [_amount] call BIS_fnc_numberText, CurrencyName], "PLAIN DOWN"]; }else{ cutText [format["You can only have a max of %1 %3, donators %2", [MaxBankMoney] call BIS_fnc_numberText,[MaxDonatorBankMoney] call BIS_fnc_numberText,CurrencyName], "PLAIN DOWN"]; }; }else{ player setVariable["cashMoney",(_wealth - _amount),true]; player setVariable["bankMoney",(_bank + _amount),true]; cutText [format["You have deposited %1 %2.", [_amount] call BIS_fnc_numberText, CurrencyName], "PLAIN DOWN"]; }; PVDZE_plr_Save = [player,(magazines player),true,true] ; publicVariableServer "PVDZE_plr_Save"; PVDZE_bank_Save = [player]; publicVariableServer "PVDZE_bank_Save"; }; GivePlayerAmount = { private ["_amount","_target","_wealth"]; _amount = parseNumber (_this select 0); _target = cursorTarget; _wealth = player getVariable["cashMoney",0]; _twealth = _target getVariable["cashMoney",0]; _isMan = _target isKindOf "Man"; 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 facing anyone.", "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"; cutText [format["You gave %1 %2.", _amount, CurrencyName], "PLAIN DOWN"]; }; Link to comment Share on other sites More sharing options...
iSoJu Posted September 30, 2014 Author Report Share Posted September 30, 2014 Currently testing and will get back to you seems like it would work I had a double check after player deposit coins in bank not after give coins makes sense Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now