From 7963d1ec5ba983ebf2d8be37ec4193ab742d566a Mon Sep 17 00:00:00 2001 From: Fraser Watt <28698343+FrazzIe@users.noreply.github.com> Date: Sun, 5 Jan 2025 00:23:41 +0000 Subject: [PATCH 1/4] fix images not updating correctly in ps-realtor --- client/cl_property.lua | 2 +- server/sv_property.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/cl_property.lua b/client/cl_property.lua index 89c7f2c..94f55ca 100644 --- a/client/cl_property.lua +++ b/client/cl_property.lua @@ -879,7 +879,7 @@ function Property:UpdateOwner(newOwner) end function Property:UpdateImgs(newImgs) - self.propertyData.imgs = newImgs + self.propertyData.extra_imgs = newImgs end function Property:UpdateDoor(newDoor, newStreet, newRegion) diff --git a/server/sv_property.lua b/server/sv_property.lua index b0ae870..b3472c4 100644 --- a/server/sv_property.lua +++ b/server/sv_property.lua @@ -404,7 +404,7 @@ function Property:UpdateImgs(data) local imgs = data.imgs local realtorSrc = data.realtorSrc - self.propertyData.imgs = imgs + self.propertyData.extra_imgs = imgs MySQL.update("UPDATE properties SET extra_imgs = @extra_imgs WHERE property_id = @property_id", { ["@extra_imgs"] = json.encode(imgs), From 1cd4f4f15d67c159ca481792fd4005672e58d494 Mon Sep 17 00:00:00 2001 From: Fraser Watt <28698343+FrazzIe@users.noreply.github.com> Date: Sun, 5 Jan 2025 19:30:56 +0000 Subject: [PATCH 2/4] only give door access after they have purchased the property --- server/sv_property.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/sv_property.lua b/server/sv_property.lua index b3472c4..b5bae19 100644 --- a/server/sv_property.lua +++ b/server/sv_property.lua @@ -329,11 +329,6 @@ function Property:UpdateOwner(data) local bank = PlayerData.money.bank local citizenid = PlayerData.citizenid - self:addMloDoorsAccess(citizenid) - if self.propertyData.shell == 'mlo' and DoorResource == 'qb' then - Framework[Config.Notify].Notify(targetSrc, "Go far away and come back for the door to update and open/close.", "error") - end - if self.propertyData.owner == citizenid then Framework[Config.Notify].Notify(targetSrc, "You already own this property", "error") Framework[Config.Notify].Notify(realtorSrc, "Client already owns this property", "error") @@ -381,6 +376,11 @@ function Property:UpdateOwner(data) realtor.Functions.AddMoney('bank', commission, "Commission from Property: " .. self.propertyData.street .. " " .. self.property_id) + self:addMloDoorsAccess(citizenid) + if self.propertyData.shell == 'mlo' and DoorResource == 'qb' then + Framework[Config.Notify].Notify(targetSrc, "Go far away and come back for the door to update and open/close.", "error") + end + self.propertyData.owner = citizenid MySQL.update("UPDATE properties SET owner_citizenid = @owner_citizenid, for_sale = @for_sale WHERE property_id = @property_id", { From cd74188c66e2cf1d6b81b47dff25cb8353f1b9df Mon Sep 17 00:00:00 2001 From: Fraser Watt <28698343+FrazzIe@users.noreply.github.com> Date: Sun, 5 Jan 2025 19:37:37 +0000 Subject: [PATCH 3/4] prevent negative property prices, increase max price with uint32 --- .../QBCore/properties_unsigned_price.sql | 2 ++ .../QBOX/properties_unsigned_price.sql | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 README - INSTALL INSTRUCTIONS/QBCore/properties_unsigned_price.sql create mode 100644 README - INSTALL INSTRUCTIONS/QBOX/properties_unsigned_price.sql diff --git a/README - INSTALL INSTRUCTIONS/QBCore/properties_unsigned_price.sql b/README - INSTALL INSTRUCTIONS/QBCore/properties_unsigned_price.sql new file mode 100644 index 0000000..048f042 --- /dev/null +++ b/README - INSTALL INSTRUCTIONS/QBCore/properties_unsigned_price.sql @@ -0,0 +1,2 @@ +UPDATE `properties` SET `price` = 0 WHERE `price` < 0; +ALTER TABLE `properties` MODIFY COLUMN `price` INT(11) UNSIGNED NOT NULL DEFAULT '0'; \ No newline at end of file diff --git a/README - INSTALL INSTRUCTIONS/QBOX/properties_unsigned_price.sql b/README - INSTALL INSTRUCTIONS/QBOX/properties_unsigned_price.sql new file mode 100644 index 0000000..048f042 --- /dev/null +++ b/README - INSTALL INSTRUCTIONS/QBOX/properties_unsigned_price.sql @@ -0,0 +1,2 @@ +UPDATE `properties` SET `price` = 0 WHERE `price` < 0; +ALTER TABLE `properties` MODIFY COLUMN `price` INT(11) UNSIGNED NOT NULL DEFAULT '0'; \ No newline at end of file From 5c4e17c792d8a4ec76ea2083b398de9dbad2b707 Mon Sep 17 00:00:00 2001 From: Fraser Watt <28698343+FrazzIe@users.noreply.github.com> Date: Sun, 5 Jan 2025 19:38:19 +0000 Subject: [PATCH 4/4] remove unused config option --- shared/config.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/shared/config.lua b/shared/config.lua index 69ce206..487e12e 100644 --- a/shared/config.lua +++ b/shared/config.lua @@ -69,9 +69,6 @@ Config.Commissions = { -- Set this value to false if you don't want to assign a starting apartment. Config.StartingApartment = true ---- With this enabled, the customizer will open when starting apartment is false. -Config.ShowCustomizerWhenNoStartingApartment = true - Config.Apartments = { ["Integrity Way"] = { label = "Integrity Way",