Welcome to the forum, Guest

To access forum content and all of our services, you must register or log in to the forum. Joining the forum and all content on the forum is completely free.

The world's largest FiveM Forum and GTA 5 Forum address

Hello dear member,
We work 24/7 to provide the most valuable content that will be of use to you,
you can share content and support the entire FiveM & GTA 5 community.

Guide Making Disc-Inventoryhud Money Items

Meta

Super Moderator
Joined
Jul 4, 2021
Messages
188
Reaction score
293
Points
251
✌️Hello VAG Forum Family✌️

I wanted to share it with you because I think it is a topic that many people are looking for and will work



❓How do we turn money into an item❓
Find the following code from line 27 of es_extended\server\lasses\player.lua;
Code:
self.getMoney = function()
return self.player.get('money')
end

Replace this code with the code below;
Code:
self.getMoney = function()
local money = self.getInventoryItem('cash')
if self.player.get('money') ~= money.count then
self.player.set('money',money.count)
end
return money.count
end

Find the following code from line 65 of es_extended\server\lasses\player.lua;
Code:
self.addMoney = function(money)
money = ESX.Math.Round(money)
if money >= 0 then
self.player.addMoney(money)
else
print(('es_extended: %s attempted exploiting! (reason: player tried adding -1 cash balance)'):format(self.identifier))
end
end
self.removeMoney = function(money)
money = ESX.Math.Round(money)
if money >= 0 then
self.player.removeMoney(money)
else
print(('es_extended: %s attempted exploiting! (reason: player tried removing -1 cash balance)'):format(self.identifier))
end
end

Replace this code with the code below;
Code:
self.addMoney = function(money)
money = ESX.Math.Round(money)
if money >= 0 then
self.addInventoryItem("cash",money)
local money = self.getInventoryItem('cash')
if self.player.get('money') ~= money.count then
self.player.set('money',money.count)
end
else
print(('es_extended: %s attempted exploiting! (reason: player tried adding -1 cash balance)'):format(self.identifier))
end
end
self.removeMoney = function(money)
money = ESX.Math.Round(money)
if money >= 0 then
self.removeInventoryItem("cash",money)
local money = self.getInventoryItem('cash')
if self.player.get('money') ~= money.count then
self.player.set('money',money.count)
end
else
print(('es_extended: %s attempted exploiting! (reason: player tried removing -1 cash balance)'):format(self.identifier))
end
end

🔴 After completing these operations, you need to come to your own database in the HeidiSQL application and create an item named 'cash' in the item table.

📥 player.lua Download 📥 :
✅
Virus Total ✅ :


 

sjiojaufj

Member
Joined
Jun 29, 2021
Messages
1
Reaction score
0
Points
86
Is there a way to make black_money do the same thing been trying to get black money as an item for a while now
 

JHShovon

Member
Joined
Aug 24, 2021
Messages
4
Reaction score
0
Points
41
Thanks a lot. it worked. But there is an issue! Only 100 cash is showing on one slot. Any way to fix it?
 

Attachments

  • 20210913141345_1.jpg
    20210913141345_1.jpg
    561.3 KB · Views: 189

JHShovon

Member
Joined
Aug 24, 2021
Messages
4
Reaction score
0
Points
41
Sorry for the late reply!

Just do this on disc_inventory_itemdata table. Here max is the number of how much cash/item will be on one slot
 

Attachments

  • Screenshot 2021-12-01 193617.png
    Screenshot 2021-12-01 193617.png
    23.4 KB · Views: 40

Kasch88

Member
Joined
Nov 14, 2021
Messages
1
Reaction score
0
Points
16
Location
America
No where do I put the code in the files?
 
Last edited:

barwk781

Member
Joined
Dec 23, 2021
Messages
1
Reaction score
0
Points
16
Location
Gdynia
hello i don't have left table of items how to fix that?
 

Attachments

  • Attachment.png
    Attachment.png
    1.6 MB · Views: 12
Joined
Nov 1, 2021
Messages
1
Reaction score
0
Points
16
Location
Portugal
Sorry for the late reply!

Just do this on disc_inventory_itemdata table. Here max is the number of how much cash/item will be on one slot
then, when i want to withdraw money, it doesnt work, do i have to add code in the bank system ?
 

Login or register to get more out of the forum!

Login or register to get more out of the forum!

Register

Creating an account on the forum is completely free.

Register now
Log in

If you have an account, please login

Log in

Theme editor

Theme customizations

Graphic Backgrounds

Granite Backgrounds