πŸ’»FW: QBX

Integrating FryDev Spawn with QBX provides you with advanced spawning capabilities for your FiveM GTA V roleplay server. Follow these steps to seamlessly integrate the FryDev Spawn script with QBX

Step 1: Check Basic Setup

Make sure you've completed our Basic Setup. You can find the details here!

Step 2: Insert and Change Files

Here are the integration steps for QBX:

  1. Ensure that you have everything set up in QBX.

  2. In your fry_spawn/fxmanifest.lua file, uncomment the following lines:

'@ox_lib/init.lua',
'@qbx_core/modules/utils.lua',
  1. And within the cleint_scripts section, uncomment:

'@qbx_core/modules/playerdata.lua',

Modify the qbx_core -> client -> character.lua file at line 215. Change the character registration section as follows:

local function createCharacter(cid)
  --- Existing code
end

Change to:

local function createCharacter(cid)
    previewPed()

    :: noMatch ::

    local dialog = characterDialog()

    if not dialog then return false end

    for input = 1, 3 do -- Run through first 3 inputs, aka first name, last name and nationality
        if not checkStrings(dialog, input) then
            Notify(Lang:t('error.no_match_character_registration'), 'error', 10000)
            goto noMatch
            break
        end
    end

    DoScreenFadeOut(150)
    local newData = lib.callback.await('qbx_core:server:createCharacter', false, {
        firstname = capString(dialog[1]),
        lastname = capString(dialog[2]),
        nationality = capString(dialog[3]),
        gender = dialog[4] == Lang:t('info.char_male') and 0 or 1,
        birthdate = dialog[5],
        cid = cid
    })

    TriggerEvent('fry_spawn:client:open_spawn_qbcore_or_qbx', true, {})

    destroyPreviewCam()
    return true
end

Modify the qbx_core -> client -> character.lua file at line 318. Change the character registration section as follows:

{
    title = Lang:t('info.play'),
    description = Lang:t('info.play_description', { playerName = name }),
    icon = 'play',
    onSelect = function()
        --- Existing Code
    end
},

To change:

{
    title = Lang:t('info.play'),
    description = Lang:t('info.play_description', { playerName = name }),
    icon = 'play',
    onSelect = function()
        local position = { x = character.position.x, y = character.position.y, z = character.position.z }
        DoScreenFadeOut(10)
        lib.callback.await('qbx_core:server:loadCharacter', false, character.citizenid)
        TriggerEvent('fry_spawn:client:open_spawn_qbcore_or_qbx', false, position)
        destroyPreviewCam()
    end
},
🏬Setup Apartments

Last updated

Was this helpful?