Onforum.net - Web and gaming resource community

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members .

FiveM Making Disc-Inventory - hud Money Items

ZaraZa

Administrator
Administrator
Credits
290
How do we turn money into an item
[/B] self.getMoney = function() return self.player.get('money') end [B]

[/B] 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 [B]

[/B] 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 [B]


[/B] 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 [B]


IMPORTANT:
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.
 
Top

Dear User!

We found that you are blocking the display of ads on our site.

Please add it to the exception list or disable AdBlock.

The advertises that you'll see aren't intrusive they just help us to keep the community alive

If you don't want to see those ads just buy an upgrade.

Thank you for understanding!

Slait

Slait Purchase

User upgrade! at

🔥 Upgrade Now
edemhu

edemhu Purchase

User upgrade! at

🔥 Upgrade Now
maxpoint012

maxpoint012 Purchase

User upgrade! at

🔥 Upgrade Now