What's new

Guide Making Disc-Inventoryhud Money Items

Lilibeth

Gold Elite
Joined
Jul 4, 2021
Messages
186
Reaction score
42,649
Points
316
✌️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
146
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
22
Reaction score
0
Points
166
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: 826

JHShovon

Member
Joined
Aug 24, 2021
Messages
22
Reaction score
0
Points
166
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: 236

Kasch88

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

barwk781

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

Attachments

  • Attachment.png
    Attachment.png
    1.6 MB · Views: 229
Joined
Nov 1, 2021
Messages
1
Reaction score
0
Points
156
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 ?
 

Niff

Member
Joined
Jan 27, 2022
Messages
2
Reaction score
0
Points
146
Location
Polska
✌️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 ✅ :


Men i have problem becose i don't see black money in inventory pliss help
 
Top