Joshyy Posted December 21, 2015 Report Share Posted December 21, 2015 There is a major problem with the coin system on my server. People are able to give coins to someone/buy a vehicle and then re-log/die and have the money back? Any tips on fixing this, thanks! Link to comment Share on other sites More sharing options...
0 creativv Posted December 22, 2015 Report Share Posted December 22, 2015 Did you cap the amount of coins they can carry or are they able to walk around with over 999999 coins ? Link to comment Share on other sites More sharing options...
0 Joshyy Posted December 23, 2015 Author Report Share Posted December 23, 2015 Its a militarised server so buying good vehicles cost 7m which is a lot on the server any other solutions for this. The problem isint about how much they walk around with but how they can just relog after giving someone money and get the money back instantly Link to comment Share on other sites More sharing options...
0 creativv Posted December 23, 2015 Report Share Posted December 23, 2015 solution is to make prices cheaper , there is a limit to a hive.dll . Everything over 999.999 coins will cause problems Link to comment Share on other sites More sharing options...
0 Antichrist Posted December 23, 2015 Report Share Posted December 23, 2015 Problem is not the amount of coins they carry or store but how much they pick up. As in, a player can pick up null amount of coins if he knows what he's doing which results infinite amount of money at his disposal. This particaular problem exists on just about every server running global banking (SC 2.0) Link to comment Share on other sites More sharing options...
0 creativv Posted December 23, 2015 Report Share Posted December 23, 2015 Well i dont have the issue Antichrist since i capped all the amounts . Capped the amount of coins allowed to carry , capped prices , capped pick up amount , capped transfer amount ,capped amount you can redraw and deposite . Also fixed the dupe with giving eachother same amount at same time . I noticed when people give coins over a mill then logg of and come back on it was duped , after all my fixes i never had the issue again . Link to comment Share on other sites More sharing options...
0 Antichrist Posted December 23, 2015 Report Share Posted December 23, 2015 I bet i could still replicate the dupe i am talking about which would still mean i'd have whatever the max carry limit is at any time i wanted Link to comment Share on other sites More sharing options...
0 creativv Posted December 24, 2015 Report Share Posted December 24, 2015 Could be i dont know i would be interested to see though , but there is no fix for it ? I've also seen a coin system working on what i think i is arma2net you have experience with that ? If so care to eplain some things to me ? :D Link to comment Share on other sites More sharing options...
0 Joshyy Posted December 26, 2015 Author Report Share Posted December 26, 2015 On 23/12/2015 at 11:41 PM, creativv said: Well i dont have the issue Antichrist since i capped all the amounts . Capped the amount of coins allowed to carry , capped prices , capped pick up amount , capped transfer amount ,capped amount you can redraw and deposite . Also fixed the dupe with giving eachother same amount at same time . I noticed when people give coins over a mill then logg of and come back on it was duped , after all my fixes i never had the issue again . How do you cap the maximum pickup price, trasnfer amount and withdraw/deposite amount, may i ask Thanks, Link to comment Share on other sites More sharing options...
0 creativv Posted December 26, 2015 Report Share Posted December 26, 2015 2 hours ago, Joshyy said: How do you cap the maximum pickup price, trasnfer amount and withdraw/deposite amount, may i ask Thanks, i can show u mine check_wallet.sqf private ["_body", "_hisMoney", "_myMoney", "_killsH", "_test2", "_headShots", "_test","_playeridke","_humanity"]; _body = _this select 3; _hisMoney = _body getVariable ["cashMoney",0]; // Part to prevent them picking up to large amounds at once if(_hisMoney > 950000) exitWith { cutText ["This player has to many coins you cant pick it up it will bug your cash", "PLAIN DOWN"]; }; // This i put in trying to get rid of players being NULL'd if(_hisMoney < 1) exitWith { cutText ["This Player/AI is a poor bastard and has no coins!!!", "PLAIN DOWN"]; }; _PlayerNear = _body call dze_isnearest_player; if (_PlayerNear) exitWith {cutText [localize "str_pickup_limit_4", "PLAIN DOWN"]}; _name = _body getVariable ["bodyName","unknown"]; _hisMoney = _body getVariable ["cashMoney",0]; _myMoney = player getVariable ["cashMoney",0]; _myMoney = _myMoney + _hisMoney; _body setVariable ["cashMoney", 0 , true]; player setVariable ["cashMoney", _myMoney , true]; systemChat format ['You took %1 coins, ID says %2 !',_hisMoney,_name]; sleep 2; _cid = player getVariable ["CharacterID","0"]; _cashMoney = player getVariable ["cashMoney",0]; if(_cashMoney > 0) then{ } else { _cashMoney = 0; }; I put things like this in the init of my coin init . if (LimitOnPlayer && ((_wealth + _amount ) > MaxPlayerCoins )) exitWith { cutText ["You can only carry 950,000", "PLAIN DOWN"];}; Dont forget you need to make LimitOnPlayer and MaxPlayerCoins yourself in your variables.sqf like this for example LimitOnPlayer = true; MaxPlayerCoins = 950000; Link to comment Share on other sites More sharing options...
0 Joshyy Posted December 26, 2015 Author Report Share Posted December 26, 2015 11 hours ago, creativv said: i can show u mine check_wallet.sqf private ["_body", "_hisMoney", "_myMoney", "_killsH", "_test2", "_headShots", "_test","_playeridke","_humanity"]; _body = _this select 3; _hisMoney = _body getVariable ["cashMoney",0]; // Part to prevent them picking up to large amounds at once if(_hisMoney > 950000) exitWith { cutText ["This player has to many coins you cant pick it up it will bug your cash", "PLAIN DOWN"]; }; // This i put in trying to get rid of players being NULL'd if(_hisMoney < 1) exitWith { cutText ["This Player/AI is a poor bastard and has no coins!!!", "PLAIN DOWN"]; }; _PlayerNear = _body call dze_isnearest_player; if (_PlayerNear) exitWith {cutText [localize "str_pickup_limit_4", "PLAIN DOWN"]}; _name = _body getVariable ["bodyName","unknown"]; _hisMoney = _body getVariable ["cashMoney",0]; _myMoney = player getVariable ["cashMoney",0]; _myMoney = _myMoney + _hisMoney; _body setVariable ["cashMoney", 0 , true]; player setVariable ["cashMoney", _myMoney , true]; systemChat format ['You took %1 coins, ID says %2 !',_hisMoney,_name]; sleep 2; _cid = player getVariable ["CharacterID","0"]; _cashMoney = player getVariable ["cashMoney",0]; if(_cashMoney > 0) then{ } else { _cashMoney = 0; }; I put things like this in the init of my coin init . if (LimitOnPlayer && ((_wealth + _amount ) > MaxPlayerCoins )) exitWith { cutText ["You can only carry 950,000", "PLAIN DOWN"];}; Dont forget you need to make LimitOnPlayer and MaxPlayerCoins yourself in your variables.sqf like this for example LimitOnPlayer = true; MaxPlayerCoins = 950000; The limit on player didnt work? I set the limit to 975000 and when a player went over that limit it gave an error 9:11:24 Database(1): [Error] Error 1690 (BIGINT UNSIGNED value is out of range in '(`dayz_test`.`character_data`.`CashMoney` - 50000)') in MySQLQuery SQL: 'UPDATE `Character_DATA` SET `Backpack` = '[\"DZ_ALICE_Pack_EP1\",[[],[]],[[],[]]]' , `CashMoney` = (`CashMoney` - 50000) , `CurrentState` = '[\"RH_g18\",\"aidlpercmstpsraswpstdnon_player_idlesteady02\",37,[]]' , `DistanceFoot` = (`DistanceFoot` + 16) , `Duration` = (`Duration` + 1) , `Inventory` = '[[\"ItemMap\",\"ItemToolbox\",\"RH_g18\",\"ItemRadio\",\"ItemGPS\",\"NVGoggles\"],[\"ItemBandage\",\"ItemBandage\",\"ItemBandage\",\"ItemPainkiller\",\"ItemWaterbottle\",\"FoodPistachio\",\"PartGeneric\",\"RH_19Rnd_9x19_g18\",\"RH_19Rnd_9x19_g18\",\"RH_19Rnd_9x19_g18\"]]' , `Medical` = '[false,false,false,false,false,false,false,12000,[],[0,0],0,[0,0.206]]' , `Worldspace` = '[149,[6308.68,7810.14,0.001]]', `InstanceID` = 11 WHERE `CharacterID` = 43' thats the whole error line. Link to comment Share on other sites More sharing options...
0 Joshyy Posted December 27, 2015 Author Report Share Posted December 27, 2015 Do i just add if (LimitOnPlayer && ((_wealth + _amount ) > MaxPlayerCoins )) exitWith { cutText ["You can only carry 950,000", "PLAIN DOWN"];}; to the bottom of the coin init? Link to comment Share on other sites More sharing options...
0 creativv Posted December 27, 2015 Report Share Posted December 27, 2015 No you can add that in bankdialogwitgdrawamount like this . BankDialogWithdrawAmount = { private ["_amount","_bank","_wealth"]; _amount = parseNumber (_this select 0); _bank = player getVariable ["bankMoney", 0]; _wealth = player getVariable["cashMoney",0]; if (LimitOnPlayer && ((_wealth + _amount ) > MaxPlayerCoins )) exitWith { cutText ["You can only carry 950,000", "PLAIN DOWN"];}; if(_amount > 950000) exitWith { cutText ["You can not withdraw more then 950,000 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"]; }; Also you will need to make an adjustment in your variables.sqf where the max bank amount is and add the limit on player is true or false and the amount . CurrencyName = "Coins"; // name of your currency LimitOnBank = true; // false = no limits, true = banks are limited on the value below MaxBankMoney = 1000000; // limit on bank for normal players DonatorBank = ["0"]; // Bigger banks, Players ID MaxDonatorBankMoney = 3000000; // Bank size for donators InstantTrading = true; // (True = No Animation / False = Animation) LimitOnPlayer = true; MaxPlayerCoins = 950000; If you read thru the dialogs and look carefull they will make sense and you will understand it . in this way you can cap anything you want with the coin system . giving money , banking money just about anything you just need to carefully read the coin init and try to understand it a bit . I did not come from a computer background infact few months ago i never seen a server file and i am a Carpenter but its not superhard just as long as you read carefully . Link to comment Share on other sites More sharing options...
0 creativv Posted December 27, 2015 Report Share Posted December 27, 2015 I did the same thing in the giveplayeramount ill show you . GivePlayerAmount = { private ["_amount","_target","_wealth"]; _amount = parseNumber (_this select 0); _target = cursorTarget; _wealth = player getVariable["cashMoney",0]; _twealth = _target getVariable["cashMoney",0]; _InTrd = _target getVariable ["TrBsy",false]; _isMan = _target isKindOf "Man"; if (_amount < 1 or _amount > _wealth) exitWith { cutText ["You can not give more than you currently have.", "PLAIN DOWN"]; }; if (LimitOnPlayer && ((_twealth + _amount ) > MaxPlayerCoins )) exitWith { //This is what i added cutText ["Player has to many coins you can only carry 950,000", "PLAIN DOWN"]; }; if (!_isMan) exitWith { cutText ["You are not facing anyone.", "PLAIN DOWN"]; }; if (_wealth == _twealth) exitWith { cutText ["FAILED : Both Targets have same amount of money.", "PLAIN DOWN"]; }; if (_InTrd) exitWith { cutText ["Other Player is busy, please wait.", "PLAIN DOWN"]; }; you can see the explantions of for example _twealth its says : _twealth = _target getVariable["cashMoney",0]; so it means that _twealth is the coins of the target you are trying to give coins to and then _amount = parseNumber (_this select 0); is the ammount the player wants to give . so (_twealth + _amount ) if they add up to more then the LimitOnPlayer you created in variables the script will end with a cuttext saying its not possible because it is to much . Hope you understood it a bit since i am typing really fast in a hurry :D Link to comment Share on other sites More sharing options...
0 creativv Posted December 27, 2015 Report Share Posted December 27, 2015 Dont just copy stuff over but try to understand it a little bit , there is a great video made by Raymix that actually helpen me so much to understand allot . Believe me i am far from being a dev or a supermodder but i do try to understand the concepts instead of trying to copy it over without even understanding and believe me you will need that simply because not every script will cooperate with eachother and you will need to have at least a bit of understanding . If you ever need some help i am Always willing to help a bit . Link to comment Share on other sites More sharing options...
0 creativv Posted December 27, 2015 Report Share Posted December 27, 2015 Just now, creativv said: Dont just copy stuff over but try to understand it a little bit , there is a great video made by Raymix that actually helpen me so much to understand allot . Believe me i am far from being a dev or a supermodder but i do try to understand the concepts instead of trying to copy it over without even understanding and believe me you will need that simply because not every script will cooperate with eachother and you will need to have at least a bit of understanding . If you ever need some help i am Always willing to help a bit . Sorry moderators for spamming a bit in posts :D https://www.youtube.com/watch?v=cN9ob9FPUHY the video by raymix its a bit long but really good Link to comment Share on other sites More sharing options...
0 Joshyy Posted December 28, 2015 Author Report Share Posted December 28, 2015 17 hours ago, creativv said: 17 hours ago, creativv said: Dont just copy stuff over but try to understand it a little bit , there is a great video made by Raymix that actually helpen me so much to understand allot . Believe me i am far from being a dev or a supermodder but i do try to understand the concepts instead of trying to copy it over without even understanding and believe me you will need that simply because not every script will cooperate with eachother and you will need to have at least a bit of understanding . If you ever need some help i am Always willing to help a bit . Thanks for the video, currently watching it. Link to comment Share on other sites More sharing options...
0 creativv Posted December 28, 2015 Report Share Posted December 28, 2015 2 hours ago, Joshyy said: Thanks for the video, currently watching it. Great , it will be very educational . Link to comment Share on other sites More sharing options...
Question
Joshyy
There is a major problem with the coin system on my server.
People are able to give coins to someone/buy a vehicle and then re-log/die and have the money back?
Any tips on fixing this,
thanks!
Link to comment
Share on other sites
17 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now