Jump to content
  • 0

HOWTO deposit/withdraw money (from bankAccount) & (from player's cash)?


mgm

Question

Hi guys,

 

In Arma2Epoch I was using Zupa's Single Currency system and the developer functions allowed me to add/remove money:

 

How can I do the same in Arma3Epoch? Simply put, from inside a server-side SQF script, I would like to do things like:

  • add n krypto to playerBankAccount
  • remove n krypto from playerBankAccount
  • add n krypto to playerCash
  • remove n krypto from playerCash

Thanks!

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0

I have a paycheque script running on my server, you can see from that how you can check the amount players have and how to add Krypto, not sure of the commands for the bank balance though (if there are any).

while {true} do 
{
	sleep 300;
	if(EPOCH_playerCrypto < 991) then
	{
		EPOCH_playerCrypto = EPOCH_playerCrypto + 10;
		systemchat("You have just received 10 Krypto");
	};

	if(EPOCH_playerEnergy < 991) then
	{
		EPOCH_playerEnergy = EPOCH_playerEnergy + 10;
		systemchat("You have just received 10 Energy");
	};		
};
Link to comment
Share on other sites

  • 0

I have a paycheque script running on my server, you can see from that how you can check the amount players have and how to add Krypto, not sure of the commands for the bank balance though (if there are any).

 

while {true} do 
{
	sleep 300;
	if(EPOCH_playerCrypto < 991) then
	{
		EPOCH_playerCrypto = EPOCH_playerCrypto + 10;
		systemchat("You have just received 10 Krypto");
	};

	if(EPOCH_playerEnergy < 991) then
	{
		EPOCH_playerEnergy = EPOCH_playerEnergy + 10;
		systemchat("You have just received 10 Energy");
	};		
};

Thanks buddy, I will test this soon.

 

 

 

Still need the bank functions :(

Link to comment
Share on other sites

  • 0

The money is in the redis you can add/subtract money there, I had a script that every night would give an interest for the money in the bank

10 hours alive where 1% of the money in your bank, had a guy that just spawn in his base and stayed there he had over 100 hours alive wich is 10%

Thanks for this.

I was hoping to add/remove from within an SQF - just like Zupa's simple and bril SCadd SCremove functions.

How did you do this, as O/S level scheduled maintenance task?

You think it can be done from SQF? I called SQF from an SQF but never a BAT/CMD/EXE from an SQF (even if it's possible).

You think it'd ve too slow?

Sorry for the 20 questions. My first. I'm scared :)

Link to comment
Share on other sites

  • 0

You would trigger the batch file using BEC scheduling and use either the redis command line or php to perform the database changes.

Thanks for this - let me see if I got that right:

 

Let's say playerA wish to use the taxi service - he will have to pay (say 100 krypto)  for the service but he has no cash on him, no worries we accept bank transfer too, right?

 

We provide the service and at the same time make a record of playerA's playerUID and the outstanding amount (100 krypto in this case). ArmaServer.exe is still running and this underlined information above is in memory allocated to ArmaServer.exe.

 

As a separate process, Bec's scheduled task launcher [or Windows or Cygwin scheduler] launch a Windows process, it is a process that launches redis command line utilities, connects to the live Arma3Epoch database, and  manipulates the "PlayerA_PlayerUID: BANK_BALANCE=9000"  key in the database. Is that right?

 

How would the 2nd process know which playerUID to modify and how much exactly to add/remove?

It has, so far, no connection to the underlined bit of information, which resides in server memory.

 

How do you connect these two processes?

Link to comment
Share on other sites

  • 0

I'm not sure adjusting the balance in the database reflects in game immediately, I'd try editing it manually using RedisDesktopManager and see if it works before investing any effort into it.

I would have thought there was a way to manipulate the bank balance in the same way you can manipulate the currency that people have on them

Link to comment
Share on other sites

  • 0

I'm not sure adjusting the balance in the database reflects in game immediately, I'd try editing it manually using RedisDesktopManager and see if it works before investing any effort into it.

I would have thought there was a way to manipulate the bank balance in the same way you can manipulate the currency that people have on them

I assumed that was the case...

 

*bump*

Could an enlightened one please tell us how (or whether) can it be done? epochBankBal = epochBankBal - 50; //no?

Link to comment
Share on other sites

  • 0

I have a paycheque script running on my server, you can see from that how you can check the amount players have and how to add Krypto, not sure of the commands for the bank balance though (if there are any).

 

while {true} do 
{
	sleep 300;
	if(EPOCH_playerCrypto < 991) then
	{
		EPOCH_playerCrypto = EPOCH_playerCrypto + 10;
		systemchat("You have just received 10 Krypto");
	};

	if(EPOCH_playerEnergy < 991) then
	{
		EPOCH_playerEnergy = EPOCH_playerEnergy + 10;
		systemchat("You have just received 10 Energy");
	};		
};

But this script in bugy....

 

10:13:37 Error in expression <e.sqf" while {true} do { sleep 300; if(EPOCH_playerCrypto < 991) then { EPOCH_p> 10:13:37 Error position: <EPOCH_playerCrypto < 991) then { EPOCH_p> 10:13:37 Error Undefined variable in expression: epoch_playercrypto 10:13:37 File mpmissions\__cur_mp.Altis\custom\paycheque.sqf, line 4

 

Know some1 where is the problem?

Link to comment
Share on other sites

  • 0

But this script in bugy....

 

10:13:37 Error in expression <e.sqf" while {true} do { sleep 300; if(EPOCH_playerCrypto < 991) then { EPOCH_p> 10:13:37 Error position: <EPOCH_playerCrypto < 991) then { EPOCH_p> 10:13:37 Error Undefined variable in expression: epoch_playercrypto 10:13:37 File mpmissions\__cur_mp.Altis\custom\paycheque.sqf, line 4

 

Know some1 where is the problem?

 

You can't modify Crypto client side any more, it has to be done server side.

Link to comment
Share on other sites

  • 0

Subtracting Krypto still works, if you try to add it, then it zeros your balance. It's possible that it is iniSTAR stopping it though as I haven't tried the stock AH recently.

Gotcha thx

Edit what's this lame anti hack? Lol

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...