Jump to content
199918hao

Question about a store money system

Recommended Posts

params [
	["_unit", objNull, [objNull]],
	["_funds", 0, [0]]
];

if (!local _unit) exitWith {
	[_unit, _funds] remoteExec ["HALs_money_fnc_addFunds", _unit, false];
};

if (_funds < 0) then {
  _funds = ceil _funds;
} else {
  _funds = floor _funds;
};

if (_funds isEqualTo 0) exitWith {};

// Remove money
if (_funds < 0) then {
  for "_i" from 1 to (abs _funds) do {
    _unit removeItem "rvg_money";
  };
} else {
  _unit addMagazines ["rvg_money", _funds];
};

So after I use these codes, the balance will not decrease after purchasing, and there is no change. Why?  The "rvg_money" is item of money.

  • Like 1

Share this post


Link to post
Share on other sites

Try removeMagazine like Schatten suggested.

Also I don’t think it was entirely necessary to create a new thread when you have already posted a few times in the original thread.

  • Like 1

Share this post


Link to post
Share on other sites

As mentioned above. If it is a magazine then use removeMagazine and if item then use removeItem as you did. Is it a variable?

rvg_money = 100; // start balance
rvg_money = rvg_money - 50; // 50 cost of item

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×