FRY DEVELOPMENT
TEBEXYOUTUBEDISCORD
  • πŸ“–Welcome
  • Information
    • πŸ”‘Licensing System
    • πŸ“ƒTerms of Service (ToS)
  • πŸ—ΊοΈSPAWN SELECTOR
    • ℹ️Basic Step
    • πŸ”ŒIntegration
      • πŸ’»FW: QBCore
      • πŸ’»FW: QBX
      • 🏬Setup Apartments
      • ☁️Weather Sync
    • βš™οΈConfiguration Settings
      • 🎨UI Customization Guide
      • πŸ› οΈConfig
      • 🌐Translation
      • πŸ–οΈCustomizing Player Spawn-In
    • πŸ› οΈCommon Issues
      • Soon Edit
Powered by GitBook
On this page
  • Step 1: Ensure Compatibility
  • Step 2: Installing Apartment Resources
  • Step 3: Adjusting Configuration
  • Step 4: Customcustomize the starting apartments
  • Install: QB-Apartments Integration
  • Install: PS-Housing Integration

Was this helpful?

  1. SPAWN SELECTOR
  2. Integration

Setup Apartments

QIn this section, we'll guide you through the process of setting up apartments with FryDev Spawn. Apartments provide players with immersive living spaces within your FiveM server, enhancing the role-playing experience. Follow these steps to successfully configure apartments:

Step 1: Ensure Compatibility

Before proceeding, ensure that you have integrated FryDev Spawn into your server, as explained in our integration guide.

Step 2: Installing Apartment Resources

If you are using apartments, you'll need the appropriate apartment resource for your server. Install and configure either "qb-apartments" or "ps-housing" according to your preference.

Step 3: Adjusting Configuration

Open the FryDev Spawn configuration file (config.lua) and make sure the following settings align with your apartment resource:

  • Config.APARTMENTS.IN_USE: Set this to true if you are using apartments, and false if you are not.

  • Config.APARTMENTS.SYSTEM: Choose the appropriate apartment system type: 'qb-apartments' or 'ps-housing'.

Step 4: Customcustomize the starting apartments

Within the apartment resource you've chosen, configure the available apartment points or locations. This step varies depending on the apartment resource you're using, so refer to the respective documentation for detailed instructions.

To customize the starting apartments in your FiveM server, you can make changes to the CUSTOM.GET_QB_STARTING_APARTMENTS function located in your server/sv_custom.lua file at line 128. Follow these steps to update apartment details:

  1. Open your server's server/sv_custom.lua file.

  2. Locate the CUSTOM.GET_QB_STARTING_APARTMENTS function, which is responsible for defining the starting apartments.

  3. Within the function, you will find a list of apartment entries, each represented as a table. Here's an example

Ensure that you only make changes to these parameters and leave the rest of the code unchanged to maintain compatibility with qb-apartments and ps-housing.

  {
      label       = "South Rockford Drive",
      id          = "apartment1",
      location    = "Location",
      image       = "https://i.imgur.com/Cx2HylE.jpeg",
      coords      = vector3(12, 12, 12),
      description = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.'
  }
  1. Customize the apartment details as follows:

    • label: Change this to the desired name or label for the apartment.

    • image: Replace the image URL with the image you want to use for the apartment.

    • coords: Adjust the coordinates to specify the location of the apartment.

    • description: Modify the description to provide information about the apartment.

  2. Save your changes to the server/sv_custom.lua file.

Hint for ps-housing Users:

If you're using ps-housing as your housing system, you may notice that in the spawn selector, there is no separate dropdown labeled "apartments." This is because ps-housing considers apartments as houses, so you'll only see the dropdown menu for selecting housing options.

Rest assured that despite the absence of a dedicated "apartments" dropdown, you can still access and spawn in apartments using the provided housing options. Simply select from the available housing options in the dropdown, and you'll be able to choose and spawn in the apartments associated with your housing system.

This design is intentional to provide a seamless experience for ps-housing users while utilizing the spawn selector.

Install: QB-Apartments Integration

To implement fry_spawn with qb-apartments please change the following

Got to qb-apartments -> client -> main.lua Line Number: 576

RegisterNetEvent('apartments:client:setupSpawnUI', function(cData)
    QBCore.Functions.TriggerCallback('apartments:GetOwnedApartment', function(result)
     -- Existing Code
    end, cData.citizenid)
end)

Into this:

RegisterNetEvent('apartments:client:setupSpawnUI', function(cData)
    QBCore.Functions.TriggerCallback('apartments:GetOwnedApartment', function(result)
        local coords = json.decode(cData.position)
        if result then
            TriggerEvent('fry_spawn:client:open_spawn_qbcore_or_qbx', false, coords)
        else
            if Apartments.Starting then
                TriggerEvent('fry_spawn:client:open_spawn_qbcore_or_qbx', true, {})
            else
                TriggerEvent('fry_spawn:client:open_spawn_qbcore_or_qbx', false, coords)
            end
        end
    end, cData.citizenid)
end)

Install: PS-Housing Integration

To implement fry_spawn with qb-apartments please change the following

Got to ps-housing -> client -> client.lua Line Number: 52

RegisterNetEvent('ps-housing:client:setupSpawnUI', function(cData)
  --- Existing Code
end)

Into:

RegisterNetEvent('ps-housing:client:setupSpawnUI', function(cData)
    DoScreenFadeOut(1000)
    local result = lib.callback.await('ps-housing:cb:GetOwnedApartment', source, cData.citizenid)
    local coords = json.decode(cData.position)
    if result then
        TriggerEvent('fry_spawn:client:open_spawn_qbcore_or_qbx', false, coords)
    else
        if Config.StartingApartment then
            TriggerEvent('fry_spawn:client:open_spawn_qbcore_or_qbx', true, {})
        else
            TriggerEvent('fry_spawn:client:open_spawn_qbcore_or_qbx', false, coords)
        end
    end
end)
PreviousFW: QBXNextWeather Sync

Last updated 1 year ago

Was this helpful?

πŸ—ΊοΈ
πŸ”Œ
🏬