rk_attributes

Basic SA:MP inspired attributes script. Every other attributes script just uses ox_lib & is paid. So here's a free one, with a custom UI done in svelte & tailwind. You may download it here

Installation

  1. Install dependencies

  1. Run the SQL found in the _install folder within your database.

-- ESX
alter table users add column age text;
alter table users add column description text;

-- QB-CORE
alter table players add column age text;
alter table players add column description text;

Configuration

Shared = {
    Locale = 'en',
    
    versionCheck = true,

    MaxDistance = 10.0, -- Max distance to examine a player

    ExamineSelf = true, -- Allow players to examine themselves

    Commands = {
        Attributes = {
            'attributes',
            'attr'
        },
        Examine = {
            'ex',
            'examine'
        }
    }
}

-- Sloppy ass locale function
Locale = function(key)
    local locales = LoadResourceFile(GetCurrentResourceName(), ('locales/%s.lua'):format(Shared.Locale))
    if not locales then return key end
    
    local result = load(locales)()
    local keys = {}
    for k in key:gmatch('[^%.]+') do
        table.insert(keys, k)
    end
    
    local value = result
    for _, k in ipairs(keys) do
        if type(value) ~= 'table' then return key end
        value = value[k]
    end
    
    return value or key
end

Last updated