Installations

Remember that this resource has verified DMCA protection, and its illegal use or distribution could imply a claim for protection of Title 17 of Chapter 512 (c) (3) of the Digital Millennium Copyright Act

STEP 1 - Dependencies

It is important to use the dependencies that are indicated in this step, do not use others, otherwise you will receive critical errors

STEP 2 - Start order

It is important to put the resources in the correct order, below qb-core but above the other scripts
In order for the resource to start correctly and not receive any errors, we must start the resources in the following order
1
ensure qs-housing
2
ensure k4mb1shellstarter
3
ensure PolyZone
4
ensure meta_libs
5
ensure interact-sound

STEP 3 - Database

Before placing our [sql] file, we will remove the old tables similar to qs-housing from our server, so as not to cause critical database errors
To do this, we will execute the following code in our database
DROP TABLE IF EXISTS player_houses;
DROP TABLE IF EXISTS houselocations;
This code is mandatory to run before starting to install the new database
Do not start the resource without first having installed the complete database, if you start the resource in the database, you will get critical errors
Housing database
1
CREATE TABLE `houselocations` (
2
`id` int(11) NOT NULL AUTO_INCREMENT,
3
`name` varchar(255) NOT NULL,
4
`label` varchar(255) DEFAULT NULL,
5
`coords` text DEFAULT NULL,
6
`owned` tinyint(2) DEFAULT NULL,
7
`price` int(11) DEFAULT NULL,
8
`tier` tinyint(2) DEFAULT NULL,
9
`garage` text DEFAULT NULL,
10
`creator` varchar(50) DEFAULT NULL,
11
`mlo` text DEFAULT NULL,
12
`ipl` text DEFAULT NULL,
13
PRIMARY KEY (`id`),
14
KEY `name` (`name`)
15
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
16
17
CREATE TABLE `player_houses` (
18
`house` varchar(50) NOT NULL,
19
`identifier` varchar(50) DEFAULT NULL,
20
`citizenid` varchar(50) DEFAULT NULL,
21
`insideId` varchar(50) DEFAULT NULL,
22
`keyholders` text DEFAULT NULL,
23
`decorations` text DEFAULT NULL,
24
`stash` text DEFAULT NULL,
25
`outfit` text DEFAULT NULL,
26
`logout` text DEFAULT NULL,
27
`decorateStash` text DEFAULT NULL,
28
`charge` text DEFAULT NULL,
29
`credit` varchar(50) DEFAULT NULL,
30
`creditPrice` varchar(50) DEFAULT NULL,
31
PRIMARY KEY (`house`)
32
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
33
34
ALTER TABLE `players` ADD `inside` VARCHAR(100);

STEP 4 - Garages

In the case of using qb-garages, it requires a series of additional modifications, you also have the latest pre-modified version here below, please follow the documentation STRICTLY or use the already modified version!
Quasar Housing can be compatible with any garage for which a Housing function has been created, therefore, not all of them are compatible by default, here we will attach the list of garages compatible with qs-housing by default
If you have a garage with such necessary events, don't worry, you can add it manually with the following settings
We do not support garage systems, as each creator must formulate their own events to support it. If you don't want to use the Housing Garage, you can skip it
Among the garages verified to work with qs-housing, we find qs-garages, qb-garages, cd_garages and jg_adavencedgarages
Garages
Download links and stores
qs-garages
qb-garages
cd_garages
jg_adavencedgarages

Quasar Team already modified qb-garages for you here

If you have complications when doing it, use the version modified by Quasar Team
qb-garages [qs-housing].rar
24KB
Binary

Modifications applied to qb-garages

Please, read the steps carefully, IT DOES WORK, but you must follow them to the letter
This housing system is NOT compatible with qb-garages of old or modified versions, you must use the latest version from its own official repository
In this step we will show the installation of the official qb-core garage, which can be found at this link
qb-garages depends on some modifications to be able to be executed, and these modifications are very strict, so follow the steps properly and if it doesn't work, we recommend you find a developer to help you with the process
We'll first look on the client for the following event qb-garages:client:setHouseGarage and replace it entirely
../client/main.lua
1
RegisterNetEvent('qb-garages:client:setHouseGarage', function(house, hasKey)
2
if HouseGarages[house] then
3
if lasthouse ~= house then
4
if lasthouse then
5
DestroyZone("hmarker", lasthouse)
6
lasthouse = house
7
end
8
if hasKey and HouseGarages[house].takeVehicle.x then
9
CreateZone("hmarker", HouseGarages[house], house)
10
lasthouse = house
11
end
12
end
13
end
14
end)
On the server side, we will override these two events qb-garage:server:updateVehicleState and qb-garage:server:checkOwnership
../server/main.lua
1
-- !!!!!!!!!!!!! ONLY FOR OLD QB-GARAGES !!!!!!!!!!!!!
2
RegisterNetEvent('qb-garage:server:updateVehicleState', function(state, plate, garage)
3
QBCore.Functions.TriggerCallback('qb-garage:server:validateGarageVehicle', source, function(owned) --Check ownership
4
if owned then
5
if state == 0 then --Check state value
6
if Garages[garage] then --Check if garage is existing
7
MySQL.update('UPDATE player_vehicles SET state = ?, garage = ?, depotprice = ? WHERE plate = ?', {state, garage, 0, plate})
8
end
9
end
10
else
11
TriggerClientEvent('QBCore:Notify', source, Lang:t("error.not_owned"), 'error')
12
end
13
end, garage, Garages[garage].type, plate)
14
end)
../server/main.lua
1
QBCore.Functions.CreateCallback("qb-garage:server:checkOwnership", function(source, cb, plate, type, house, gang)
2
local src = source
3
local pData = QBCore.Functions.GetPlayer(src)
4
if type == "public" then --Public garages only for player cars
5
MySQL.query('SELECT * FROM player_vehicles WHERE plate = ? AND citizenid = ?',{plate, pData.PlayerData.citizenid}, function(result)
6
if result[1] then
7
cb(true)
8
else
9
cb(false)
10
end
11
end)
12
elseif type == "house" then --House garages only for player cars that have keys of the house
13
MySQL.query('SELECT * FROM player_vehicles WHERE plate = ?', {plate}, function(result)
14
if result[1] then
15
cb(true)
16
else
17
cb(false)
18
end
19
end)
20
elseif type == "gang" then --Gang garages only for gang members cars (for sharing)
21
MySQL.query('SELECT * FROM player_vehicles WHERE plate = ?', {plate}, function(result)
22
if result[1] then
23
--Check if found owner is part of the gang
24
local resultplayer = MySQL.single.await('SELECT * FROM players WHERE citizenid = ?', { result[1].citizenid })
25
if resultplayer then
26
local playergang = json.decode(resultplayer.gang)
27
if playergang.name == gang then
28
cb(true)
29
else
30
cb(false)
31
end
32
else
33
cb(false)
34
end
35
else
36
cb(false)
37
end
38
end)
39
else --Job garages only for cars that are owned by someone (for sharing and service) or only by player depending of config
40
local shared = ''
41
if not SharedGarages then
42
shared = " AND citizenid = '"..pData.PlayerData.citizenid.."'"
43
end
44
MySQL.query('SELECT * FROM player_vehicles WHERE plate = ?'..shared, {plate}, function(result)
45
if result[1] then
46
cb(true)
47
else
48
cb(false)
49
end
50
end)
51
end
52
end)

STEP 5 - Stashes

Inside config.lua we will find an exclusive configuration for the Stash and your inventory system, here we can choose between several default inventories simply by modifying Config.StashType to the system that we want, everything is noted next to the configuration
If you don't have basic Lua and QBCore skills please set only one default inventory and avoid using the following options below
In case we want to add furniture with stash, we will have a basic configuration where we will add the prop name to add a small stash in Config.ObjectStash, we can see the furniture corresponding to this configuration inside config_furniture.lua
You can configure more, but these are included by default

STEP 6 - Wardrobes

Quasar Housing has a basic wardrobe system, which will allow you to place a wardrobe that triggers an external event to open your outfits
By default you will have some options, but you can choose a custom one with the event below and putting Config.OutfitType in the custom option
We can also configure some furniture to bring a default wardrobe in the Config.ObjectWardrobe, we can guide ourselves and obtain the prop name from config_furniture.lua
You can configure more, but these are included by default
Clothings
Download links and stores
fivem-appearance
qb-clothing
rcore_clothes

STEP 7 - Config framework

We will change the framework in qs-housing/config/config_framework.lua, there we will change the Config.Framework and place 'QBCore'
1
--███████╗██████╗░░█████╗░███╗░░░███╗███████╗░██╗░░░░░░░██╗░█████╗░██████╗░██╗░░██╗
2
--██╔════╝██╔══██╗██╔══██╗████╗░████║██╔════╝░██║░░██╗░░██║██╔══██╗██╔══██╗██║░██╔╝
3
--█████╗░░██████╔╝███████║██╔████╔██║█████╗░░░╚██╗████╗██╔╝██║░░██║██████╔╝█████═╝░
4
--██╔══╝░░██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝░░░░████╔═████║░██║░░██║██╔══██╗██╔═██╗░
5
--██║░░░░░██║░░██║██║░░██║██║░╚═╝░██║███████╗░░╚██╔╝░╚██╔╝░╚█████╔╝██║░░██║██║░╚██╗
6
--╚═╝░░░░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░░░░╚═╝╚══════╝░░░╚═╝░░░╚═╝░░░╚════╝░╚═╝░░╚═╝╚═╝░░╚═╝
7
8
Config.Framework = 'QBCore' -- Set 'ESX' or 'QBCore'.
9
10
--- @param If your are using ESX 1.8.5 or higher put in true 'Config.CustomFrameworkExport' and uncomment the ESX function from line 14
11
Config.CustomFrameworkExport = false -- Do you want to add your own export?
12
function CustomFrameworkExport() -- Add the export here, as in the following example.
13
-- ESX = exports["es_extended"]:getSharedObject()
14
-- QBCore = exports['qb-core']:GetCoreObject()
15
end
16
17
18
--█▀▀ █▀▀ █─█
19
--█▀▀ ▀▀█ ▄▀▄
20
--▀▀▀ ▀▀▀ ▀─▀
21
Config.getSharedObject = 'esx:getSharedObject' -- Modify your ESX-based framework here.
22
Config.playerLoaded = 'esx:playerLoaded' -- Modify your ESX-based framework here.
23
Config.setJob = 'esx:setJob' -- Modify your ESX-based framework here.
24
25
Config.ESXFrameworkUsersTable = 'users' -- Name of the table where the data of the players its stored.
26
27
Config.ESXMenu = 'esx_menu_default' -- You can choose between 'esx_menu_default' or 'nh-context' , if you choose nh-conext you must use nh-keyboard too.
28
29
-- Skinchanger and esx_skin events.
30
Config.skinchangergetSkin = "skinchanger:getSkin"
31
Config.skinchangerloadClothes = "skinchanger:loadClothes"
32
Config.esx_skinsetLastSkin = "esx_skin:setLastSkin"
33
Config.esx_skinsave = "esx_skin:save"
34
35
Config.esxVersion = 'new' -- If you are using es_extended 1.2, v1final or legacy use 'new', if you are using es_extended 1.1 use 'old'.
36
37
-- In case you are using server custom events from esx_datastore and esx_addoninventory.
38
Config.esx_addoninventorygetInventory = "esx_addoninventory:getInventory"
39
Config.esx_datastoregetDataStore = "esx_datastore:getDataStore"
40
Config.esx_addonaccountgetAccount = "esx_addonaccount:getAccount"
41
42
-- Custom event in case you are using esx_inventoryhud (Coming soon)
43
Config.esx_inventoryhudopenPropertyInventory = "esx_inventoryhud:openPropertyInventory"
44
45
-- Multicharacter Event.
46
Config.MulticharacterEventESX = 'esx:onPlayerLogout'
47
48
-- Society events.
49
Config.societyregisterSociety = 'esx_society:registerSociety'
50
Config.addonaccountgetSharedAccount = 'esx_addonaccount:getSharedAccount'
51
Config.societyopenBossMenu = 'esx_society:openBossMenu'
52
53
54
55
--▒█▀▀█ ▒█▀▀█ ▒█▀▀█ █▀▀█ █▀▀█ █▀▀
56
--▒█░▒█ ▒█▀▀▄ ▒█░░░ █░░█ █▄▄▀ █▀▀
57
--░▀▀█▄ ▒█▄▄█ ▒█▄▄█ ▀▀▀▀ ▀░▀▀ ▀▀▀
58
Config.QBCoreGetCoreObject = 'qb-core' -- Choose the name of your qb-core export.
59
60
-- Clarification, qb-menu should not have its event names changed, use it with events called qb-menu:blablabla.
61
Config.QBCoreInputName = 'qb-input' -- Choose the name of your qb-input.
62
63
Config.QBCoreFrameworkPlayersTable = 'players' -- Name of the table where the data of the players its stored.
64
Config.QBCoreFrameworkPlayerSkinsTable = 'playerskins' -- Name of the table where the data of the skin players its stored.
65
66
Config.QBCoreplayerLoaded = 'QBCore:Client:OnPlayerLoaded' -- Choose the name of your qb-core exports.
67
Config.QBCoreSetPlayerData = 'QBCore:Player:SetPlayerData' -- Choose the name of your qb-core exports.
68
69
-- Multicharacter Event
70
Config.MulticharacterEventQBCore = 'QBCore:Client:OnPlayerUnload' -- Choose the name of your qb-core exports.