Config

Config for msk_vehiclekeys

Config = {}
----------------------------------------------------------------
Config.Locale = 'de'
Config.Debug = true
Config.VersionChecker = true
----------------------------------------------------------------
-- Supported Frameworks: ESX, QBCore
Config.Framework = 'AUTO'
----------------------------------------------------------------
-- !!! This function is clientside AND serverside !!!
Config.Notification = function(source, message, typ)
    if IsDuplicityVersion() then -- serverside
        MSK.Notification(source, 'Vehicle Keys', message, typ, 5000)
    else -- clientside
        MSK.Notification('Vehicle Keys', message, typ, 5000)
    end
end
----------------------------------------------------------------
Config.Commands = {
    -- If you set to false then the Hotkey won't work !!!
    lock = {enable = true, command = 'lock'},
    keyMenu = {enable = true, command = 'keyMenu'},

    -- Command for Players to refresh the Owned Vehicles
    -- It will add not existing permanent keys to the player
    refreshKeys = {enable = true, command = 'refreshKeys'}
}

Config.Hotkeys = {
    lock = {enable = true, key = 'L'},
    keyMenu = {enable = true, key = 'U'},
}

Config.AdminCommand = {
    enable = true, -- (Un)locks the vehicle if you don't have a key
    command = 'adlock',
    groups = {'superadmin', 'admin'}
}

-- Gives the key item to the player if the player does not have the item for the plate in his inventory
Config.OnRefreshKeys = {
    OnPlayerLoaded = true,
    OnRefreshKeys = true,
}

-- This options are only for ox_inventory!!!
-- The following options are for giving the primary key to another player
Config.GivePrimaryKey = {
    -- Please do NOT use all 4 options together!
    -- If you set giveSecondaryKey = true then the last 3 options will be ignored
    -- If you set givePrimaryKey = true then set the first option to false

    -- Use this option
    giveSecondaryKey = true, -- If a player gives his primary key to another player, the other player gets a secondary key
    
    -- Or use this options
    givePrimaryKey = false, -- If a player gives his primary key to another player, the other player gets the primary key
    removePrimaryKey = false, -- If a player gives his primary key to another player, the primary key of the player will be removed
    transferOwnership = false, -- If a player gives his primary key to another player, the other player is the owner of the vehicle

    -- If you set transferOwnership = true then the Primary Key will always be removed from the player
}
----------------------------------------------------------------
Config.Settings = {
    lockDistance = 8.0, -- maximum distance to lock/unlock a vehicle
    exchangeLocksPrice = 5000, -- Price for exchanging the Vehicle Locks
    transferVehicle = true, -- Allow transfer the vehicle to another player

    lockVehiclesFromNPCs = true, -- True NPC vehicles locked, set to false to unlock NPC vehicles.

    menu = {
        showSecondaryKeys = true, -- Show Secondary Keys in Keys Menu
        showTempKeys = true, -- Show Temp Keys in Keys Menu
        showExchangeLocks = true, -- Show Exchange Vehicle Locks in Keys Menu
        showTransferVehicle = true, -- Show transfer vehicle to another player

        refreshPlayerKeys = true, -- Refresh Player Keys when opening the keys menu

        -- Supported Menus: ox_context, ox_menu
        -- You can add your own Menu in client_menu.lua
        keysMenu = 'ox_context'
    },

    key = {
        needItem = true, -- Need an item to (un)lock the vehicle // With uniqueItems you always need the item
        canUseItem = true, -- Registers the Item as usable
        itemName = 'keys',
        
        -- This is only for inventories with metadata
        -- Set uniqueItems to false if you don't use such an inventory!
        -- Supported inventories: ox_inventory, core_inventory, qs-inventory
        uniqueItems = true,
        inventory = 'ox_inventory',
        itemLabel = 'Vehicle Key',
        plateLabel = 'Plate: %s',

        -- This option is for uniqueItems ONLY
        -- If set to true, the player with a key can (un)lock the vehicle even though the player is not the owner
        -- Example: Player A steals the vehicle key from Player B then Player A can (un)lock the vehicle
        toggleWithKey = true,
    },

    transfer = {
        -- If you use the Item then the Player and the Vehicle must be next to you!
        needItem = true, -- Need an item to transfer the vehicle
        canUseItem = true, -- Registers the Item as usable
        itemName = 'contract',
    },

    animation = {
        dict = "anim@mp_player_intmenu@key_fob@",
        anim = "fob_click_fp",
        prop = `lr_prop_carkey_fob`, -- Please use `` and NOT '' or ""
    },
}

Config.openTextUI = function(coloredText, uncoloredText)
    exports['okokTextUI']:Open(uncoloredText, 'darkblue', 'left')
end

Config.closeTextUI = function()
    exports['okokTextUI']:Close()
end

-- This is for exchanging the vehicle locks
-- If you set enable = false then you can still use the exports
Config.Locksmith = {
    enable = true, -- Set to false to disable
    defaultTextUI = true, -- Set fals to use the Config.openTextUI function above

    -- Supported Menus: ox_context, ox_menu
    -- You can add your own Menu in client_menu.lua
    menu = 'ox_context',

    targetSystem = {
        -- If you set this to true then you don't get a HelpNotify or TextUI
        enable = true, -- Set true to enable

        -- Supported Target: ox_target
        -- You can add your own target in client_menu.lua
        script = 'ox_target'
    },

    npcVoice = {
        enable = true,
        inRange = 5.0,
        outRange = 5.0
    },

    locations = {
        ['locksmith'] = {
            label = 'Locksmith Service',
            pedmodel = `s_m_m_autoshop_01`, -- Please use `` and NOT '' or ""
            blip = {enable = true, label = 'Locksmith Service', id = 134, scale = 1.0, color = 0},
            coords = {
                vector4(170.02, -1799.55, 29.32, 318.5),
            }
        },
        ['lsc'] = {
            label = 'Locksmith Service',
            pedmodel = `s_m_m_autoshop_01`, -- Please use `` and NOT '' or ""
            blip = {enable = true, label = 'Locksmith Service', id = 134, scale = 1.0, color = 0},
            coords = {
                vector4(-354.61, -128.18, 38.43, 70.2),
            }
        },
        ['benny'] = {
            label = 'Locksmith Service',
            pedmodel = `s_m_m_autoshop_01`, -- Please use `` and NOT '' or ""
            blip = {enable = true, label = 'Locksmith Service', id = 134, scale = 1.0, color = 0},
            coords = {
                vector4(-190.45, -1309.27, 31.3, 357.8),
            }
        },
    }
}
----------------------------------------------------------------
-- Whitelist specific models and plates for which you don't need a key to (un)lock
Config.Whitelist = {
    models = {
        -- Please use `` and NOT '' or ""
        `caddy`, `caddy2`, `caddy3`, `airtug`, `docktug`, `forklift`, `mower`, `tractor2`, 
    },
    plates = {
        -- either exact plates or just a string that should be in the vehicles plate e.g. "ESX" will ignore "12ESX34" too
        "TEST",
    }
}

-- Blacklist specific models and plates so that they cannot be (un)locked
Config.Blacklist = {
    models = {
        -- Please use `` and NOT '' or ""
        `bmx`, `cruiser`, `fixter`, `scorcher`, `tribike`, `tribike2`, `tribike3`, 
    },
    plates = {
        -- either exact plates or just a string that should be in the vehicles plate e.g. "ESX" will ignore "12ESX34" too
        "TEST2",
    }
}
----------------------------------------------------------------
-- Players with specific jobs can (un)lock the vehicle with specific plates or if it is a specific model
-- either exact plates or just a string that should be in the vehicles plate e.g. "ESX" will ignore "12ESX34" too
Config.JobVehicles = {
    ['police'] = {
        models = {
            -- Please use `` and NOT '' or ""
            `police`, `police2`, `police3`, `police4`, `policeb`, `polmav`,
        },
        plates = {
            "LSPD", "POL",
        },
        ranks = {
            ['officer'] = {
                models = {
                    -- Please use `` and NOT '' or ""
                    `police`,
                },
                plates = {
                    "",
                }
            },
        }
    },
    ['ambulance'] = {
        models = {
            -- Please use `` and NOT '' or ""
            `ambulance`, 
        },
        plates = {
            "LSMD", "AMB",
        }
    },
}

Last updated