Skip to content

catalytic.lua

The complete default catalytic.lua for Petty Crime (sd-pettycrime). Use this as a reference or a starting point for your own configuration.

TIP

This is the full, unedited config file. For a detailed explanation of each option, see the Configuration page.

Download catalytic.lua

lua
return {
    -- Skill-check minigame run before the saw. Enable = false to skip it. Swap
    -- `tracking` for any other minigame.* (see client/minigame.lua) or your own
    -- function returning true/false.
    Minigame = {
        Enable = true,
        Start = function()
            return require('client.minigame').tracking({
                catchRadius     = 46,  -- on-target radius (px)
                holdDurationSec = 2.5, -- on-target focus needed to win
                targetSpeed     = 140, -- target wander speed (px/sec)
                timeLimitSec    = 12,  -- seconds before caught; 0 = no limit
            }).success
        end,
    },

    Cooldown = 30, -- Per-plate cooldown until the same vehicle can be hit again. (in minutes)
    Items = { 'powersaw', 'anglegrinder', 'bolt_cutter', 'WEAPON_HATCHET' }, -- Cutting tools (any one is enough)
    CheckTime = 4, -- Stage 1 — seconds spent "checking around" before committing to the saw.
    Time = 18, -- Stage 2 — seconds it takes to saw the converter off (progress bar duration).
    BaseXP = 35, -- Base XP awarded for successful catalytic converter theft
    GiveXPForItems = true, -- Whether to give additional XP based on items received
    Logging = true, -- Enables lib.logger usage for this action.

    -- Vehicle classes the target option will refuse to attach to. Maps to the
    -- result of `GetVehicleClass(vehicle)` — see https://docs.fivem.net/natives/?_0x29439776AAA00A62
    -- Default skips emergency / utility / aircraft / boats / military.
    IgnoreClasses = {
        [13] = true, -- Cycles (you can't really put a converter on a bike)
        [14] = true, -- Boats
        [15] = true, -- Helicopters
        [16] = true, -- Planes
        [17] = true, -- Service (taxi, bus, ambulance)
        [18] = true, -- Emergency (police, fire)
        [19] = true, -- Military
        [21] = true, -- Trains
        [22] = true, -- Open Wheel (F1)
    },

    -- Pre-hashed model exemption list — civilian models you don't want eligible.
    -- Empty by default; populate with specific models you want to protect.
    IgnoreModels = {
        -- ['emperor'] = true,
    },

    PoliceAlert = {
        Enable = true, -- Enable/disable police alerts for catalytic converter thefts
        Chance = 50, -- Percentage chance (0-100) that police will be alerted
        Send = function() -- Client Function
            -- Custom function to send police alerts
            -- You can integrate with your preferred dispatch system here

            -- Basic Example
            local alertMessage = 'Catalytic converter theft reported'
            print('Police Alert: ' .. alertMessage)

            -- Example: cd_dispatch integration (uncomment to use)
            --[[
            local data = exports['cd_dispatch']:GetPlayerInfo()
            TriggerServerEvent('cd_dispatch:AddNotification', {
                job_table = {'police'},
                coords = data.coords,
                title = '10-21A - Vehicle Theft',
                message = ('A %s sawing off a catalytic converter at %s'):format(data.sex, data.street),
                flash = 0,
                unique_id = data.unique_id,
                sound = 1,
                blip = {
                    sprite = 380,
                    scale = 1.2,
                    colour = 1,
                    flashes = true,
                    text = '911 - Cat Theft',
                    time = 5,
                    radius = 0,
                }
            })
            --]]
        end,
    },

    -- Loot bucket per player level. Same shape as mailbox PackageRewards: a
    -- single weighted-chance pick. The catalytic converter itself is the
    -- baseline reward; higher levels add a chance for bonus parts.
    Rewards = {
        [1] = { -- Level 1 rewards (basic)
            { item = 'catalytic_converter', chance = 80, min = 1, max = 1, xp = 8 },
            { item = 'metalscrap',          chance = 20, min = 2, max = 4, xp = 1 },
        },
        [2] = { -- Level 2 rewards (improved)
            { item = 'catalytic_converter', chance = 70, min = 1, max = 1, xp = 8 },
            { item = 'metalscrap',          chance = 20, min = 3, max = 5, xp = 1 },
            { item = 'oxygen_sensor',       chance = 15, min = 1, max = 1, xp = 12 },
        },
        [3] = { -- Level 3 rewards (advanced)
            { item = 'catalytic_converter', chance = 60, min = 1, max = 2, xp = 8 },
            { item = 'metalscrap',          chance = 18, min = 4, max = 6, xp = 1 },
            { item = 'oxygen_sensor',       chance = 18, min = 1, max = 1, xp = 12 },
            { item = 'platinum_chunk',      chance = 8,  min = 1, max = 1, xp = 20 },
        },
    },
}