</>liveDevDocs
ScriptlerliveBaseEnglish

liveBase API System

Central Permission API, state manager, exports, hot reload, and script integration.

🌐 Türkçe · liveBase API System

Central API documentation. All livedev scripts use the liveBase Permission API and export layer.


Permission API

Central permission system. Scripts use Framework.HasPermission instead of writing their own ACE checks.

How it works

Framework.HasPermission(source, 'admin.giveitem')

  ├─ Console (source=0) → always true
  ├─ God role → always true
  ├─ ACE: livebase.admin.giveitem → IsPlayerAceAllowed
  └─ Config.Permissions.Grants fallback → role list (god, admin, mod)

ACE prefix: livebase (config/permissions.luaAcePrefix)

Roles: god (100), admin (80), mod (50)

Server usage

if exports['liveBase']:HasPermission(source, 'admin.ban') then end

local Framework = exports['liveBase']:GetFramework()
if Framework.HasPermission(source, 'admin.kick') then end

if liveBase.Functions.HasPermission(source, 'admin.givemoney') then end

Bridge functions

After loading @liveBase/shared/permission_bridge.lua:

if LiveHasPermission(source, 'admin.weather') then end

if not LiveRequirePermission(source, 'admin.giveitem', QBCore.Functions.Notify) then
    return
end

LiveRegisterDevCommand('openFirstScreen', 'dev.firstscreen', function()
    openFirstScreenUi()
end)

Permission exports

ExportSideDescription
HasPermission(source, permission)ServerPermission check
GetFramework()ServerPermission API object
RegisterPermission(permission, roles)ServerRuntime permission registration
GetPlayerRoles(source)ServerPlayer roles

Defined permissions

PermissionRolesDescription
admin.bangod, adminBan player
admin.giveitemgod, adminGive item
admin.clearinvgod, adminClear inventory
admin.weathergod, adminWeather/time commands
admin.hotreloadgod, adminHot reload
dev.firstscreengod, adminopenFirstScreen debug
dev.charselectgod, adminopenCharacterMenu debug
server.closedgodClosed server bypass

Full list in Turkish docs — same keys in config/permissions.lua.


Permission Bridge (Script Integration)

All [livedev] scripts include @liveBase/shared/permission_bridge.lua.

New script integration

fxmanifest.lua
server_scripts {
    '@liveBase/shared/permission_bridge.lua',
    'server/main.lua',
}
server/main.lua
RegisterNetEvent('myScript:server:adminAction', function()
    local src = source
    if not LiveRequirePermission(src, 'admin.custom', liveBase.Functions.Notify) then return end
end)

Global State Manager

Namespace-based central state. Key format: lb:<namespace>:<key>

Module: config/modules.luastate = true

Server

exports['liveBase']:SetGlobalState('weather', 'mode', 'rain')
exports['liveBase']:SetPlayerState(source, 'gameplay', 'cuffed', true)

Client

local mode = exports['liveBase']:GetGlobalState('weather', 'mode')
exports['liveBase']:SetLocalState('ui', 'menuOpen', true)

liveBase Exports (summary)

See liveBase Core for the full export list.

Key exports: GetBaseObject(), HasPermission(), HotReload(), RunMigrations(), GetSkillTreeSnapshot(), Notify(), RegisterInteraction()


Hot Reload API

exports['liveBase']:HotReload('inventory')
exports['liveBase']:GetHotReloadAliases()
AliasResource
inventory / invliveInventory
targetliveTarget
weatherliveWeatherSync
charselectliveCharacterSelect

Script-based permissions

liveInventory

CommandPermission
/giveitemadmin.giveitem
/clearinvadmin.clearinv
/itemmenuadmin.itemmenu

liveWeatherSync

All weather/time commands require admin.weather.


ACE configuration

server.cfg
add_ace livebase.god god allow
add_ace livebase.admin admin allow
add_ace livebase.mod mod allow
add_principal identifier.license:XXXXXXXX livebase.god
add_ace identifier.license:ZZZZZZZZ livebase.admin.giveitem allow

Disable module: Config.Modules.permissions = false

On this page