config.lua

0r-vehiclekeys/config/main.lua
return {
    Debug = false, -- If you want to enable the debug mode set this to true.
    AutoRunSQL = true, -- If you want to run the SQL files automatically set this to true.

   -- !NOTE!
   -- You can add the translation files you have created for the script to the script in the next updates by contacting the support requests/snippets channels or the authorized person named @vezironi (no.1).
   -- !NOTE!

    Locale = 'en', -- You specify the primary language of your script. (Supported Locales: en, fr, de, it, es, pt, ru, tr, pl, ja, ko, zh, ar)

    Target = 'auto', -- (Supported Target Scripts: qb-target, ox_target, sleepless_interact)
    Notify = 'auto', -- (Supported Notify Scripts: brutal_notify, lation_ui, mythic_notify, okokNotify, ox_lib, pNotify, r_notify, t-notify, wasabi_notify)
    UIType = '0resmon', -- (Supported UI Types: 0resmon, ox_lib)

    LockDistance = 8.0,
    GetKeysWhenEngineIsRunning = true,

    Metadata = true,
    VehicleKeys = {
        itemName = 'vehiclekeys',
    },

    Animations = {
        ["toggle_lock"] = {
            dict = 'anim@mp_player_intmenu@key_fob@',
            anim = 'fob_click',
            prop = 'p_car_keys_01',
            time = 500,
            bone = 57005,
            coords = vector3(0.0, 0.0, 0.0),
            rotation = vector3(0.0, 0.0, 0.0),
        },
        ["hold_in_hand"] = {
            dict = 'cellphone@',
            anim = 'cellphone_text_read_base_cover_low',
            prop = 'p_car_keys_01',
            time = 500,
            bone = 57005,
            coords = vector3(0.092864345294629, -0.005128122551559, -0.026256413727468),
            rotation = vector3(15.46036809602, -6.3832143950323, 9.3262711409414),
        },
        ["search_keys"] = {
            dict = 'anim@amb@clubhouse@tutorial@bkr_tut_ig3@',
            anim = 'machinic_loop_mechandplayer',
        },
        ["holdup"] = {
            dict = 'mp_am_hold_up',
            anim = 'holdup_victim_20s',
        },
        ["hotwire_invehicle"] = {
            dict = 'anim@veh@plane@seabreeze@front@ds@base',
            anim = 'hotwire'
        },
        ["hotwire_outsidevehicle"] = {
            dict = 'anim@veh@boat@marquis@ds@base',
            anim = 'hotwire'
        },
    },

    Sounds = {
        ["toggle_lock"] = {
            status = true,
            soundfile = 'lock',
        },
        ["hold_in_hand"] = {
            status = true,
            soundfile = 'keys',
        },
    },

    -- Command settings for vehicle key management
    Commands = {
        -- Toggle vehicle locks command
        ['togglelocks'] = {
            name = 'togglelocks',
            description = 'Toggle Locks',
        },
        -- Toggle vehicle engine command
        ['engine'] = {
            name = 'engine',
            description = 'Toggle Engine',
        },
        -- Give vehicle keys to another player command
        ['givekey'] = {
            name = 'givekey',
            description = 'Give your vehicle keys to a player',
            args = {
                {
                    name = 'player_id',
                    description = 'Player ID',
                }
            }
        },
        -- Admin command to give keys to any vehicle
        ['adminkey'] = {
            name = 'adminkey',
            description = '',
            args = {
                {
                    name = 'plate',
                    description = 'plate',
                }
            }
        },
        -- Police command to give keys to police officers
        ['policekey'] = {
            name = 'policekey',
            description = 'Give keys to a police officer',
        }
    },

    -- Key bindings for vehicle actions
    Keys = {
        ['togglelocks'] = 'L', -- Key to toggle vehicle locks
        ['engine'] = 'G', -- Key to toggle vehicle engine
        ['locksmith'] = {
            index = 38, -- Key index for locksmith interaction
            name = 'E' -- Key name for locksmith interaction
        },
    },

    -- Lock settings for NPC vehicles
    LockNPCDrivingCars = false, -- Lock NPCs driving cars
    LockNPCParkedCars = true, -- Lock NPCs parked cars

    -- Locksmith NPC locations and models
    Locksmiths = {
        {
            model = `s_m_m_cntrybar_01`,
            coords = vector4(88.97, -222.37, 53.64, 341.91)
        },
        {
            model = `s_m_m_cntrybar_01`,
            coords = vector4(245.83, 371.85, 105.74, 163.7)
        }
    },

    -- Pricing for locksmith services
    NewKeyPrice = 1000, -- Price for new vehicle key
    NewLockPrice = 1000, -- Price for new vehicle lock

    -- Carjacking system settings
    Carjack = {
        status = true, -- Enable/disable carjacking system
        time = 7000, -- Time to complete carjacking (milliseconds)
        delay = 10000, -- Delay between carjacking attempts (milliseconds)
        alarm = {
            enabled = true, -- Enable car alarm system
            duration = 10000, -- Alarm duration in milliseconds
            checkInterval = 2000, -- How often to check if alarm is still active
        },
        -- Success chance for different weapon types
        chance = {
            [2685387236] = 0.99, -- MELEE
            [416676503] = 0.99, -- HANDGUN
            [-957766203] = 0.99, -- SMG
            [860033945] = 0.99, -- SHOTGUN
            [970310034] = 0.90, -- RIFLE
            [1159398588] = 0.99, -- LMG
            [3082541095] = 0.99, -- SNIPER
            [2725924767] = 0.99, -- HEAVY
            [1548507267] = 0.99, -- THROWABLE
            [4257178988] = 0.99, -- MISC
        }
    },

    -- Lockpick system settings
    Lockpick = {
        normal = {
            itemName = 'lockpick', -- Normal lockpick item name
            removeChance = 0, -- Chance to remove lockpick on use (0-1)
        },
        advanced = {
            itemName = 'advancedlockpick', -- Advanced lockpick item name
            removeChance = 0, -- Chance to remove advanced lockpick on use (0-1)
        },
    },

    -- Hotwiring system settings
    Hotwire = {
        status = true, -- Enable/disable hotwiring system
        timeBetween = 5000, -- Time between hotwire attempts (milliseconds)
        minTime = 20000, -- Minimum time to complete hotwiring (milliseconds)
        maxTime = 40000, -- Maximum time to complete hotwiring (milliseconds)
        chance = 0.50, -- Success chance for hotwiring (0-1)
        keysChance = 0.10, -- Chance to find keys while hotwiring (0-1)
    },

    -- Police alert system settings
    PoliceAlert = {
        status = true, -- Enable/disable police alerts
        chance = 0.75, -- Chance to trigger police alert (0-1)
        nightStartHour = 18, -- Hour when night starts (24-hour format)
        nightDuration = 6, -- Duration of night in hours
        nightChance = 0.25, -- Chance to trigger police alert during night (0-1)
        cooldown = 10000, -- Cooldown between police alerts (milliseconds)
    },

    -- Dispatch system settings for police alerts
    Dispatch = {
        blipData = {
            sprite = 161, -- Blip sprite ID for map
            color = 1, -- Blip color
            scale = 0.8, -- Blip scale
        },
        code = '10-80', -- Default dispatch code
        icon = 'fas fa-car-crash', -- Default icon for alerts
        jobs = {'police'}, -- Jobs that receive dispatch alerts
        time = 100000, -- Alert duration (milliseconds)
        title = 'Vehicle Alert', -- Default alert title
        alertTypes = {
            -- Carjacking alert settings
            ['carjack'] = {
                code = '10-15',
                icon = 'fas fa-car-burst',
                title = 'Vehicle Theft',
                message = 'Vehicle theft in progress'
            },
            -- Hotwiring alert settings
            ['hotwire'] = {
                code = '10-16',
                icon = 'fas fa-key',
                title = 'Vehicle Hotwiring',
                message = 'Suspicious activity around vehicle'
            },
            -- Break-in alert settings
            ['breakin'] = {
                code = '10-17',
                icon = 'fas fa-car-side',
                title = 'Vehicle Break-in',
                message = 'Vehicle break-in attempt'
            },
            -- Lockpicking alert settings
            ['lockpick'] = {
                code = '10-18',
                icon = 'fas fa-unlock',
                title = 'Vehicle Lockpicking',
                message = 'Suspicious activity around locked vehicle'
            }
        }
    },

    -- Shared keys system for job-specific vehicles
    SharedKeys = {
        status = true, -- Enable/disable shared keys system
        jobs = {
            -- Police job shared keys
            ['police'] = {
                requireOnduty = false, -- Require police to be on duty
                vehicles = {
                    'police', -- Police vehicle models
                    'police2',
                }
            },
            -- Mechanic job shared keys
            ['mechanic'] = {
                requireOnduty = false, -- Require mechanic to be on duty
                vehicles = {
                    'towtruck', -- Mechanic vehicle models
                }
            }
        }
    },

    -- Vehicles that are immune to key system
    ImmuneVehicles = {
        'stockade' -- Vehicles that cannot be locked/unlocked
    },

    -- Ignore bicycles in key system
    IgnoreBicycles = true,

    -- Vehicles that don't require keys
    NoLockVehicles = {},

    -- Weapons that cannot be used for carjacking
    NoCarjackWeapons = {
        "WEAPON_UNARMED",
        "WEAPON_Knife",
        "WEAPON_Nightstick",
        "WEAPON_HAMMER",
        "WEAPON_Bat",
        "WEAPON_Crowbar",
        "WEAPON_Golfclub",
        "WEAPON_Bottle",
        "WEAPON_Dagger",
        "WEAPON_Hatchet",
        "WEAPON_KnuckleDuster",
        "WEAPON_Machete",
        "WEAPON_Flashlight",
        "WEAPON_SwitchBlade",
        "WEAPON_Poolcue",
        "WEAPON_Wrench",
        "WEAPON_Battleaxe",
        "WEAPON_Grenade",
        "WEAPON_StickyBomb",
        "WEAPON_ProximityMine",
        "WEAPON_BZGas",
        "WEAPON_Molotov",
        "WEAPON_FireExtinguisher",
        "WEAPON_PetrolCan",
        "WEAPON_Flare",
        "WEAPON_Ball",
        "WEAPON_Snowball",
        "WEAPON_SmokeGrenade",
    }
}lua

Last updated