> For the complete documentation index, see [llms.txt](https://docs.rainmad.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rainmad.com/resources/sea-battle-dive-sharks-and-crate-tow/configuration.md).

# Configuration

## General Configuration

```lua
Config = {}

----------------------------------
------------ General -------------
----------------------------------

Config.framework = {
    name = "auto", -- esx | qb | auto (auto-detects)
    targetScript = "ox_target", -- ox_target | qb-target
    useOxNotify = true, -- use ox_lib notify instead of framework notify
    debug = false, -- developer debug prints
}

Config.moneyOptions = {
    moneyName = "money", -- account name, or item name if moneyIsItem
    moneyIsItem = false,
}

Config.seaBattle = {
    ----------------------------------
    ---------- Event Start -----------
    ----------------------------------

    start = {
        auto = {
            enabled = false,
            interval = 30,
        },
        command = {
            enabled = true,
            name = "startseabattle",
            staffList = {
                ["license:change_me"] = true,
            }
        },
        npc = {
            enabled = true,
            model = "s_m_y_dockwork_01",
            coords = vector4(-1611.922, 5262.081, 3.974, 206.627),
            item = {
                enabled = false,
                itemName = "sea_intel", -- consumed to start when intelItem is enabled
                removeItemOnUse = true,
            },
        },
        requiredPlayers = 0,
        maxConcurrent = 3, -- how many events can be active at once
        cooldown = 10, -- minutes a drop slot stays locked after an event ends
        missionTimer = 30, -- minutes before an undelivered event auto-destructs
    },
    notify = {
        announce = true, -- big scaleform shard announcement
        jobList = {}, -- empty = everyone is notified; else only these jobs
    },

    ----------------------------------
    ---------- Plane & Drop ----------
    ----------------------------------

    plane = {
        lineLength = 600.0, -- plane fly-in line length over the drop point
        planeSpeed = 150.0, -- km/h
        planeModels = { "titan" },
        pilotModels = { "s_m_m_pilot_01", "s_m_y_pilot_01" },
    },
    dropCoords = {
        vector3(-1687.698, 5330.878, 0.324)
    },
    deliveryCoords = {
        vector3(-1661.575, 5159.983, -0.249)
    },

    ----------------------------------
    ------------- Blips --------------
    ----------------------------------

    blipOptions = {
        plane = {
            enabled = true,
            label = "Smuggler Plane",
            sprite = 423,
            color = 1,
            scale = 1.2,
        },
        crate = {
            enabled = true,
            label = "Contraband Crate",
            sprite = 478,
            color = 5,
            scale = 1.0,
        },
        npc = {
            enabled = true,
            label = "Maritime Contact",
            sprite = 410,
            color = 3,
            scale = 0.9,
        },
    },

    ----------------------------------
    --------- Crate & Towing ---------
    ----------------------------------
    bob = {
        enabled = true,
        height = 0.35, -- vertical sway in meters
        speed = 0.75, -- sway cycles per second
        tilt = 1.25, -- pitch/roll sway in degrees
    },
    tow = {
        attachDistance = 3.0, -- proximity radius (m) for the attach/cut text prompt
        secureTime = 120, -- seconds you must hold next to the crate (under fire) before the rope can be grabbed
    },

    ----------------------------------
    ------------- Guards -------------
    ----------------------------------

    guards = {
        enabled = true,
        boatModel = "dinghy5",
        pedModel = "s_m_y_blackops_01",
        pedWeapon = "WEAPON_CARBINERIFLE",
        boatCount = 3, -- guard boats spawned in a ring around the drop
        accuracy = 10, -- ped weapon hit chance (0-100), lower = miss more
        shootRate = 50, -- ped fire rate (0-1000); note: barely affects drive-by / mounted-gun firing
        health = 200,
    },

    ----------------------------------
    ------ Underwater & Sharks -------
    ----------------------------------

    underwater = {
        chance = 100, -- % chance an event also spawns the underwater layer
        searchTime = 5, -- seconds the search progress bar takes
        scuba = {
            item = "rebreather", -- usable item that grants underwater air and is required to search the wrecks
            duration = 120, -- seconds of air per use
        },
        wreckModels = { -- sunken junk to search
            "prop_rub_carwreck_9",
            "prop_rub_carwreck_8",
        },
        wreckAmount = {
            min = 3,
            max = 5,
        },
        searchPointsPerWreck = {
            min = 1,
            max = 3
        },
        shark = {
            enabled = true,
            amount = {
                min = 3,
                max = 5,
            },
            biteDamage = 20, -- damage per bite
            biteCooldown = 1500, -- ms between bites from the same shark
        }
    },

    ----------------------------------
    ------- Equipment & Spear --------
    ----------------------------------

    spear = {
        item = "speargun", -- usable inventory item; on use the weapon is handed to the player
    },

    ----------------------------------
    ---------- Maritime NPC ----------
    ----------------------------------

    npcOptions = {
        rentVehicles = {
            {
                model = "dinghy",
                price = 100,
            },
            {
                model = "seashark",
                price = 50,
            }
        },
        items = {
            {
                label = "Rebreather",
                name = "rebreather",
                price = 50,
            },
            {
                label = "Speargun",
                name = "speargun",
                price = 100,
            },
        },
        spawnCoords = { -- rent vehicles
            vector4(-1602.375, 5260.171, 0.120, 24.24)
        }
    },
}

----------------------------------
------------- Loot ---------------
----------------------------------

Config.seaBattle.lootSystem = {
    surface = {
        itemAmount = function() return math.random(3, 6) end,
        money = function() return math.random(5000, 15000) end,

        categories = {
            {
                name = "weapon",
                chance = 35,
                items = {
                    { itemName = "WEAPON_CARBINERIFLE", chance = 40, amount = function() return 1 end },
                    { itemName = "WEAPON_SMG", chance = 35, amount = function() return 1 end },
                    { itemName = "WEAPON_SNIPERRIFLE", chance = 18, amount = function() return 1 end },
                    { itemName = "WEAPON_RPG", chance = 7, amount = function() return 1 end },
                },
            },
            {
                name = "valuable",
                chance = 40,
                items = {
                    { itemName = "goldbar", chance = 50, amount = function() return math.random(1, 2) end },
                    { itemName = "diamond", chance = 35, amount = function() return 1 end },
                    { itemName = "artifact", chance = 15, amount = function() return 1 end },
                },
            },
            {
                name = "ammo",
                chance = 25,
                items = {
                    { itemName = "rifle_ammo", chance = 50, amount = function() return math.random(60, 120) end },
                    { itemName = "smg_ammo", chance = 30, amount = function() return math.random(60, 120) end },
                    { itemName = "sniper_ammo", chance = 20, amount = function() return math.random(10, 20) end },
                },
            },
        },
    },

    underwater = {
        itemAmount = function() return math.random(1, 3) end,
        money = function() return math.random(1000, 4000) end,

        categories = {
            {
                name = "salvage",
                chance = 60,
                items = {
                    { itemName = "scrap_metal", chance = 60, amount = function() return math.random(2, 5) end },
                    { itemName = "copper", chance = 30, amount = function() return math.random(1, 3) end },
                    { itemName = "electronics", chance = 10, amount = function() return 1 end },
                },
            },
            {
                name = "valuable",
                chance = 40,
                items = {
                    { itemName = "goldbar", chance = 60, amount = function() return 1 end },
                    { itemName = "diamond", chance = 40, amount = function() return 1 end },
                },
            },
        },
    },
}

----------------------------------
------------ Strings -------------
----------------------------------

Strings = {
    ["event_title"] = "Sea Battle",
    ["event_started"] = "A smuggler plane is dropping contraband at sea!",
    ["need_item"] = "You need: x%s %s",
    ["not_staff"] = "You are not allowed to do this.",
    ["no_slots"] = "Too many active operations right now.",
    ["not_enough_players"] = "Not enough players online for an operation.",
    ["spawn_occupied"] = "The boat spawn area is blocked.",

    ["add_item_log"] = "Player: %s\nIdentifier: %s\nItem: %s\nAmount: %s",
    ["add_money_log"] = "Player: %s\nIdentifier: %s\nMoney: $%s",
    ["start_log"] = "Started by: %s\nIdentifier: %s\nTrigger: %s\nEvent: %s",

    ["talk_to_contact"] = "Talk to Contact",
    ["rent_boat"] = "Rent Boat",
    ["rent_boat_desc"] = "Rent a boat to reach the open sea",
    ["buy_item"] = "Buy Item",
    ["buy_item_desc"] = "Dive gear and equipment",
    ["start_operation"] = "Start Operation",
    ["start_operation_desc"] = "Trigger a contraband sea drop",
    ["price"] = "Price: $%s",

    ["grab_rope"] = "[E] Grab Rope",
    ["cut_rope"] = "[E] Cut Rope",
    ["securing_rope"] = "Securing the rope...",
    ["tying_boat"] = "Tying to the boat...",
    ["cutting_rope"] = "Cutting the rope...",
    ["let_go_rope"] = "You let go of the rope.",
    ["attach_to_boat"] = "[E] Attach to boat  [X] Cancel",
    ["go_to_boat"] = "[X] Cancel  -  go to your boat",

    ["delivery_point"] = "Delivery Point",
    ["deliver_prompt"] = "[E] Deliver Crate",
    ["delivering"] = "Delivering...",
    ["delivered"] = "Contraband delivered! You earned $%s.",

    ["sunken_wreck"] = "Sunken Wreck",
    ["search_wreck"] = "[E] Search Wreck",
    ["searching_wreck"] = "Searching the wreck...",
    ["need_rebreather"] = "You need a rebreather to dive here.",
    ["salvaged"] = "Salvaged contraband! You found $%s.",
    ["shark_blip"] = "Shark",
    ["scuba_on"] = "Rebreather on.",
    ["scuba_depleted"] = "Rebreather air depleted.",
}

```

### Heist Configuration

```
Config.heist = {
    --------------------------
    ----- QUIET APPROACH -----
    --------------------------
    terminalHacking = {
        coords = vector3(-623.15, -216.22, 53.54),
        requiredItem = "hacker_phone",
        removeItemOnUse = false,

        -- minigame options
        minigame = "none",
        duration = 60,      -- duration of hack minigame in seconds
        solutionLength = 5, -- length of the solution string
        policeAlertDuration = 30, -- seconds (after the hacking incident should the police be alerted)
    },
    plantingGasBomb = {
        ventModel = "prop_aircon_m_04", -- model of the vent where the bomb should be planted
        coords = vector3(-631.13, -228.23, 55.65),
        offset = vector3(-0.83, -0.5, 0.8), -- offset from the coords where the bomb should be planted (relative to the vent)
        requiredItem = "gas_bomb",
        removeItemOnUse = true,

        mask = {
            enable = true,
            requiredItem = "gas_mask",
            removeItemOnUse = true,

            clotheId = 175,
            duration = 300, -- duration of the gas mask effect in seconds
            damage = 5, -- damage dealt to the player every interval while the gas mask is active
            damageInterval = 5, -- interval in seconds at which the damage is applied to the player while the gas mask is active
            zone = vector4(-622.364, -231.020, 38.047, 11.0)
        },

        -- minigame options
        minigame = "none",
    },
    --------------------------
    ----- LOUD APPROACH ------
    --------------------------
    vangelicoEntrance = {
        coords = vector3(-631.760, -237.737, 38.073),
        lockpick = {
            requiredItem = "lockpick",
            removeItemOnUse = true,

            strength = 0.1, -- from 0.1 (easy) to 7 (hard)
            difficulty = 0.1, -- from 0.1 (easy) to 7 (hard)
            pins = 2, -- number of pins (max 9)

            -- minigame options
            minigame = "none",
        },
        thermite = {
            offset = vector3(1.3, -0.03, 0.0),
            requiredItem = "thermite_bomb",
            removeItemOnUse = true,

            -- minigame options
            minigame = "default",
        },
    },
    -------------------------
    ---- GENERAL OPTIONS ----
    -------------------------
    keypad = {
        coords = vector3(-629.135, -230.949, 38.057),
        searchCoords = {
            vector3(-625.925, -226.127, 38.057),
            vector3(-623.040, -235.807, 38.057),
            vector3(-618.774, -236.339, 38.057),
            vector3(-617.183, -231.740, 38.057),
            vector3(-621.453, -225.867, 38.057),
            vector3(-622.500, -229.772, 38.057),
            vector3(-630.369, -232.243, 38.057)
        },
    },
    doors = {
        { -- front doors
            door_1_model = 1425919976,
            door_2_model = 9467943,
            door_1_coords = vector4(-631.95538330078, -236.33326721191, 38.206531524658, 306.60577392578),
            door_2_coords = vector4(-630.42651367188, -238.43754577637, 38.206531524658, 305.39260864258),
            status = "locked", -- "locked", "unlocked"
        },
        { -- security room door
            door_1_model = 1335309163,
            door_1_coords = vector4(-629.13385009766, -230.15170288086, 38.20658493042, 36.000022888184),
            status = "locked", -- "locked", "unlocked"
        }
    },
    ---------------------------
    ----- LOOTABLE OPTIONS ----
    ---------------------------
    containers = {
        --  Weapons allowed to smash jewelry cabinets (whitelisted weapons)
        smashWeapons = {
            'WEAPON_ASSAULTRIFLE',
            'WEAPON_CARBINERIFLE',
            'WEAPON_ADVANCEDRIFLE',
            'WEAPON_BULLPUPRIFLE',
        },

        -- required items for certain loot actions:
        requiredItems = {
            paintings = {
                requiredItem = "painting_knife",
                removeItemOnUse = false,
            },
            displayCases = {
                requiredItem = "glass_cutter",
                removeItemOnUse = false,
            },
            statues = {
                requiredItem = "bag",
                removeItemOnUse = false,
            }
        },

        -- Cabinets:
        cabinets = {
            {
                coords = vector4(-626.83, -235.35, 38.05, 36.17),
                rayFire = 'DES_Jewel_Cab3',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-625.81, -234.7, 38.05, 36.17),
                rayFire = 'DES_Jewel_Cab4',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-626.95, -233.14, 38.05, 216.17),
                rayFire = 'DES_Jewel_Cab',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-628.0, -233.86, 38.05, 216.17),
                rayFire = 'DES_Jewel_Cab',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-625.7, -237.8, 38.05, 216.17),
                rayFire = 'DES_Jewel_Cab3',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-626.7, -238.58, 38.05, 216.17),
                rayFire = 'DES_Jewel_Cab2',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-624.55, -231.06, 38.05, 305.0),
                rayFire = 'DES_Jewel_Cab4',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-623.13, -232.94, 38.05, 305.0),
                rayFire = 'DES_Jewel_Cab',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-620.29, -234.44, 38.05, 216.17),
                rayFire = 'DES_Jewel_Cab',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-619.15, -233.66, 38.05, 216.17),
                rayFire = 'DES_Jewel_Cab3',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-620.19, -233.44, 38.05, 36.17),
                rayFire = 'DES_Jewel_Cab4',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-617.63, -230.58, 38.05, 305.0),
                rayFire = 'DES_Jewel_Cab2',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-618.33, -229.55, 38.05, 305.0),
                rayFire = 'DES_Jewel_Cab3',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-619.7, -230.33, 38.05, 125.0),
                rayFire = 'DES_Jewel_Cab',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-620.95, -228.6, 38.05, 125.0),
                rayFire = 'DES_Jewel_Cab3',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-619.79, -227.6, 38.05, 305.0),
                rayFire = 'DES_Jewel_Cab2',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-620.42, -226.6, 38.05, 305.0),
                rayFire = 'DES_Jewel_Cab',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-623.94, -227.18, 38.05, 36.17),
                rayFire = 'DES_Jewel_Cab4',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-624.91, -227.87, 38.05, 36.17),
                rayFire = 'DES_Jewel_Cab3',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            },
            {
                coords = vector4(-623.94, -228.05, 38.05, 216.17),
                rayFire = 'DES_Jewel_Cab2',
                rewards = {
                    { itemName = "ring", amount = { min = 1, max = 2 } },
                    { itemName = "necklace", amount = { min = 1, max = 3 } },
                }
            }
        },

        -- Paintings:
        paintings = {
            {
                model = 'h4_prop_h4_painting_01h',
                coords = vector4(-627.21325683594, -228.30999755859, 38.106048583984, 92.391586303711),
                rewards = {
                    { itemName = "painting_01h", amount = { min = 1, max = 1 } },
                }
            },
            {
                model = 'h4_prop_h4_painting_01d',
                coords = vector4(-622.79998779297, -225.13999938965, 38.106048583984, 339.9309387207),
                rewards = {
                    { itemName = "painting_01d", amount = { min = 1, max = 1 } },
                }
            },
            {
                model = 'h4_prop_h4_painting_01e',
                coords = vector4(-617.0, -233.2200012207, 38.106048583984, 271.89691162109),
                rewards = {
                    { itemName = "painting_01e", amount = { min = 1, max = 1 } },
                }
            },
            {
                model = 'h4_prop_h4_painting_01b',
                coords = vector4(-621.36102294922, -236.33099365234, 38.106048583984, 161.18635559082),
                rewards = {
                    { itemName = "painting_01b", amount = { min = 1, max = 1 } },
                }
            }
        },

        -- Display Cases:
        displayCases = {
            {
                baseModel = "h4_prop_h4_glass_disp_01a",
                displayModel = "h4_prop_h4_diamond_disp_01a",
                rewardModel = "h4_prop_h4_diamond_01a",
                coords = vector4(-617.4622, -227.4347, 37.057, 127.06),
                rewardOffset = vector3(0.0, 0.0, 1.225),
                rewards = {
                    { itemName = "big_diamond", amount = 1 },
                }
            },
            {
                baseModel = "h4_prop_h4_glass_disp_01a",
                displayModel = "h4_prop_h4_diamond_disp_01a",
                rewardModel = "h4_prop_h4_art_pant_01a",
                coords = vector4(-631.7185, -234.6784, 36.9402, -53.705),
                rewardOffset = vector3(0.0, 0.0, 1.25),
                rewards = {
                    { itemName = "panther", amount = 1 },
                }
            },
            {
                baseModel = "h4_prop_h4_glass_disp_01a",
                displayModel = "h4_prop_h4_neck_disp_01a",
                rewardModel = "h4_prop_h4_necklace_01a",
                coords = vector4(-628.8231, -238.7317, 36.8647, -53.705),
                rewardOffset = vector3(0.0, 0.0, 1.2),
                rewards = {
                    { itemName = "diamond_necklace", amount = 1 },
                }  
            }
        },

        -- Statues:
        statues = {
            {
                tableModel = "v_ret_tablesml",
                statueModel = "vw_prop_casino_art_panther_01b",
                coords = vector4(-622.04541015625, -230.70222473145, 37.058856964111, 303.0),
                rewards = {
                    { itemName = "panther_statue", amount = { min = 1, max = 1 } },
                }
            }
        },

        -- Safes:
        safes = {
            {
                model = "h4_prop_h4_safe_01a",
                coords = vector4(-630.88995361328, -228.27618408203, 36.959362030029, 35.38557434082),
                difficulty = 1, -- 1-4 (1 being the easiest, 4 being the hardest)
                rewards = {
                    { itemName = "money", amount = { min = 500, max = 1500 } },
                }
            }
        }
    },
}


Config.missionData = {
    takePhoto = {
        vector3(-632.86, -238.62, 38.07),
        vector3(-623.01, -216.17, 53.54),
        vector3(-622.48, -233.67, 59.16),
        vector3(-623.24, -231.54, 38.06),
        vector3(-626.04, -238.05, 38.06),
        vector3(-629.15, -230.69, 38.06)
    },
    takeEquipment = {
        pedModel = "g_m_y_mexgang_01",
        coords = {
            vector4(591.996, 2782.770, 42.481, 8.644)
        },
        items = {
            {
                name = "hacker_phone",
                amount = 1
            },
            {
                name = "gas_bomb",
                amount = 1
            },
            {
                name = "gas_mask",
                amount = 4
            },
            {
                name = "glass_cutter",
                amount = 1
            },
            {
                name = "painting_knife",
                amount = 1
            },
            {
                name = "bag",
                amount = 1
            },
        }
    },
    takeClothes = {
        pedModel = "s_m_m_autoshop_02",
        coords = {
            vector4(632.676, -3015.434, 6.336, 359.265)
        },
        items = {
            {
                name = "outfit_bag",
                amount = 1
            }
        }
    },
}
```
