Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ps-realtor: full user interface overhaul additional fixes #271

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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';
Original file line number Diff line number Diff line change
@@ -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';
2 changes: 1 addition & 1 deletion client/cl_property.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions server/sv_property.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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", {
Expand All @@ -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),
Expand Down
3 changes: 0 additions & 3 deletions shared/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down