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
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 :
Hidden link for visitors, to see
Log in or register now.
Virus Total :
Hidden link for visitors, to see
Log in or register now.