Jump to content
  • 0

Coin Problem/Exploit


Joshyy

Question

17 answers to this question

Recommended Posts

  • 0

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

  • 0

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

  • 0

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

  • 0
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

  • 0
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

  • 0
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

  • 0

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

  • 0

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

  • 0

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

  • 0
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

  • 0
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...