From a57a5d8e36e4810702ed362940f481c0734e648f Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sat, 10 Sep 2022 00:51:14 +0100 Subject: [PATCH] fix(esx_property): Selling to other players was removing from wrong account --- [esx_addons]/esx_property/server/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/[esx_addons]/esx_property/server/main.lua b/[esx_addons]/esx_property/server/main.lua index 440ad971..40738f12 100644 --- a/[esx_addons]/esx_property/server/main.lua +++ b/[esx_addons]/esx_property/server/main.lua @@ -180,7 +180,7 @@ ESX.RegisterServerCallback("esx_property:buyProperty", function(source, cb, Prop local xPlayer = ESX.GetPlayerFromId(source) local Price = Properties[PropertyId].Price if xPlayer.getAccount("bank").money >= Price then - xPlayer.removeAccountMoney("bank", Price) + xPlayer.removeAccountMoney("bank", Price, "Bought Property") Properties[PropertyId].Owner = xPlayer.identifier Properties[PropertyId].OwnerName = xPlayer.getName() Properties[PropertyId].Owned = true @@ -200,7 +200,7 @@ ESX.RegisterServerCallback("esx_property:attemptSellToPlayer", function(source, local xTarget = ESX.GetPlayerFromId(PlayerId) local Price = Properties[PropertyId].Price if xTarget and (xTarget.getAccount("bank").money >= Price) and (xPlayer.job.name == PM.job) then - xPlayer.removeAccountMoney("bank", Price) + xTarget.removeAccountMoney("bank", Price, "Sold Property") Properties[PropertyId].Owner = xTarget.identifier Properties[PropertyId].OwnerName = xTarget.getName() Properties[PropertyId].Owned = true