API Reference

Server exports provided by oxide-meth for integrations.

Server exports currently provided by oxide-meth.

Any server resource can call these through standard FiveM exports as long as oxide-meth is started first.

Export List

GetPlayerLevel(source)

Returns the player's meth progression level.

local level = exports['oxide-meth']:GetPlayerLevel(source)

Returns 1 if the player has no progression row yet.

GetPlayerProgression(source)

Returns the player's meth progression stats table.

local progression = exports['oxide-meth']:GetPlayerProgression(source)

Current documented shape:

{
    level = 1,
    xp = 0,
    currentLevelXp = 0,
    nextLevelXp = 100,
    totalCreated = 0,
    totalSold = 0,
    purityPenalty = -30,
    unlocks = {
        {
            level = 1,
            label = 'Cannabis Leaf, Cough Syrup, Lax to the Max, Pain Killer',
            unlocked = true,
        },
    },
}

Returns nil if the player has no valid character identifier.

AddXP(source, amount)

Adds meth XP and runs the level-up check.

local ok = exports['oxide-meth']:AddXP(source, 25)

Returns true on success and false if the player is invalid or the amount is not positive.

AddSold(source, amount)

Adds sold-count progress for meth.

local ok = exports['oxide-meth']:AddSold(source, 3)

Returns true on success and false if the player is invalid or the amount is not positive.