Transaction log for player spending and ernings

I would like to know if there is a resource for logging/saving all earnings and spending within the server?

Something like a bank’s credit and debit sheet but with more details like the source of income and the type of expense.

Thank you.

2 Likes

I’ve written a system like this in the ESX framework before, it just requires some editing in the Player class object on all the functions that add and remove money, that can be done with any framework that enforces handling the money changes.

The difficult part is going through all your other resources that use these functions to add and remove money and edit them also to include the detail text that you want to save in your credit/debit table in the database.

Even if you do write something standalone for this you would still need to go through all your scripts and implement your custom call to track the money changes with reasons and it would need to first know the result of change sent back to it from the script that is making the money changes. Since that required editing of the main player object anyways I decided to just implement it all there and do xPlayer.addMoney(money, reason), xPlayer.removeMoney(money, reason), etc.

1 Like

Thank you for the reply Anders. I finally went with what you suggested. went through almost all resources about game economy and added a code snippet to save transactions to the database.

2 Likes

can you write one i can pay for it

Hi, sorry for the late reply. I actually written one to track expenses, but I was out of the active development for some time I don’t even remember how I integrate it with player character. I will try to fire up the dev environment and see if I can figure something out :slight_smile: