config.lua

Full View

Config = {}

-- Framework used
Config.Framework = 'esx' -- Options: 'esx' or 'qbcore'
Config.NotificationSystem = 'ox_lib'  -- Notification system: 'ox_lib', 'tnotify', 'okoknotify', 'print', 'framework'
Config.InteractionType = "ox_target" -- Interaction type: "ox_target", "qb-target" or "3dtext"

-- Autopilot speeds
Config.Speed = {
    Normal = 50.0, -- Speed in km/h or mph
    Crazy  = 100.0
}
Config.SpeedUnit = "kmh" -- Speed unit: 'kmh' or 'mph'

-- Autopilot driving styles (TaskVehicleDriveToCoord parameter)
Config.Styles = {
    Normal = 786603,
    Crazy  = 1074528293
}

-- Key bindings for autopilot modes
Config.Keys = {
    Normal = "i",
    Crazy  = "o"
}

-- Chat commands
Config.Commands = {
    Start = "autopilot",
    Stop  = "apstop"
}

-- Jobs allowed to install autopilot
Config.AllowedJobs = {
    "mechanic"  -- Only this job can install autopilot item
}

-- Item required to install autopilot
Config.AutoPilotItem = "autopilot_module"

-- Subscription system settings
Config.Subscription = {
    WeeklyPrice  = 5000,
    MonthlyPrice = 15000,
    WeeklyDays   = 7,
    MonthlyDays  = 30
}

-- NPC coordinates (vec4: x, y, z, heading)
Config.NPC = vector4(107.9575, -204.1476, 54.7101, 82.5827)
Config.NPCBlip = true       -- true = show blip, false = hide blip
Config.NPCBlipSprite = 56  -- Blip icon
Config.NPCBlipColor = 3     -- Blip color
Config.NPCBlipScale = 0.8   -- Blip size
Config.NPCBlipName = "Autopilot NPC" -- Blip name

-- All messages in English
Config.Messages = {
    no_vehicle_nearby = "No vehicle nearby!",
    autopilot_installed = "Autopilot installed! Subscription required to use.",
    autopilot_exists = "This vehicle already has autopilot installed!",
    missing_item = "You do not have the required item!",
    invalid_subscription_type = "Invalid subscription type!",
    subscription_paid = "Subscription paid!",
    not_enough_money = "Not enough money!",
    no_autopilot = "No autopilot installed in this vehicle!",
    no_subscription = "Autopilot no subscription!",
    subscription_expired = "Your subscription has expired!",
    subscription_active = "Subscription active! Expires: %s",
    subscription_success = "Subscription successful! Expires: %s",
    no_waypoint = "No waypoint set!",
    not_in_vehicle = "Autopilot only works in a vehicle!",
    autopilot_activated = "Autopilot activated (%s)",
    autopilot_stopped = "Autopilot stopped, control returned.",
    invalid_mode = "Invalid mode! Only normal or crazy.",
    usage_command = "Usage: /%s [normal|crazy]",
    no_plate_entered = "No plate entered!"
}

-- Menu texts
Config.MenuTexts = {
    menu_open = "Manage Autopilot Subscription",
    menu_title = "Autopilot Subscription",
    check_subscription = "Check Vehicle Subscription",
    check_subscription_desc = "Check current subscription status",
    weekly_subscription = "Subscribe Weekly ($%s)",
    weekly_subscription_desc = "Get weekly autopilot access",
    monthly_subscription = "Subscribe Monthly ($%s)",
    monthly_subscription_desc = "Get monthly autopilot access"
}

-- Notification handlers
Config.Notifications = {
    ox_lib = function(msg, msgType)
        lib.notify({
            position = 'top',
            type = msgType,
            description = msg,
            duration = 5000
        })
    end,

    tnotify = function(msg, msgType)
        exports['t-notify']:Alert({
            style = msgType,
            message = msg,
            duration = 5000
        })
    end,

    okoknotify = function(msg, msgType)
        exports['okokNotify']:Alert('Notification', msg, 3000, msgType)
    end,

    print = function(msg, _)
        print(msg)
    end,

    framework = function(msg, msgType)
        if Config.Framework == "qbcore" then
            QBCore.Functions.Notify(msg, msgType)
        elseif Config.Framework == "esx" then
            ESX.ShowNotification(msg)
        end
    end
}

Last updated