Shopping Cart
FiveM script ESXLog Money Transfers Tutorial Modding Tutorials

[ESX]Log Money Transfers [Tutorial] – Modding Tutorials

FiveM Modding Tutorial

Hey guys, So I have had this for a while its an easy simple little thing for you guys, Iโ€™m not releasing the entire es_extended but here is the what I use and how to use it and where to put it for you guys its sort of essential if you want to keep track of transfers of money or other things depending on how you implement it, this could be implemented into different things as well. I know this is common sense but a lot of people are having issues with it so I decided to release it to the public so you guys can enjoy.

SQL Query To create table

CREATE TABLE IF NOT EXISTS `transfer` (
  `Sender` varchar(50) DEFAULT NULL,
  `Type` varchar(50) DEFAULT NULL,
  `Amount` int(11) DEFAULT NULL,
  `Reciever` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Money Transfer Information';

Add this to your es_extendedservermain.lua where you give item_money and item_account
Item_money – line 294 (add)

MySQL.Async.execute('INSERT INTO transfer (Sender, Type, Amount, Reciever)VALUES (@Sender, @Type, @Amount, @Reciever) ',
            {
                    ['@Sender']   = sourceXPlayer.name,
                    ['@Type']   = 'Cash',
                    ['@Amount']    = itemCount,
                    @Reciever    = targetXPlayer.name

        }
            )

item_account – Line 318 (add)

			MySQL.Async.execute('INSERT INTO transfer (Sender, Type, Amount, Reciever)VALUES (@Sender, @Type, @Amount, @Reciever) ',
            {
                    ['@Sender']   = sourceXPlayer.name,
                    ['@Type']   = 'Cash',
                    ['@Amount']    = itemCount,
                    ['@Reciver']    = targetXPlayer.name

        }
            )

I know this is not just a file to download its a little work but its common sense, and this will log those individual transfers you can also log other things if youโ€™d like by just altering the SQL Execute.
What it will look like
image



Original source: https://forum.cfx.re/t/esx-log-money-transfers-tutorial/283041

Leave a Reply
FiveM ESX Scripts

The best scripts and maps

Best support

Problems? We are there to help!

Wide range of products

We have a wide range of products

100% Secure Checkout

Stripe