Skip to content

Project-Sloth/ps-housing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ps-housing IPL & MLO Support

Table of Contents

Description

ps-housing is a resource that opens up a world of creative possibilities for housing. Its user-friendly interface lets you decorate any location to your heart's content. The best part? Not only is it completely free, but it's also reliable and functional, unlike many other housing systems available. What's included?

  • Players can decorate their houses and apartments with a full selection of furniture and decorations (included a wide variety of custom housing props)
  • Provides support for housing and apartments and is a full replacement for qb-apartments and qb-housing
    • When a player first spawns after enabling ps-housing, they will have to choose an apartment. Once they spawn in the stashitems from their previous qb-apartment will be migrated to their new apartment stash.
  • Allows players to purchase and list houses for sale through ps-realtor and the realtor job
  • Houses come with personal garages
  • Houses and apartments come with personal wardrobes and stashes
  • Players can share keys to their houses and apartments with other players

Creating a new property for sale

Players must have the realtor job to create new properties. Additionally if the realtor has a high enough grade level, they can also help players move to new apartments. All properties must be manually configured for sale by the realtor job, giving you full control over all aspects of properties, and bringing another avenue of roleplay to your server.

  • Pick the location where you want to create a new property
  • Use /housing to open the housing menu
  • Click on create new property
  • Fill out the details of the property (name, price, description, which shell to use, etc)
  • Choose the door location (this is where the person will enter the house)
    • Ensure that you place it up against a wall, since players will use target to enter the house
  • Choose the garage location
    • This point is used both for storing vehicles, as well as the location where the vehicle will spawn when taken out of the garage
  • Realtors can edit the details of the property by clicking on the property in the housing menu
  • Players can see the properties for sale through the /housing menu as well

Furnish and decorate a property

Once inside the property, the player can furnish and decorate the property to their liking. They can also invite other players to their property, and give them access to the property. Open the furniture store by pressing Z.

This will open a furniture store complete with all of the props. Select an item from the catalog and place it into the property. You can use the placement gizmo to position the item to your liking as well as use the UI tools for fine tune control over the placement. Once you are happy with the positioning, make sure you press Add to Cart before moving on. Continue to add as many items as you want to your cart. Once you are done, go to the Checkout and purchase the items.

Note: The place on ground button sometimes does not work properly depending on where the native detects the ground to be.

Shell Support

Installation

Follow either one or the other installation guides below based on your setup:

Remember to install the following dependencies if you don't already have them:

  1. ox_lib
  2. ps-realtor
  3. fivem-freecam
  4. ox_target or qb-target

Furthermore, make sure you start the shown dependencies in the correct order as below:

-- server.cfg

ensure ox_lib
ensure ps-realtor
ensure ps-housing
ensure fivem-freecam

Stashes

  • Players need to place their stash and wardrobe or else they wont have one. Check Config for more information.

This entire README is meant for compatibility with default QBCore scripts. If you have different scripts, you'll need to adjust them for compatibility yourself. Refrain from asking us how to circumvent paid scripts that can't be adjusted for ps-housing support. Instead, request their support for ps-housing - this script is fully open source for that reason. Any inquiries related to this be ignored.

Migrating houses/apartments

  1. From a client run the migratehouses command to automatically convert all houses from qb-houses. It will print a message to the console once complete. The migratehouses command MUST be run from a client in order to retrieve street and region data for each house

  2. From a client or server console run the migrateapartments command to automatically convert all apartments from qb-apartments. It will print a message to the console once complete.

Item Limits System

  1. Choose an item you want to limit under Config.Furniture in under shared/config.lua
  2. Add ["max"] = 3 or the number of your choice to the item (see example below)
{ ["object"] = "v_res_r_figcat", ["price"] = 300, ["max"] = 2, ["label"] = "Fig Cat" },

Logs System Setup

  1. Go to qb-smallresources/server/logs.lua and add this:
['pshousing'] = 'yourdiscordwebhookhere',
  1. Create a webhook for the channel you want the logs to show up in.
  2. Replace the placeholder with your webhook link.

This system only supports qb-core for now.

Adding New Shells

Dynamic Doors

Dynamic Doors will turn placed doors into actual working doors, Instead of them being static. (See videos below)

Preview

DynamicDoorsOff.mp4
DynamicDoorsOn.mp4

Setup

  • You will need to set the Config.DynamicDoors = true
  • You will have to add this convar into your server.cfg setr game_enableDynamicDoorCreation "true"

Note: The convar has to be in your server.cfg in order for the doors to be dynamic!

FAQ

Error: Foreign key constraint is incorrectly formed

If you come across an error such as Foreign key constraint is incorrectly formed while importing the properties.sql into your database, follow these steps to fix it.

  1. Open your database in HeidiSQL.
  2. Right-click on your database name and select "Edit."
  3. Locate the database collation setting take a note of it.
  4. You will need to format the properties.sql file to match your database collation.
  5. Ensure that the collation of your citizenid column in your players table is utf8mb4_general_ci and not utf8mb4_unicode_ci

If your database collation is set to utf8mb4_general_ci, modify the last line of the properties.sql file using VSCode or in HeidiSQL's query tab to the following:

) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

This adjustment ensures that properties.sql file's character set and collation match that of your database, effectively resolving the issue.

Preview

image image image image

Credits

ps-housing owes its existence to the exceptional coding expertise of Xirvin#0985. His application of top-tier coding practices has been instrumental in creating this script. We at Project Sloth are thrilled that he has joined our team and utilized our platform to deliver this incredible, much-anticipated resource. Our sincere appreciation goes out to Xirvin for his outstanding contribution!