feat(esx_property): Reasons For account changes

This commit is contained in:
Mycroft
2022-09-10 00:52:34 +01:00
parent a57a5d8e36
commit ebaad4fa06
+3 -3
View File
@@ -218,7 +218,7 @@ ESX.RegisterServerCallback("esx_property:attemptSellToPlayer", function(source,
TriggerEvent('esx_addonaccount:getSharedAccount', PM.society, function(account)
account.addMoney(SocietyPrice)
end)
xPlayer.addAccountMoney("bank", PlayerPrice)
xPlayer.addAccountMoney("bank", PlayerPrice, "Sold Property")
end
end
cb(xPlayer.getAccount("bank").money >= Price)
@@ -231,7 +231,7 @@ ESX.RegisterServerCallback("esx_property:buyFurniture", function(source, cb, Pro
if xPlayer.identifier == Owner or IsPlayerAdmin(source) or (Properties[PropertyId].Keys and Properties[PropertyId].Keys[xPlayer.identifier]) then
local Price = Config.FurnitureCatagories[PropCatagory][PropIndex].price
if xPlayer.getAccount("bank").money >= Price then
xPlayer.removeAccountMoney("bank", Price)
xPlayer.removeAccountMoney("bank", Price, "Furniture")
cb(true)
local furniture = {Name = PropName, Index = PropIndex, Catagory = PropCatagory, Pos = pos, Heading = heading, Price = Price}
table.insert(Properties[PropertyId].furniture, furniture)
@@ -265,7 +265,7 @@ ESX.RegisterServerCallback("esx_property:sellProperty", function(source, cb, Pro
local Owner = Properties[PropertyId].Owner
if xPlayer.identifier == Owner then
local Price = ESX.Math.Round(Properties[PropertyId].Price * 0.6)
xPlayer.addAccountMoney("bank", Price)
xPlayer.addAccountMoney("bank", Price, "Sold Property")
Properties[PropertyId].Owner = ""
Properties[PropertyId].OwnerName = ""
Properties[PropertyId].Owned = false