Devices config

return {
    offsets = {
        rotation = {
            ["prop_cctv_cam_01a"] = vec3(-30, 0, 215),
            ["prop_cctv_cam_01b"] = vec3(-30, 0, 145),
            ["prop_cctv_cam_02a"] = vec3(-20, 0, 210),
            ["prop_cctv_cam_03a"] = vec3(0, 0, 135),
            ["prop_cctv_cam_04a"] = vec3(0, 0, 180),
            ["prop_cctv_cam_04b"] = vec3(0, 0, 180),
            ["prop_cctv_cam_04c"] = vec3(-20, 0, 180),
            ["prop_cctv_cam_05a"] = vec3(-20, 0, 180),
            ["prop_cctv_cam_06a"] = vec3(-20, 0, 180),
            ["prop_cctv_cam_07a"] = vec3(0, 0, 180),
            ["ba_prop_battle_cctv_cam_01a"] = vec3(-45, 0, -90),
            ["ba_prop_battle_cctv_cam_01b"] = vec3(-45, 0, 90),
            ["hei_prop_bank_cctv_01"] = vec3(-20, 0, 180),
        },
        position = {
            ["prop_cctv_cam_01a"] = vec3(0, -0.7, 0.2),
            ["prop_cctv_cam_01b"] = vec3(0, -0.7, 0.2),
            ["prop_cctv_cam_02a"] = vec3(0.15, -0.3, 0),
            ["prop_cctv_cam_03a"] = vec3(-0.4, -0.4, 0.35),
            ["prop_cctv_cam_04a"] = vec3(0, -0.75, 0.65),
            ["prop_cctv_cam_04b"] = vec3(0, -0.6, 0.5),
            ["prop_cctv_cam_04c"] = vec3(0, -0.25, -0.35),
            ["prop_cctv_cam_05a"] = vec3(0, -0.2, -0.4),
            ["prop_cctv_cam_06a"] = vec3(0, -0.1, 0.4),
            ["prop_cctv_cam_07a"] = vec3(0, 0, -0.2),
            ["ba_prop_battle_cctv_cam_01a"] = vec3(0.35, -0.35, 0),
            ["ba_prop_battle_cctv_cam_01b"] = vec3(-0.35, -0.35, 0),
            ["hei_prop_bank_cctv_01"] = vec3(0, 0, 0.4),
        }
    },

    ---@type string
    fallbackModel = 'prop_cctv_cam_06a',

    defaultFeaturesByType = {
        ['cctv'] = {},
        ['sensor'] = {
            range = 10.0,
            cooldown = 2 * 1000
        }
    },

    ---@type {time: number}
    placing = {
        time = 5000
    },

    ---@type {enabled: boolean, total: number, perType: table<string, number>}
    -- Limits how many devices a single player (owner) may have placed at once.
    -- Set any limit to 0 to leave it uncapped.
    placementLimits = {
        enabled = true,
        total = 0, -- Combined cap across every device type (0 = unlimited).
        perType = {
            ['cctv'] = 10,   -- Maximum cameras a player can own (0 = unlimited).
            ['sensor'] = 10, -- Maximum sensors a player can own (0 = unlimited).
        }
    },

    ---@type {hideHud: boolean, onEnter: fun(), onExit: fun()}
    -- Behaviour applied while a player is watching a live camera feed.
    -- The onEnter/onExit hooks below are just an example using jg-hud. Swap the
    -- exports for whatever HUD resource you run (or native HUD toggles) - the only
    -- requirement is that onEnter hides the HUD and onExit restores it.
    cameraView = {
        hideHud = true, -- Set to false to keep the HUD visible while viewing a camera feed.

        -- Called when a player opens a camera feed. Hide your HUD resource here.
        onEnter = function()
            exports['jg-hud']:toggleHud(false)
        end,

        -- Called when a player closes a camera feed. Restore your HUD resource here.
        onExit = function()
            exports['jg-hud']:toggleHud(true)
        end,
    },

    ---@type {enabled: boolean, startingBattery: number, drainRate: number, drainInterval: number, lowBatteryThreshold: number, criticalBatteryThreshold: number}
    battery = {
        enabled = false,
        startingBattery = 100,
        drainRate = 1,
        drainInterval = 60 * 60 * 1000,
        lowBatteryThreshold = 20,
        criticalBatteryThreshold = 5,
        -- drainRateOffline = 0,

        rechargeTime = 5000,
        requiredItems = {
            {
                item = 'mountme_battery',
                amount = 1,
                removeOnRecharge = true
            }
        }
    },

    ---@type {enabled: boolean, installTime: number, requiredItems: table}
    solarPanel = {
        enabled = true,
        installTime = 10000,
        requiredItems = {
            {
                item = 'mountme_solar_panel',
                amount = 1,
                removeOnInstall = true
            }
        }
    },

    ---@type {time: number, money: {enabled: boolean, type: 'cash' | 'bank', price: number}, requiredItems: table}
    repair = {
        time = 5000,
        money = {
            enabled = true,
            type = 'cash',
            price = 100
        },
        requiredItems = {
            -- {
            --     item = 'mountme_repairkit',
            --     amount = 1,
            --     removeOnRepair = true
            -- }
        }
    },

    ---@type {time: number}
    destroy = {
        time = 5000,
        -- requiredItems = {
        --     {
        --         item = 'WEAPON_CROWBAR',
        --         amount = 1,
        --         removeOnDestroy = true
        --     }
        -- }
    },

    items = {
        ['cctv'] = {
            type = 'cctv',
            model = 'prop_cctv_cam_06a',
            limits = {
                fov = {
                    default = 60,
                    min = 20,
                    max = 60
                },
                rotation = {
                    maxAngle = 60
                }
            },
            battery = {
                capacity = 100,
                drainRate = 1,
                drainRateOffline = 0,
                rechargeItems = {
                    {
                        item = 'mountme_battery',
                        amount = 1,
                        removeOnRecharge = true
                    }
                },
                allowSolarPanel = true
            }
        },
        ['cctv1'] = {
            type = 'cctv',
            model = 'prop_cctv_cam_07a',
            limits = {
                fov = {
                    default = 60,
                    min = 20,
                    max = 60
                },
                rotation = {
                    maxAngle = 180
                }
            },
            battery = {
                capacity = 100,
                drainRate = 1.5,
                drainRateOffline = 0,
                rechargeItems = {
                    {
                        item = 'mountme_battery',
                        amount = 2,
                        removeOnRecharge = true
                    }
                },
                allowSolarPanel = true
            }
        },
        ['cctv2'] = {
            type = "cctv",
            model = "prop_cctv_cam_04c",
            limits = {
                fov = {
                    default = 60,
                    min = 20,
                    max = 60
                },
                rotation = {
                    maxAngle = 180
                }
            },
            battery = {
                capacity = 100,
                drainRate = 1,
                drainRateOffline = 0,
                allowSolarPanel = true
            }
        },
        ['spycam'] = {
            type = "cctv",
            model = "prop_spycam1",
            limits = {
                fov = {
                    default = 60,
                    min = 20,
                    max = 60
                },
                rotation = {
                    maxAngle = 10
                },
                initialRotationAddition = 180
            },
            battery = {
                capacity = 50,
                drainRate = 2,
                drainRateOffline = 0.5,
                rechargeItems = {
                    {
                        item = 'mountme_battery',
                        amount = 1,
                        removeOnRecharge = true
                    }
                },
                allowSolarPanel = true
            }
        },
        ['motion_sensor'] = {
            type = 'sensor',
            model = "prop_motionsens2",
            battery = {
                capacity = 100,
                drainRate = 0.5,
                drainRateOffline = 0,
                allowSolarPanel = true
            }
        }
    }
}

Copyright © 2025 Felis Development