Skip to content

parkingmeter.lua

The complete default parkingmeter.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 parkingmeter.lua

lua
return {
    Cooldown = 2, -- Cooldown until a parking meteris robbable again. (in minutes)
    Items = { 'screwdriver', 'multitool' }, -- Tools (any one is enough) — used to jimmy the meter.
    Time = 10, -- Time in seconds to loot the parking meter (progressbar time)
    BaseXP = 20, -- Base XP awarded for successful parking meter robbery
    GiveXPForItems = false, -- Whether to give additional XP based on items received (cash only, no items)
    GiveXPForCash = true, -- Whether to give 1 XP per cash received
    Models = { -- Props to create interaction points for
        "prop_parknmeter_01",
        "prop_parknmeter_02"
    },
    Logging = true, -- Enables lib.logger usage for this action. Will log a players source, character name and identifier as well as the action they took and the items and cash they received from it.
    Minigame = {
        Enable = true, -- Enable/disable custom minigame (if false, no minigame will be used)
        Start = function()
            -- Runs a built-in minigame and returns pass/fail. Swap `wires` for
            -- any other minigame.* (see client/minigame.lua for the full list)
            -- or your own function that returns true/false. Tune below.
            return require('client.minigame').wires({
                wireCount    = 5, -- total wires shown (max 7)
                cutsNeeded   = 3, -- correct cuts required to win
                timeLimitSec = 8, -- seconds before caught; 0 = no limit
            }).success
        end,
    },
    PoliceAlert = {
        Enable = true, -- Enable/disable police alerts for parking meter robberies
        Chance = 20, -- 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 = "Parking meter tampering 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 = coords,
                title = '10-15 - Vandalism',
                message = 'A '..data.sex..' tampering with parking meter at '..data.street,
                flash = 0,
                unique_id = data.unique_id,
                sound = 1,
                blip = {
                    sprite = 431,
                    scale = 1.2,
                    colour = 3,
                    flashes = false,
                    text = '911 - Vandalism',
                    time = 5,
                    radius = 0,
                }
            })
            --]]
        end,
    },
    Rewards = { -- Level-based cash rewards from parking meters
        [1] = { -- Level 1 rewards (basic)
            min = 3,
            max = 12
        },
        [2] = { -- Level 2 rewards (improved)
            min = 8,
            max = 20
        },
        [3] = { -- Level 3 rewards (advanced)
            min = 15,
            max = 35
        },
    },
}