Conversions

The conversions section simply runs a thread to trigger a server event depending on the framework that is being used. The server side will then handle any data conversions.

This is used to allow for converting outside data into usable utils data.

Thread

Detects the current framework being used and triggers the correct event.

This currently only covers qb-core as old BOII Development resources are exclusively qb. This will be added too as needs progress.

CreateThread(function()
    if GetResourceState('boii_core') == 'started' then
        FRAMEWORK = 'boii_core'
    elseif GetResourceState('qb-core') == 'started' then
        FRAMEWORK = 'qb-core'
    elseif GetResourceState('es_extended') == 'started' then
        FRAMEWORK = 'es_extended'
    elseif GetResourceState('ox_core') == 'started' then
        FRAMEWORK = 'ox_core'
    end

    while not FRAMEWORK do
        Wait(500)
    end

    if FRAMEWORK == 'qb-core' then
        CreateThread(function()
            while true do
                if LocalPlayer.state.isLoggedIn then
                    TriggerServerEvent('boii_utils:sv:run_qb_meta_convert')
                    break
                end
                Wait(0)
            end
        end)
    end

    return
end)

Last updated