[ESX]Log Money Transfers [Tutorial]

Does This Help?

  • Yes
  • No

0 voters

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_extended\server\main.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

Don’t forget to drop a like :+1: :heart:

25 Likes

Nice Work :wink:

wow, nice work dudee!

in my es_extended\server\main.lua:294
dont stand something with item_money? pls help

pls gimme a tutorial for beginners :slight_smile:

Thank you! I would recommend for people that use [Release] [ESX] /transfervehicle (Simple script addon to transfer your vehicles) to log it aswell.

My way of usage:

CREATE TABLE IF NOT EXISTS `transfer_vehicle` (
  `Sender` varchar(50) DEFAULT NULL,
  `Plate` varchar(50) DEFAULT NULL,
  `Reciever` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Vehicle Transfer Information';
MySQL.Async.execute('INSERT INTO transfer_vehicle (Sender, Plate, Reciever)VALUES (@Sender, @Plate, @Reciever) ',
	{
		['@Sender']   = mySteamID,
		['@Plate']   = plate,
		['@Reciever']    = targetSteamID

	}
)

I just made it, havent tried it yet.

1 Like

That’s actually pretty cool. I had a logging for that resource but I never released it as I thought people would not care. Glad to see people still loving that resource :slight_smile:

1 Like

dude can u help me why ??
image

There is a spelling error in Receiver. Go back through the item_account and item_money and respell @reciver to @receiver

1 Like

aw thx dude, i hope it will work after restart server. Thx

How would I add local time(and date) to the table?

@control

Add another table like this.

image

the problem is that it only logs cash that you give the player on hand how too add Bank and dirty money?

In my Line 294 is standing “else” - hint :wink:

grafik

And I give it one time and table says two times…

I give money and i get money evertime standing NULL there, why?

Reciever me null helpme pls

@Ton_GameMua

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,
                    ['@Receiver']    = targetXPlayer.name

        }
            )

There is a spelling mistake in the original post, use the above.

1 Like

this logs only Cash that you give from player to player how we can make to log bank

1 Like

where add the line EXACTLY ? pls, have error “Reiciver” NULL.

cause you spelt Reciever like Reiciver

thanks for responding very fast, I have a question

"@Reciver " and “Reciever”

hould not they have the same name?

I know very little about this, but can this cause me to get “NULL”?

image

------- UPGRADE —

try to put what suggested and worked, thank you very much for your contribution friend.

	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

        }
            )

I only need the vehicles that I do not know exactly where to put the line on which side exactly it is, please help me a lot in fixing it. Thank you.