Custom Framework

If you run a framework other than ESX or QBCore, set Config.Framework = "custom" and fill in the stub files.


Setup

-- editable/shared/config.lua
Config.Framework = "custom"

Two stub files are then loaded automatically:

File
Side

editable/custom/framework_server.lua

Server

editable/custom/framework_client.lua

Client


Server Stubs

Open editable/custom/framework_server.lua and implement each function:

CustomFramework.Server = {}

-- Return a table of online player server IDs.
CustomFramework.Server.GetPlayers = function()
    return {}
end

-- Return the player object for the given source, or nil.
CustomFramework.Server.GetPlayer = function(src)
    return nil
end

-- Return the unique character/player identifier string.
CustomFramework.Server.GetIdentifier = function(src)
    return nil
end

-- Return the display name of the player.
CustomFramework.Server.GetPlayerName = function(src)
    return 'Unknown'
end

-- Return the job name and grade level.
-- @return string|nil, number
CustomFramework.Server.GetPlayerJob = function(src)
    return nil, 0
end

-- Return the permission group of the player (e.g. "admin", "user").
CustomFramework.Server.GetPlayerGroup = function(src)
    return nil
end

-- Return the money amount for the given type ("cash", "bank", "black").
CustomFramework.Server.GetMoney = function(src, mtype)
    return 0
end

-- Add money. Return true on success.
CustomFramework.Server.AddMoney = function(src, amount, mtype, reason)
    return false
end

-- Remove money. Return true on success.
CustomFramework.Server.RemoveMoney = function(src, amount, mtype, reason)
    return false
end

Client Stubs

Open editable/custom/framework_client.lua and implement each function:


Example (OX Core)

Last updated