project-sloth / ps-housing Goto Github PK
View Code? Open in Web Editor NEWAdvanced housing system for QBCore.
Home Page: https://discord.gg/projectsloth
License: Other
Advanced housing system for QBCore.
Home Page: https://discord.gg/projectsloth
License: Other
The images on shared/config.lua:427
and below are not available when I try to view the links on a browser.
If you give someone access to your property, they will not have access to your property's garage. Only the owner has access to the garage.
I think the garage should function similar to a shared gang garage, but only for the people who have access to this property.
To implement this we need to look more into how we are creating the garage through qb-garages. I know it supports giving job/gangs a shared garage, not sure if it has default support for giving access to a list of citizenIds tho
File: ps-housing/properties.sql (if this doesn't work for you then use the other one #8)
This was fixed but it was still causing errors, here is one that is not causing an error at least on my side:
DROP table IF EXISTS
properties`;
CREATE TABLE IF NOT EXISTS properties
(
property_id
int(11) NOT NULL AUTO_INCREMENT,
owner_citizenid
varchar(50) NOT NULL,
street
VARCHAR(100) NULL,
region
VARCHAR(100) NULL,
description
LONGTEXT NULL,
has_access
JSON NULL DEFAULT (JSON_ARRAY()), -- [citizenid1, citizenid2, ...]
extra_imgs
JSON NULL DEFAULT (JSON_ARRAY()),
furnitures
JSON NULL DEFAULT (JSON_ARRAY()),
for_sale
boolean NOT NULL DEFAULT 1,
price
int(11) NOT NULL DEFAULT 0,
shell
varchar(50) NOT NULL,
apartment
varchar(50) NULL DEFAULT NULL, -- if NULL then it's a house
door_data
JSON NULL DEFAULT NULL, -- {"x": 0.0, "y": 0.0, "z": 0.0, "h": 0.0, "length": 0.0, "width": 0.0}
garage_data
JSON NULL DEFAULT NULL, -- {"x": 0.0, "y": 0.0, "z": 0.0} -- NULL if no garage
PRIMARY KEY (property_id
),
CONSTRAINT FK_owner_citizenid
FOREIGN KEY (owner_citizenid
) REFERENCES players
(citizenid
) ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT UQ_owner_apartment
UNIQUE (owner_citizenid
, apartment
) -- A character can only own one apartment
) ENGINE=InnoDB AUTO_INCREMENT=1;`
It should also look at the bank account to pull money from (similar to purchase property)
[ 348172] [b2802_GTAProce] CrBrowserMain/ Uncaught TypeError: Cannot read properties of null (reading 'focus') (@game/ui/root.html:108)
[ 369969] [b2802_GTAProce] MainThrd/ Initialising properties
[ 370047] [b2802_GTAProce] MainThrd/ Error running call reference function for resource ps-housing: citizen:/scripting/lua/scheduler.lua:520: type cannot be msgpack'd
[ 370047] [b2802_GTAProce] MainThrd/ stack traceback:
[ 370047] [b2802_GTAProce] MainThrd/ [C]: in function 'msgpack.pack'
[ 370047] [b2802_GTAProce] MainThrd/ citizen:/scripting/lua/scheduler.lua:520: in function citizen:/scripting/lua/scheduler.lua:482
[ 370047] [b2802_GTAProce] MainThrd/ [C]: in field 'CreateThreadNow'
[ 370047] [b2802_GTAProce] MainThrd/ citizen:/scripting/lua/scheduler.lua:198: in function citizen:/scripting/lua/scheduler.lua:148
[ 370047] [b2802_GTAProce] MainThrd/ ^1SCRIPT ERROR: @bl-realtor/client/sync.lua:5:
[ 370047] [b2802_GTAProce] MainThrd/ ^5 An error occurred while calling export GetProperties
in resource ps-housing
:
[ 370047] [b2802_GTAProce] MainThrd/
[ 370047] [b2802_GTAProce] MainThrd/ ^5 ---^7
[ 370047] [b2802_GTAProce] MainThrd/ ^3> handler^7 (^5@ps-housing/client/client.lua^7:30)
[ 370047] [b2802_GTAProce] MainThrd/ Initialised properties
Happens when i try to remove the current owner inside the manage property menu
https://youtu.be/1Bn0yATmAP8
Hi,
Is it possible to add the code for the other shells in the qb-interior to ps-housing? Qb-interior has support for the other shells already if you have the shells themselves. See the example below:
...elseif Config.Houses[house].tier == 15 then
return exports['qb-interior']:CreateWarehouse1(coords)
elseif Config.Houses[house].tier == 16 then
return exports['qb-interior']:CreateFurniMotelStandard(coords) -- End of free shells
elseif Config.Houses[house].tier == 17 then
return exports['qb-interior']:CreateMedium2(coords)
elseif Config.Houses[house].tier == 18 then
return exports['qb-interior']:CreateMedium3(coords)...
Can we include support for the rest in ps-housing too, or at least advise me on what to change to get the rest imported? I'm guessing it's not as easy as adding the shell info into a template like this below.
["House Name"] = {
label = "House Name",
hash = `shell_name`,
doorOffset = { x = 0.0, y = 0.0, z = 0.0, h = 0.0, width = 2.0 },
stash = {
maxweight = 0000,
slots = 20,
},
imgs = {
{
url = "https://....webp",
label = "Angle 1",
},
},
},
Also, how can the 'Select a Shell' menu option be edited so that the names are either alphabetical or ordered by similarity (like house 1, house 2, house 3, warehouse1, warehouse2, etc.) It doesn't seem to follow any logical order, like showing in the order in which it's declared in ps-housing?
Could you add support for default storage/wardrobe in the starting apartments. Right now the code doesn't support inserting furniture with no object so putting a stash/wardrobe on existing spots in the shell isn't possible.
f.e. Lev appartment shell
after player buy a house, then restart the server i got error [ script:ps-housing] SCRIPT ERROR: @ps-housing/server/server.lua:19: bad argument #1 to 'decode' (string expected, got table)
[ script:ps-housing] > ref (@ps-housing/server/server.lua:19)
[ script:ps-housing] > rawQuery (@oxmysql/dist/build.js:25045)
[ script:ps-housing] > processTicksAndRejections (node:internal/process/task_queues:96)
I have installed everything that is in the readme but I am not able to choose a shell type. Any fixes for it?
Add logging for all realtor actions such as: listing a property for sale, selling a property, deleting a property, purchasing a property, etc
Hi. i think i did everything right. but i am getting an error.,
@ps-housing/server/server.lua:1: No such export GetCoreObject in resource qb-core
any ideas?
I'm creating a custom real estate job. Try to get a property details using local getProperty = exports['ps-housing']:GetProperty(property_id)
. However the error occured as below. Please advise
Error running call reference function for resource ps-housing: citizen:/scripting/lua/scheduler.lua:520: type <userdata> cannot be msgpack'd stack traceback: [C]: in function 'msgpack.pack' citizen:/scripting/lua/scheduler.lua:520: in function <citizen:/scripting/lua/scheduler.lua:482> MainThrd/ ^1SCRIPT ERROR: @addz_realestatev2/client/client.lua:409: MainThrd/ ^5 An error occurred while calling export
GetPropertyin resource
ps-housing:
When importing the SQL File.
I use MariaDB.
Repro:
Would be awesome to decorate the exterior of a house within a polyzone. Items would only spawn when entering the polyzone
[ 1740469] [b2802_GTAProce] MainThrd/ error during NUI callback select: citizen:/scripting/lua/scheduler.lua:739: ^1SCRIPT ERROR: @ps-housing/client/cl_property.lua:524: attempt to concatenate a nil value (field 'street')
This error occurs when attempting to leave an apartment
I don't have precise reproduction steps, because I don't know how to reproduce it, but I do have errors, which will help in seeing what the issue could be.
Here is a clip of this issue occurring: https://medal.tv/games/gta-v/clips/1mRqhWF02Yr581/d1337EW9o4Mr?invite=cr-MSxMUkwsNzIwNTc3NzYs
Here are the produced errors:
^1SCRIPT ERROR: @ps-housing/client/cl_property.lua:570: attempt to index a nil value (field '?')^7
^3> findFurnitureDifference^7 (^5@ps-housing/client/cl_property.lua^7:570)
^3> UpdateFurnitures^7 (^5@ps-housing/client/cl_property.lua^7:601)
^3> handler^7 (^5@ps-housing/client/cl_property.lua^7:727)
Side note: Extremely commonly, when purchasing furniture, it doesn't even get this far, it just errors out on the UI side, and doesn't save anything. I don't have reliable reproduction here, but it is very common. Here are those errors:
error during NUI callback addToCart: @ps-housing/client/modeler.lua:373: attempt to index a nil value (local 'data')
Uncaught (in promise) TypeError: Failed to fetch (@ps-housing/html/index.js:1)
[ script:ps-housing] SCRIPT ERROR: @ps-housing/server/sv_property.lua:20: attempt to call a nil value (field 'RegisterInventory')
[ script:ps-housing] > new (@ps-housing/server/sv_property.lua:20)
[ script:ps-housing] > handler (@ps-housing/server/server.lua:80)
[ script:ps-housing] > (@oxmysql/dist/build.js:21810)
[ script:ps-housing] > processTicksAndRejections (node:internal/process/task_queues:96)
any help please i used lj-inventory and last coret
his error happens when i click to create the house
and create on table the house on properties
regards
ps-housing:server:buyFurniture
if price > PlayerData.money.bank then
Player.Functions.RemoveMoney('bank', price, "Bought furniture")
else
Player.Functions.RemoveMoney('cash', price, "Bought furniture")
end
Should be
if price > PlayerData.money.bank then
Player.Functions.RemoveMoney('cash', price, "Bought furniture")
else
Player.Functions.RemoveMoney('bank', price, "Bought furniture")
end
i have the error above i have tried to do this on a clean server with nothing but defualts and i have did the read me 100% correct any ideas on why this would still be happening and its only happening when the ps-housing is add workf fine before
Anywhere "GetProperties" or "Property.Get" is run, the system errors.
InitialiseProperties^7 (^5@ps-housing/client/client.lua^7:30)
handler^7 (^5@ps-housing/client/client.lua^7:39)
Error running call reference function for resource ps-housing: citizen:/scripting/lua/scheduler.lua:520: type <userdata> cannot be msgpack'd
stack traceback:
[C]: in function 'msgpack.pack'
citizen:/scripting/lua/scheduler.lua:520: in function <citizen:/scripting/lua/scheduler.lua:482>
[C]: in field 'CreateThreadNow'
citizen:/scripting/lua/scheduler.lua:198: in function <citizen:/scripting/lua/scheduler.lua:148>
^1SCRIPT ERROR: @bl-realtor/client/sync.lua:5:
^5 An error occurred while calling export `GetProperties` in resource `ps-housing`:
When removing furniture from the existing furniture list setting table key nil will cause problems. Table would need to be sorted after removing the furniture. DB json from furniture after removing owned furniture.
[
{
"label": "Old chair",
"object": "prop_ld_farm_chair01",
"position": { "x": -3.6913, "y": -0.3834, "z": -0.8096 },
"rotation": { "x": 0.0, "y": -0.0, "z": 0.0 },
"id": "967934118"
},
null,
null,
{
"label": "Dining Table",
"object": "v_res_fh_diningtable",
"position": { "x": 3.8983, "y": -1.6363, "z": -1.9493 },
"rotation": { "x": 0.0, "y": -0.0, "z": -101.99999237060549 },
"id": "261757118"
}
]
I am using qb-weed and qb-drugs and when I try to plant a weed seed in my house it says "area not safe, try your house". Any help would be appreciated.
Not entirely sure of the reproduce steps just yet, however this is the exact situation I noticed this in:
I suspect that it's got something to do with coords maybe? I'm not entirely sure. Haven't had a chance to look at it yet, was told to report it by MonkeyWhisper.
Video of house 1's flickering: https://youtu.be/wPLrsvybvjA
Video of house 2's perfectly fine interior (just for reference): https://youtu.be/nmTbcGfTjrw (don't find the floating objects, that's unrelated to this).
Repro steps:
Once you restart qb-garages and ps-housing then the garage location moves to the new coords
I do have a problem with qb-spawn since i start using ps-housing. When i choose spawn in house the cam in qb-spawn do not zoom in to the house. Is it more that have it like that or is there a fix for its ?
i tried with kevingirardx's target and default one, both throw the same error regardless
error comes out when I try to get into my apartment, but its fine when going out of it
[ 63985] [b2802_GTAProce] MainThrd/ ^1SCRIPT ERROR: @ps-housing/shared/framework.lua:124: attempt to call a nil value (global 'hasApartment')^7
[ 63985] [b2802_GTAProce] MainThrd/ ^3> ref^7 (^5@ps-housing/shared/framework.lua^7:124)
[ 63985] [b2802_GTAProce] MainThrd/ ^3> CheckOptions^7 (^5@qb-target/init.lua^7:222)
[ 63985] [b2802_GTAProce] MainThrd/ ^3> SetupOptions^7 (^5@qb-target/client.lua^7:184)
[ 63985] [b2802_GTAProce] MainThrd/ ^3> fn^7 (^5@qb-target/client.lua^7:392)
[ 63985] [b2802_GTAProce] MainThrd/ ^1SCRIPT ERROR: error object is not a string^7
[ script:ps-housing] SCRIPT ERROR: @ps-housing/server/sv_property.lua:20: attempt to call a nil value (field 'RegisterInventory')
[ script:ps-housing] > new (@ps-housing/server/sv_property.lua:20)
[ script:ps-housing] > ref (@ps-housing/server/server.lua:29)
[ script:ps-housing] > <unknown> (@oxmysql/dist/build.js:21810)
[ script:ps-housing] > processTicksAndRejections (node:internal/process/task_queues:96)
[ script:ps-housing] > ref (@ps-housing/server/sv_property.lua:436)
[ script:ps-housing] > <unknown> (@oxmysql/dist/build.js:21810)
[ script:ps-housing] > processTicksAndRejections (node:internal/process/task_queues:96)```
I've just downloaded the newest release of ps-housing and replaced my version on my server. The shells are still not showing up (see img1)
I've included F8 console errors also
@MonkeyWhisper Please do not just close the issue without giving me a chance to reply. I am not an idiot and telling me to ensure in the right order was not the solution to the previous issue #63 because I did that before I posted. And I restarted several times and did everything the install requires. Please advise, then give me a chance to respond and confirm that it works before you close the issue.
Also, the script worked 2 days ago, then stopped working yesterday. Without me doing anything but play around in the city using the script. No config changes, no changes to any of the lua files, nothing. Except changing the ensure order in the cfg file...
I get the following error server side: SCRIPT ERROR: @qb-multicharacter/server/main.lua:84: attempt to index a nil value (global 'hasDonePreloading') I followed the instructions in the readme to the letter and didn't skip any steps
It looks correct when you place it, but when you leave and come back the rotation is reset to what it previously was before moving. The location is saved tho
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.