Giter Site home page Giter Site logo

project-sloth / ps-housing Goto Github PK

View Code? Open in Web Editor NEW
329.0 329.0 94.0 54.83 MB

Advanced housing system for QBCore.

Home Page: https://discord.gg/projectsloth

License: Other

Lua 81.66% HTML 0.83% JavaScript 0.63% Svelte 13.57% CSS 0.45% TypeScript 2.85%

ps-housing's People

Contributors

1b0y avatar alexsmith2610 avatar alp1x avatar b0stra avatar backsh00ter avatar complexza avatar devx32 avatar epkouhia avatar evenhfo avatar ilickpandas21 avatar imxirvin avatar jnktechstuff avatar lesiin avatar martinator9001 avatar mekz1222 avatar monkeywhisper avatar nateistyping avatar nietthijmen avatar ok1ez avatar pulsepk avatar pushkart2 avatar ruby-lk avatar switchgh avatar thummie avatar walter-00 avatar wlvf avatar xfutte avatar xsisyphusx avatar xxjamiexx avatar z0nzjn123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ps-housing's Issues

Second fix for (foreing key constraint)

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;`

Garage heading placement is not respected

When you create a garage zone for your house you have a polyzone that shows the way the vehicle will be positioned.
When you pull the vehicle out of the garage, the vehicle always faces North, regardless of how you positioned the polyzone.

Ex:
image

image

I can't plant weed in my house

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.

qb framework no qb-inventory

[   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)

Issue taking money when buying furniture.

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

Garage location does not update after moving

Repro steps:

  1. As realtor go into /housing, Move Garage
  2. Place the garage at different coordinates, E to confirm
  3. Close the housing menu
  4. Actual: For the player who owns the property, the garage remains where it was previously.
  5. Expected: Garage coords should be in the new updated spot

Once you restart qb-garages and ps-housing then the garage location moves to the new coords

[BUG] Removing owned furniture will cause table indexing issue

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"
  }
]

https://github.com/Project-Sloth/ps-housing/blob/7a5a00b683ca056b7fe8b256847bad1008c4b96a/server/sv_property.lua#L650C39-L650C39

Furniture Rotation

I've placed down the furniture and left the house and re-entered, rotation didn't stick. Redid the rotation and same results.

Not sure if that this error in F8 console has to do with anything CrBrowserMain/ Uncaught (in promise) TypeError: Failed to fetch (@bl-realtor/html/index.js:4)
Screenshot 2023-07-24 234904

Adding a garage to a house creates an error.

image

When addling a garage to a house through the menu, or through the database it causes this error. When their is no garage in the database it works fine. When the resource is started it causes this error when their is a garage in the database.

image

Ped flickering in shells.

Not entirely sure of the reproduce steps just yet, however this is the exact situation I noticed this in:

  1. Character owns 2 houses on this street.
  2. There's a difference of 1 house separating them (don't know if this matters, but see image: https://cdn.discordapp.com/attachments/1063024147996885043/1138945876186910760/image.png).
  3. House 2's interior (the same as house 1's) works just fine, with absolutely no flickering.
  4. House 1's interior, has flickering.
  5. No errors in both server/client console.

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).

Extra shells coding request

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?

"GetProperties" is erroring on the latest update

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`:

Nil value error

[ 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

Shell flooded with water

If I created house near water sources e.g river, pool, the water is entered the house and I swim inside the house.

image

After selecting properties when flying into it

image

[ 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

Error occured on exports GetProperty and GetProperties

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 exportGetPropertyin resourceps-housing:

Script error

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?

When placing down furniture, occasionally, it will disappear

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)

Still cannot select shell

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)
img1
I've included F8 console errors also
img2
@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...

help

i cant insert the database how to fix this?

image

Shell type

I have installed everything that is in the readme but I am not able to choose a shell type. Any fixes for it?

After deleting property self is nil

[   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)```

Spawning from qb-spawn do not zoom in to property!

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 ?

qb-target issue (even default qb-target)

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

hi im trying to make a house

hello im tying to make house
job: Realtor
im tying to press e on de house creator
.
image:
image
i just installed it
[sorry for bad engish. im form the netherlands]

Error @ps-housing/server/server.lua:19: bad argument #1 to 'decode' (string expected, got table)

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)

Importing SQL to DB

When I tried to import the Properties.sql it shows the next error:

IMG_20230728_102554862

After I press OK show this:

IMG_20230728_102602559

I will appreciate any help with this. Thanks in advance.

black screen but full loaded in

https://prnt.sc/EpSPHzMMKbsZ

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

problem on this

[ 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

Shared property access does not grant access to the property's garage

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

Housing UI does does not update after deleting a property

Repro:

  1. Realtor deletes a property in the /housing UI
  2. The UI still shows the property for the realtor (shouldn't)
  3. Realtor closes the UI and then reopens, and the property no longer shows (expected)
  4. Other players open the /housing menu and they still see the deleted properties

Nil Value

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.