Jump to content

Check wallet dupe


Recommended Posts

Today a player came to me and told me he had 600 milion on his bank :P

Asked him how he got all those coins and he told me the following:

 

When you check an AI's wallet and take some coins, check the wallet again and it tells you: Took 0 coins from ......

 

On that moment, the players money turns to 0 and when he goes to a bank, he can deposit unlimited amounts of coins.

 

If, after the above, he buys stuff, his money will go negative.

 

 

Big problem i think, so is there any fix for this?

Its not only works with AI. With players too.. Need to Check Wallet a lot of times, then your _cashMoney = scalar ... not numbers.. it will be "scalar". And u can make with this scalar what u want. Place in bank a 99999999999 money. Your wallet will be OK after your die. And if ull check wallet of ur coprse, ull get "scalar" again..

 

Dont know too how to fix it.

Link to comment
Share on other sites

  • 1 year later...

Have dirty fix for all this :)

fn_selfActions.sqf - Find following:

if (_isMan && !_isZombie && !_isAnimal) then {
			_player_studybody = true;
		}

Replace to this:


if (_isMan && !_isZombie && !_isAnimal && _ownerID != "0") then {
			_player_studybody = true;
		}

And this is my check_wallet.sqf

private ["_body", "_hisMoney", "_myMoney", "_killsH", "_test2", "_headShots", "_test","_playeridke","_humanity"];

_body = _this select 3;
_walletCheck = _body getVariable ["cashMoney",0];
_PlayerNear = _body call dze_isnearest_player;

if (_walletCheck == 0) exitWith {cutText [format["Wallet is empty."], "PLAIN DOWN"]};
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 Credits, From: %2 !',_hisMoney,_name];
sleep 2;

_cid =	player getVariable ["CharacterID","0"];
_cashMoney = player getVariable ["cashMoney",0];

if(_cashMoney > 0) then{

} else {

_cashMoney = 0;

};

 

Link to comment
Share on other sites

10 hours ago, KoTaS said:

Have dirty fix for all this :)

fn_selfActions.sqf - Find following:


if (_isMan && !_isZombie && !_isAnimal) then {
			_player_studybody = true;
		}

Replace to this:



if (_isMan && !_isZombie && !_isAnimal && _ownerID != "0") then {
			_player_studybody = true;
		}

And this is my check_wallet.sqf


private ["_body", "_hisMoney", "_myMoney", "_killsH", "_test2", "_headShots", "_test","_playeridke","_humanity"];

_body = _this select 3;
_walletCheck = _body getVariable ["cashMoney",0];
_PlayerNear = _body call dze_isnearest_player;

if (_walletCheck == 0) exitWith {cutText [format["Wallet is empty."], "PLAIN DOWN"]};
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 Credits, From: %2 !',_hisMoney,_name];
sleep 2;

_cid =	player getVariable ["CharacterID","0"];
_cashMoney = player getVariable ["cashMoney",0];

if(_cashMoney > 0) then{

} else {

_cashMoney = 0;

};

 

omg i've been messing around trying to figure this out for the past few days...thank you thank you thank you

If i read correctly the selfactions changes it so you can only recover money from yourself, correct?

I have my AIs give you money when you kill them, like the humanity.  I wanted to remove the check wallet option only from AIs.

Link to comment
Share on other sites

10 hours ago, KoTaS said:

&& _ownerID != "0"

In selfAction makes so only charracter with ID see option to Check Wallet, this makes so no AI Bots have option Check Wallet on them.

its been tested and i dont get the option to check wallet on my corpse.  Would it be because im using plot 4 life?

I tried removing the != "0" and it did the same thing.

Thanks in advance

 

EDIT: so it seems it must be plot for life.  I had to change the 

&& _ownerID != "0"

to

&& _characterID != "0"

Many thx

Link to comment
Share on other sites

Iam glad you found even more solutions for fellow server owners :)

This one is my check_wallet.sqf and its modded for my server, but what it does is check in dead player body / Dead AI's for coins and if it has 0 coins it will give "Wallet is empty" message and exits the further script code so he wont bug coins with 0 again as mentioned in this topic with AI's

Spoiler

private ["_body", "_hisMoney", "_myMoney"];

_body = _this select 3;
_walletCheck = _body getVariable ["cashMoney",0];
_PlayerNear = _body call dze_isnearest_player;

if (_walletCheck == 0) exitWith {cutText ["Wallet is empty.", "PLAIN DOWN"];};
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 Credits, From: %2 !',_hisMoney,_name];
sleep 2;

_cid =	player getVariable ["CharacterID","0"];
_cashMoney = player getVariable ["cashMoney",0];

if(_cashMoney > 0) then{

} else {

_cashMoney = 0;

};

 

 

 

Link to comment
Share on other sites

  • 1 year later...

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
  • Advertisement
  • Discord

×
×
  • Create New...