GithubHelp home page GithubHelp logo

qbcore-framework / qb-houses Goto Github PK

View Code? Open in Web Editor NEW
40.0 9.0 220.0 412 KB

Housing and Furniture Script Used With QB-Core ๐Ÿ  :chair:

License: GNU General Public License v3.0

Lua 89.39% HTML 2.39% CSS 4.38% JavaScript 3.84%

qb-houses's Introduction

qb-houses

Real Estate for QB-Core Framework ๐Ÿก

License

QBCore Framework
Copyright (C) 2021 Joshua Eger

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>

Dependencies

Screenshots

Buy House House Door Garage Radial Menu Decorate Object Placing Stash Inside Door Security Camera

House Tiers

T1

Tier 1 Tier 1

T2

Tier 2 Tier 2

T3

Tier 3 Tier 3

T4

Tier 4 Tier 4

T5

Tier 5 Tier 5

T6

Tier 6 Tier 6

Features

  • Stormram for police
  • House garage
  • Adding houses in-game with command (See commands section below)
  • House decoration
  • Key system
  • Outfits
  • Stash
  • Real Estate Job
  • Different interiors based on house tier
  • Doorbell
  • Automatically adds blip for owned house

Commands

  • /decorate - Allows the player decorate the house
  • /createhouse [price] [tier] - Creates a house and saves it to database (Only people with "realestate" job)
  • /addgarage - Adds a garage to nearby house (Only people with "realestate" job)
  • /enter - Enters the nearby house (keys needed)
  • /ring - Rings the bell of nearby house

Installation

Manual

  • Download the script and put it in the [qb] directory.
  • Import qb-houses.sql in your database
  • Add the following code to your server.cfg/resouces.cfg
ensure qb-core
ensure qb-radialmenu
ensure qb-anticheat
ensure qb-phone
ensure qb-multicharacter
ensure qb-garages
ensure qb-interior
ensure qb-clothing
ensure qb-weathersync
ensure qb-weed
ensure qb-skillbar

Configuration

Config = Config or {} -- Don't touch

Config.MinZOffset = 30 -- Minimum Z Offset houses will be (You don't need to change it:)

Config.RamsNeeded = 2 -- How many times stormram needs to be used to break the door.

Config.Houses = {} -- Don't touch

Config.Furniture = {
	["sofas"] = { -- Category id (don't change unless you know what you're doing)
		label = "Sofas", -- Category label displayed on decorate section
		items = {
			[1] = { ["object"] = "miss_rub_couch_01", ["price"] = 300, ["label"] = "Old couch" }, -- You can add or edit objects here
			[2] = { ["object"] = "prop_fib_3b_bench", ["price"] = 700, ["label"] = "Threesits couch" },
			[3] = { ["object"] = "prop_ld_farm_chair01", ["price"] = 250, ["label"] = "Old chair" },
			[4] = { ["object"] = "prop_ld_farm_couch01", ["price"] = 300, ["label"] = "Old treesits couch" },
			[5] = { ["object"] = "prop_ld_farm_couch02", ["price"] = 300, ["label"] = "Old striped couch" },
			[6] = { ["object"] = "v_res_d_armchair", ["price"] = 300, ["label"] = "Old 1 Seat Couch Yellow" },
			[7] = { ["object"] = "v_res_fh_sofa", ["price"] = 3700, ["label"] = "corner sofa" },
			[8] = { ["object"] = "v_res_mp_sofa", ["price"] = 3700, ["label"] = "corner sofa 2" },
			[9] = { ["object"] = "v_res_d_sofa", ["price"] = 700, ["label"] = "couch 1" },
			[10] = { ["object"] = "v_res_j_sofa", ["price"] = 700, ["label"] = "Couch 2" },
			[11] = { ["object"] = "v_res_mp_stripchair", ["price"] = 700, ["label"] = "Couch 3" },
			[12] = { ["object"] = "v_res_m_h_sofa_sml", ["price"] = 700, ["label"] = "Couch 4" },
			[13] = { ["object"] = "v_res_r_sofa", ["price"] = 700, ["label"] = "Couch 5" },
			[14] = { ["object"] = "v_res_tre_sofa", ["price"] = 700, ["label"] = "Couch 6" },
			[15] = { ["object"] = "v_res_tre_sofa_mess_a", ["price"] = 700, ["label"] = "Couch 7" },
			[16] = { ["object"] = "v_res_tre_sofa_mess_b", ["price"] = 700, ["label"] = "Couch 8" },
			[17] = { ["object"] = "v_res_tre_sofa_mess_c", ["price"] = 700, ["label"] = "Couch 9" },
			[18] = { ["object"] = "v_res_tt_sofa", ["price"] = 700, ["label"] = "Couch 10" },
			[19] = { ["object"] = "prop_rub_couch02", ["price"] = 700, ["label"] = "Couch 11" },
			[20] = { ["object"] = "v_ilev_m_sofa", ["price"] = 2000, ["label"] = "White Couch" },
			[21] = { ["object"] = "v_med_p_sofa", ["price"] = 1000, ["label"] = "Lether Couch Brown" },
			[22] = { ["object"] = "v_club_officesofa", ["price"] = 500, ["label"] = "pauper Couch rood" },
			[23] = { ["object"] = "bkr_prop_clubhouse_sofa_01a", ["price"] = 1000, ["label"] = "Black Couch" },
			[24] = { ["object"] = "apa_mp_h_stn_sofacorn_01", ["price"] = 5000, ["label"] = "corner sofa 3" },
			[25] = { ["object"] = "prop_couch_lg_02", ["price"] = 1000, ["label"] = "Couch hout" },
			[26] = { ["object"] = "apa_mp_h_stn_sofacorn_10", ["price"] = 5000, ["label"] = "corner sofa 4" },
			[27] = { ["object"] = "apa_mp_h_yacht_sofa_02", ["price"] = 1000, ["label"] = "Brown Couch" },
			[28] = { ["object"] = "apa_mp_h_yacht_sofa_01", ["price"] = 5000, ["label"] = "White long Couch" }
		},
	},

........
}

qb-houses's People

Contributors

berkiebb avatar catiagomes94a avatar darknight2590 avatar deandum avatar developer-bear avatar dexter9006 avatar evanillaa avatar fabicraft3d avatar ghzgarage avatar holidayy95 avatar idrisdose avatar ihyajb avatar jay-fivem avatar jeann2013 avatar liamdormon avatar milad-3dm avatar monsieurbibo avatar netlork avatar newtonzz avatar nzkfc avatar qwerty1verified avatar radhwanedz avatar samshanks1 avatar singh-manavv avatar tehsteel avatar theilleniumstudios avatar tom-osborne avatar tonybynmp4 avatar waseem-h avatar z3rio 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qb-houses's Issues

[BUG] Cannot See Unowned House Blips

I may be the only one, whenever I place a house for sale, I would see the blip, however, after a server restart, I do not see the blips anymore.

QB Houses

Hello, there is a problem in the menu, the problem is as follows, if we try to buy by pressing the "enter" button twice while decorating in the home system, the menu is stuck in the middle and the menu does not go..

Screenshot ;

image

[BUG] Floating stuff.

Describe the bug
Some Sofas, tables, and props in general float even tho we place then on the ground either with ALT or manually. also some props have npcs sitting on them after a server restart.

To Reproduce
Steps to reproduce the behavior:

  1. Buy a Sofa or some specific tables
  2. place them on the ground
  3. exit the decorate menu
  4. See error

Expected behavior
I was expecting the props not to float and having no random npcs in my house

Screenshots
If applicable, add screenshots to help explain your problem.
https://gyazo.com/ebdf69d3902b28329b770fd7e9b4f718

Questions (please complete the following information):

  • When you last updated: [e.g. last week] Yesterday.
  • Are you using custom resource? which ones? [e.g. zdiscord, qb-target] a few but nothing that impacts props in any sort of way.
  • Have you renamed qb- to something custom? [e.g. yes/no] no.

Additional context
Add any other context about the problem here.

/enter & garages dont work

so downloading latest verison. after creating a house then buying the house the /enter doesnt show up nor works. you can create a garage but it doesnt show up nor works.

[NO KEY TO DECORATE IN OWNED HOUSE]

Describe the bug
When you are in your owned house and /decorate it says you have no key when your the owner

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Use this item '....' (item's name from shared.lua if applicable)
  4. See error

Expected behavior
be able to decorate your owned house

Screenshots
If applicable, add screenshots to help explain your problem.

Questions (please complete the following information):

  • When you last updated: [e.g. this week]
  • Are you using custom resource? which onesno
  • Have you renamed qb- to something custom? /no]

[BUG]

Describe the bug
A player is unable to set up their locations within there house and players are able to enter any house with out being given a key

To Reproduce
Steps to reproduce the behavior:

  1. Set up a house
  2. Buy the house
  3. Can't place stash, logout or clothing
  4. Everyone can enter houses without a key

Expected behavior
A clear and concise description of what you expected to happen.
Expected to have a stash, logout and clothing also for players to not randomly enter my house.

Screenshots
If applicable, add screenshots to help explain your problem. N/A

Questions (please complete the following information):

  • When you last updated: [e.g. last week] - Today
  • Are you using custom resource? which ones? [e.g. zdiscord, qb-target] - No
  • Have you renamed qb- to something custom? [e.g. yes/no] - No

Additional context
Add any other context about the problem here.

add more function

I hope there is a function for each of the following scripts:
house function haskey = returns the value of true or false
vehilcekey function haskey = returns the value of true or false
qb-inv function haveitem = returns the value of true or false
return exports["qb-house"]:isNearHouse(true)
return exports["qb-house"]:HaveKey(true)
return exports["qb-vehilcekey"]:HaveKey(true)
exports["qb-inventory"]:haveitem("lockick", 1,)
It is easy to use other projects
I hope to see this in qbcore

Stash

Hi all, does anyone know how to add the stash location to a property, I've tried all the storage boxes but can't see one like the picture?
Thanks - Angie

[BUG] houses and radialmenu glitch

Describe the bug
glitch on qb-houses and radialmenu its need 3 people
person A have a house
person B & C doesnt have any house , if they know the exact place of the person A house they go to A house door , so B open radialmenu>general>House Interaction>givehousekey and click the same process C do the same steps so the result is a /enter will appear immediately for both person B & C

so this glitch only work if you know the exact house of any person
you can check the video
https://www.youtube.com/watch?v=GX5tGFQ9TTE

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'radialmenu>general>House Interaction>givehousekey' 2 person must do this for each when stand on person A house
  2. givekey to nearby player ( must dont have any house bought from realestate for both
  3. /enter will appear for both players and can enter a house of other player

Expected behavior
if person B & C doesnt have a house so if they open radialmenu , givehousekeys should not be appear , also if they bought a house they cannot make this glitch
if its possible on every house bought to a player should generate key like citizenID so only this key can open that house

Screenshots
https://www.youtube.com/watch?v=GX5tGFQ9TTE

Questions (please complete the following information):

  • When you last updated: [e.g. last week]
  • Are you using custom resource? which ones? [e.g. zdiscord, qb-target] zdiscord , battlepass ( already sent u invite to convert it for me , berkieb already participate on that battlepass script , waveshield anticheat
  • Have you renamed qb- to something custom? [e.g. yes/no] NO

Additional context
no

[BUG] Decorate menu

Describe the bug
When i enter my new bought House, and open Decorate menu, place and buy a random furniture, and after leave the house, and enter my house again, and reopen the Decorate menu, and press 'My Objects' i gives me an error in the console.

To Reproduce
Steps to reproduce the behavior:

  1. Buy a house
  2. Enter the house
  3. Open Decorate menu
  4. Place and buy a random furniture
  5. Leave the house
  6. Enter the house
  7. Reopen Decorate menu
  8. Select 'My Objects' (error dosen't come if you dont have any placed furnitures in your house)
  9. Error comes in F8 (client-side)

Screenshots

Questions (please complete the following information):

  • Newest updated everything from Github
  • I dont use any custom resources.
  • I diden't rename anything 'qb-' resources.

Additional context
Nothing else.

Mysql problem

image

When I get the new versions of the scripts, there are a lot of problems with sql, what should I do?

[BUG] Housing Garage cant pull car out of the garage

so i have updated the housing script to the latest one and since i have done that i have fix the issue where the car can go in but it doesnt promt the person let him get the menu to spawn the car out

Going to test it out real fast and post the error

[BUG] Police not able to stormram doors

Describe the bug
Police can't stormram a door down after the swap to qb-menu.

To Reproduce
Steps to reproduce the behavior:

  1. Go to an owned house
  2. Use stormram
  3. See error

Expected behavior
Ability to enter the house

Questions (please complete the following information):

  • When you last updated: [e.g. last week] Most recent (12 days ago)
  • Are you using custom resource? which ones? [e.g. zdiscord, qb-target] Many, none would interfere with this
  • Have you renamed qb- to something custom? [e.g. yes/no] No

Many bugs

-if you try and decorate your house you get stuck in the decoration menu

-if you logout inside of a house it doesnt seem to know where to put you and you get an infinate loading screen

-realestate agents cant buy a house themself so if they want to buy a house for themself they need to be fired buy the house then get rehired

decorate.lua missing variables inside and hasKey

This looks like it was developed all on a single lua file and then splitted for better readability... which is great but main.lua and decorate.lua share some common variables that now cannot be found on decorate.lua.

tier 5 issue[BUG]

Describe the bug
house tier 5 having metro issue

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Use this item '....' (item's name from shared.lua if applicable)
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Questions (please complete the following information):

  • When you last updated: [e.g. last week]
  • Are you using custom resource? which ones? [e.g. zdiscord, qb-target]
  • Have you renamed qb- to something custom? [e.g. yes/no]

Additional context
Add any other context about the problem here.

[BUG]OWNED HOUSES SAYING U HAVE NO KEY TO DECORATE

bug
OWNED HOUSES SAYING YOU HAVE NO KEY TO DECORATE, WHEN YOUR THE OWNER OF THE HOUSE

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Use this item '....' (item's name from shared.lua if applicable)
  4. See error

Expected behavior
TO DECORATE OWNED HOUSE

Questions (please complete the following information):

  • When you last updated: [e.g. this week]
  • Are you using custom resource? which ones? [NO]
  • Have you renamed qb- to something custom? [no]

Enter owned house error

I am trying to enter a owned house on my server but everyone gets the following error on there client side no server error's is this a bug or?

Script Error @qb-houses/client/main.lua:573 attempt to index a nil value (upvalue 'data) Handler (@qb-houses/client/main.lua:53)

[BUG] Furniture inside of house vanishing and reappearing

Describe the bug
When inside of an interior, furniture placed below my characters waste vanish and reappear as I move my third person camera. Certain x y z coordinates are below of where its happening. My thought is that you can move the interior up and fix it but I don't know what that would do to everything else like furniture or other players housing.

To Reproduce
Steps to reproduce the behavior:

Go to '(X: -1126.36) (Y: 382.59) (Z: 50 to 40)'
Crate the Franklins house interior
Place items that are below the waist of the character that are located on the floor on the black surface of the main story.
Items glitch and appear and disappear while moving you third person cameras around.
Screenshots
If applicable, add screenshots to help explain your problem.

Questions (please complete the following information):
-Will the interior furniture move with the interior or stay planed when the interior is moved up or down.
-What other things may be affected by fixing this issue

Additional context
I am not the server owner or a Dev,
I am simply a player who is trying to find a solution to the issue. Excuse my possible ignorance on the topic i am doing as much research as I can to solve the issue.

VanishingFurniture1

VanishingFurniture2

[BUG] Can't see other players houses

Describe the bug
When someone else buys a house, other players can't see the house. They can't see the text of the house so they can't ring the bell etc.

To Reproduce

  1. Someone buys an house
  2. Go to their house door, you can't see it.

Expected behavior
To see the house text so you can ring the bell on it.

Screenshots
https://gyazo.com/df1d6574919fa3dfe5c8d6895b8c2b49 - as the player who bought the house / realestate
https://gyazo.com/f5486d7d6e04c0edd350a2da29e239a7 - as a normal player

Questions (please complete the following information):

  • When you last updated: today
  • Are you using custom resource? which ones? no
  • Have you renamed qb- to something custom? no

[BUG] qb-housing /enter randomly stops working after a restart

Describe the bug
You can't enter your house anymore after a restart.

To Reproduce
Steps to reproduce the behavior:

  1. create a house and sell it to the player
  2. restart the server a few times

Expected behavior
You should see a /enter 3dtext and typing /enter teleports you into the house

last update

  • I have updated last week

[BUG] guest cant leave house

so we find that if you have some one come to your house and ring the door bell they can come in but cant get out the house after that

House garage doesnt aloud car to be taken out[BUG]

Been having an issue with the script it self ... the AddGarage Doesn't seem to be leting the person remove there car from there.. tryed a few things and didnt have any luck, thought i post it in here

No delete door command

No delete door command, have to go into database and remove it. Nit picking, but could be useful.

add Notify

The employee should not be allowed
example
/createhouse 1 100
This is allowed
If the number is more than 7
The message should not be allowed

if Config.Houses[house].tier == 1 then
    data = exports['qb-interior']:CreateTier1House(coords)
elseif Config.Houses[house].tier == 2 then
    data = exports['qb-interior']:CreateTrevorsShell(coords)
elseif Config.Houses[house].tier == 3 then
    data = exports['qb-interior']:CreateMichaelShell(coords)
elseif Config.Houses[house].tier == 4 then
    data = exports['qb-interior']:CreateApartmentShell(coords)
elseif Config.Houses[house].tier == 5 then
    data = exports['qb-interior']:CreateCaravanShell(coords)
elseif Config.Houses[house].tier == 6 then
    data = exports['qb-interior']:CreateFranklinShell(coords)
elseif Config.Houses[house].tier == 7 then
    data = exports['qb-interior']:CreateFranklinAuntShell(coords)
end

[SUGGESTION] IPL support

Is your feature request related to a problem? Please describe.
IPL's not supported

Describe the feature you'd like
It would be awsome if the script would support ipl houses

Describe alternatives you've considered
There is none for this althrough there is a ESX paid script for it.

SaveDecorations( ) error

Just updated the whole framework. This is the first time i tested qb-houses. During decoreation after i buy my first object, nothing happens and this error is present in the client console.

script:qb-houses SCRIPT ERROR: qb-houses/client/decorate.lua:428: attempt to get length of a nil value (upvalue 'ObjectList')
SaveDecorations (@qb-houses/client/decorate.lua:428)
ref (@qb-houses/client/decorate.lua:187)
handler (@qb-core/client/events.lua:127)

[BUG] House System not loading

Describe the bug
After a player buy the house and the server restart house system is not working.

To Reproduce

  1. Install fresh QBCore via TxAdmin
  2. Create house with realestate job, swap to another job and buy the house
  3. Log out and restart the server
  4. Spawn and tp to the house and try to enter the house.
  5. You will get this error: https://i.imgur.com/bN65pxc.png

Questions (please complete the following information):

When you last updated: Just now, from TxAdmin
Are you using custom resource? which ones?: No
Have you renamed qb- to something custom?: No

[BUG]

When I create house and enter the house its stuck on the loading screen

Houses

Decoration works now but when i place object on the ground it dissapears, also my character is flickering in the houses

[BUG] Props starting with `v_` will not load / spawn

Describe the bug
[Props starting in v_ will not spawn]

To Reproduce
Steps to reproduce the behavior:

  1. Start your server
  2. Load into Sandy
  3. Try to spawn prop such as v_res_tre_sofa (prop shouldnt spawn)
  4. Go to vector3(-1154.7, -1518.32, 10.63)
  5. Try and spawn the prop again (prop should spawn)

Expected behavior
Props starting in v_ are part of an mlo's / IPL's and can only spawned near them. Or if you load the ytype or have them in your memory (aka going close to them). You cannot use RequestModel to request those props. Ive attached my code below on how I tested this. I also got help from the mods in the "Pleb Master" discord to help me confirm this.

Code I used to test:

RegisterCommand('proptest', function()
	model = `v_res_tre_sofa_mess_a`
    RequestModel(model)
    while not HasModelLoaded(model) do
        Wait(1)
		print(HasModelLoaded(model))
    end
    ugh = CreateObject(model, GetEntityCoords(PlayerPedId()), true, true, false)
	Wait(3000)
	DeleteObject(ugh)
	print(ugh)
end)

Questions (please complete the following information):

  • When you last updated: [Just updated to test this bug]
  • Are you using custom resource? which ones? [N/A. Installed a Fresh Build]
  • Have you renamed qb- to something custom? [N/A]

Additional context
Add any other context about the problem here.
[Theres over 350+ props in the config that will not work due to not having the object loaded into memory]

qb-house/client/main:167 attempt to index a nil value

When you don't have a home and use
toggle doorlock in radial menu show this error :

qb-house/client/main:167 attempt to index a nil value

But if you own a house, the following message will appear to you

no door nearby

The enter and garage stop working

after a few restarts with no apparent reason, it gives me the error:

Script error: @qb-houses/client/main.lua:573: attempt to index a nil value (upvalue 'data)
handler (@qb-houses/client/main.lua:53)

it sometimes does this, and other times it just works.

[BUG]

Describe the bug
You can let people into houses as you normally would but once inside if that person is not an owner/keyholder they cannot leave the property. The option doesn't show up once reaching the door.

To Reproduce
Steps to reproduce the behavior:

  1. Invite someone in or simply unlock the door and let them walk in.
  2. Once inside if they go to the exit nothing will pop up.

Expected behavior
Once you enter whether you have the keys for that house or not it should let you leave. Options only show up if you own the house or have keys.

Screenshots
N/A

Questions (please complete the following information):

  • When you last updated? - Off the most recent qb-houses update
  • Are you using custom resource? which ones? - I am not using any custom resources with the housing.
  • Have you renamed qb- to something custom? - No.

Additional context
Not currently

Freezing menu

When adding furniture to hoouse menu just going freeze and it isn't possible to switch off menu

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.