mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 02:08:55 +00:00
feat(esx_property): Reasons For account changes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user