Project-Sloth / ps-housing

Advanced housing system for QBCore.
https://discord.gg/projectsloth
Other
343 stars 110 forks source link

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?

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.

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

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

https://github.com/complexza/ps-housing/assets/74205343/72cfc135-2f78-42b3-a540-45f02567b6d7

https://github.com/complexza/ps-housing/assets/74205343/0ff26e7f-1341-45fc-8fc6-d65421dec0b2

Setup

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!