๐Ÿช›Installation & Configuration

1

Add the resource

Drag the dynyx_prison folder into your resources directory.

Make sure to rename the script from dynyx_prison-main to dynyx_prison or it will not work. Then make sure its in the correct location so the server can access it. Once done, add ensure dynyx_prison to your server.cfg to activate the script.

2

Install Dependencies

Ensure all required dependencies for the script are installed and up to date.

Dependencies usually include core resources like the frameworks (QBCore, QBox or ESX), target systems (ox_target or qb-target) and an inventory system like (ox_inventory, qb-inventory, ps-inventory, or qs-inventory). Missing dependencies may prevent the script from working property.

3

Import the SQL File

Open your database (like HeidiSQL or phpMyAdmin) and import the provided SQL file. This step adds the necessary tables and data structure to your database, ensuring that the prison system can store and retrieve relevant information such as inmate records, escape flags, and confiscated items.

4

Ensure MLO Compatility

Dynyx Prison is designed to work with the GabZ Prison MLO. This MLO is required for proper interior functionality. If you're using a different MLO, open a ticket in our Discord for placement adjustments and support.

โ— Need help with MLO compatibility? ๐ŸŽซ Open a ticket in our Discord for help adapting to other prison interiors.

5

Configure Inventory Integration

Navigate to your inventory folder.

Choose the correct guide for your inventory system. Each guide has specific instructions and images for setting up item images and ensuring full compatibility with your chosen inventory.

Configuration:

Config = {}

-------------------------------
-- ๐Ÿ”ง General Configuration
-------------------------------
Config.Lan = 'en' -- Sets the language for the script. Options: 'en' (English), 'es' (Spanish), 'de' (German), 'fr' (French)

Config.Notifications = "ox_lib"     -- Notification system to use ("ox_lib", "qb-core")
Config.Inventory = "ox_inventory"   -- Inventory system to use ("ox_inventory", "qb-inventory", "qs-inventory", "ps-inventory")
Config.Target = "ox_target"         -- Target system to use ("ox_target", "qb-target")
Config.ProgressBar = "ox_lib" -- ("ox_lib", "qb-core")
Config.Dispatch = "none" -- ("ps-dispatch" / "cd_dispatch" / "qs-dispatch" / "tk_dispatch" / "rcore_dispatch" / "none")

-- Inventory image directory path
Config.InventoryImagePath = "ox_inventory/web/images" -- ("ox_inventory/web/images" / "qb-inventory/html/images" / "ps-inventory/html/images" / "qs-inventory/html/images")

-- Webhook settings for logging
Config.WebHooks = false -- Enable or disable webhook logging. 'false' means logging is disabled.
Config.WebHookURL = "PLACE_YOUR_WEBHOOK_HERE" -- Webhook URL for logging prison-related activities (only used if WebHooks = true)

Config.FineSystem = true            -- Enable or disable fines for prisoners
Config.RequireOfficerNearbyToJail = true         -- Officer must be near player to jail them
Config.RequireOfficerNearbyToRelease = true      -- Officer must be near player to release them
Config.RequireOfficerNearbyToEditSentence = true -- Officer must be near player to modify their sentence
Config.RequiredJobs = { "police" } -- Jobs allowed to handle jail-related tasks
Config.PrisonTickInterval = 60 -- How often (in seconds) a prison sentence is reduced
Config.SentenceReduction = 1   -- Amount of time (in minutes) to reduce sentence every tick

-- Visitation system settings
Config.VisitationRequestDuration = 30 -- Duration (in seconds) the inmate sees the visit request on their screen
Config.VisitationRequestCooldown = 60 -- Cooldown (in seconds) before another visit can be requested
Config.VisitationTime = 60            -- Duration (in seconds) of each visitation period
Config.VisitationCoords = vector4(1828.5759, 2591.8042, 46.0143, 183.6022) -- Coordinates for the visitation room (where the prisoner is teleported during a visit)

-- Blip for the prison location
Config.Blip = {
    Enable = true,
    Coords = vector3(1829.6232, 2605.9277, 45.5662), 
    Sprite = 189,                    
    Display = 4,                            
    Scale = 0.9,                   
    Color = 1,                                  
    Label = "Bolingbroke Penitentiary"       
}

-------------------------------
-- ๐Ÿฝ๏ธ Food System
-------------------------------

Config.PrisonTrayFoods = { -- Items served on the food tray and possible random rewards
    trayItem = "prison_tray", -- Name of the tray item itself
    progressbarDuration = 5000, -- Duration (in milliseconds) of the progress bar for grabbing food
    rewardItems = {
        { name = "sandwich", amount = 1 }, -- Guaranteed item: sandwich
        { name = "water_bottle", amount = 1 }, -- Guaranteed item: water bottle
        { name = "prison_note", amount = 1, chance = 30 }, -- 30% chance to also get prison note
    },
    AvailableHours = { -- Meal serving hours
        morning = {
            startHour = 7,  -- Start of morning meal period
            endHour = 9,    -- End of morning meal period
        },
        evening = {
            startHour = 18, -- Start of evening meal period
            endHour = 20    -- End of evening meal period
        }
    }
}

-------------------------------
-- ๐Ÿ‘• Prison Uniform
-------------------------------

Config.PrisonUniform = {
    male = {
        ["t-shirt"] = { item = 15, texture = 0 },
        ["torso"] = { item = 535, texture = 0 },
        ["decals"] = { item = 0, texture = 0 },
        ["arms"] = { item = 11, texture = 0 },
        ["pants"] = { item = 197, texture = 0 },
        ["shoes"] = { item = 12, texture = 0 },
    },
    female = {
        ["t-shirt"] = { item = 14, texture = 0 },
        ["torso"] = { item = 73, texture = 0 },
        ["decals"] = { item = 0, texture = 0 },
        ["arms"] = { item = 4, texture = 0 },
        ["pants"] = { item = 54, texture = 2 },
        ["shoes"] = { item = 5, texture = 0 },
    }
}

-------------------------------
-- ๐Ÿšช Jail Break Configuration
-------------------------------
Config.ReloadskinOnJailBreak = true -- Reload player skin on successful jailbreak

Config.PrisonZone = { -- This is a poly zone defining the entire prison area. If players leave this zone while jailed, they will be teleported back to their cell.
    vec3(1742.0, 2825.0, 43.0),
    vec3(1862.0, 2717.0, 43.0),
-- REST OF THE CODE HERE
}

Config.tunnelpropDespawn = 1 -- How long (in minutes) the tunnel debris prop stays before despawning
Config.JailBreakCooldown = 30 -- Cooldown (in minutes) before another prison break attempt can be made
Config.ExplosiveItem = 'makeshift_explosive' -- Item required to plant explosives for the jailbreak

Config.BribeGuard = {
    BribeItem = "bribe_package",          -- The item the player must offer to bribe a guard
    BribeReward = "prison_keycard",       -- Item the player receives if the bribe is successful
    BribeChance = 65,                     -- Percentage chance that the bribe will succeed (0-100)
    SentenceAddedOnFail = 10,             -- Number of minutes added to the sentence if the bribe fails
}

Config.PrisonBreakSystem = {
    JailBreakWall = {
        WallCoords = vector4(1624.9685, 2572.9958, 45.5648, 271.7144), -- Location and heading of the wall to blow up
        tunnelDebrisProp = 'prop_pile_dirt_06',                         -- Prop model to use for the blown-up wall effect
        tunnelDebrisCoords = vector3(1625.27, 2572.87, 44.00),         -- Location to spawn the debris prop after explosion
        camOffset = vec(2.0, -2.0, 1.0)                                -- Camera offset for cutscene when planting the explosive
    },
    insideTunnel = {
        TunnelEntrance = vector4(-425.1760, 2064.5227, 120.2182, 97.4857), -- Entry point of the underground tunnel (where the player is teleported to)
        ExitZone = { -- Polygon zone defining the exit area of the tunnel
            vec3(-597.0, 2084.0, 131.0),
            -- REST OF THE CODE HERE
        }
    },
    TunnelExit = {
        coords = vector4(1728.0026, 2829.4392, 42.5128, 308.4384) -- Where the player appears after successfully escaping the tunnel
    }
}

Config.Escapedoordespawn = 1 -- How long (in minutes) the "Enter Escape Door" target is active before despawning
Config.KeycardSwipeCooldown = 45 -- How long (in minutes) before the player can swipe the keycard again

Config.KeycardEscape = {
    Keycard = {
        Coords = vector3(1637.21, 2565.95, 45.85), -- Where the keycard swiper is located
        prop = 'h4_prop_h4_ld_keypad_01', -- Model name for the keycard swiper prop
        ItemRequired = "prison_keycard" -- The required item in inventory to swipe the keycard
    },
    Door = {
        Coords = vector3(1636.35, 2565.87, 45.97) -- The prison door that gets unlocked after swiping the keycard
    },
    insideTunnel = {
        TunnelEntrance = vector4(-483.7166, 1894.8309, 119.8146, 95.0017), -- Entry point of the underground tunnel (where the player is teleported to)
        ExitZone = { -- Polygon zone defining the exit area of the tunnel
            vec3(-597.0, 2084.0, 131.0),
            vec3(-584.0, 2088.0, 131.0),
            vec3(-598.0, 2088.0, 131.0),
        }
    },
    TunnelExit = {
        coords = vector4(1728.0026, 2829.4392, 42.5128, 308.4384) -- Where the player appears after successfully escaping the tunnel
    }
}

-------------------------------
-- ๐Ÿ’ผ Prison Jobs & Peds
-------------------------------

Config.PrisonJob = {
    Ped = {
        coords = vector4(1740.5616, 2520.0981, 45.5650, 227.2604),
        model = 's_m_m_prisguard_01', -- Prisoner Worker ped model
        scenario = 'WORLD_HUMAN_CLIPBOARD' -- Ped idle animation
    },
    FoodPickupPed = {
        coords = vector4(1782.3442, 2560.7769, 45.6731, 179.3114),
        model = 's_m_m_strvend_01', -- Prion Employee Worker ped model
        scenario = 'WORLD_HUMAN_STAND_IMPATIENT' -- Ped idle animation

    },
    FrontDeskPed = {
        coords = vector4(1840.3311, 2577.7727, 46.0144, 0.0489),
        model = 's_m_m_prisguard_01', -- Prion Employee Worker ped model
        scenario = 'WORLD_HUMAN_STAND_IMPATIENT' -- Ped idle animation

    },
    CommissaryFood = {
        coords = vector4(1779.5094, 2560.6841, 45.6731, 181.7391),
        model = 'mp_m_securoguard_01',
        scenario = 'WORLD_HUMAN_STAND_IMPATIENT'

    },
    IllegalShopPed = {
        coords = { -- it will select a random
            vector4(1721.7913, 2502.8813, 45.5649, 118.6933),
            vector4(1625.5107, 2566.9346, 45.5648, 96.2189),
            vector4(1625.7917, 2474.8333, 55.1931, 225.8146),
            vector4(1777.4590, 2513.5605, 55.1436, 222.1106),
        },
        model = 'u_m_y_prisoner_01',
        scenario = 'WORLD_HUMAN_LEANING'
    },
    BribeGuardPed = {
        coords = { -- it will select a random
            vector4(1773.7635, 2520.7891, 54.1548, 300.8994),
            vector4(1665.4535, 2503.1833, 44.5700, 320.1962),
            vector4(1655.3390, 2487.7661, 54.1614, 319.7329),
            vector4(1693.5720, 2540.9490, 44.5648, 359.8102),
        },
        model = 's_m_m_prisguard_01',
        scenario = 'WORLD_HUMAN_SMOKING', 
    },
    Jobs = {
        {
            id = "electrician",       -- Unique identifier for this job (do not modify)
            title = "Electrician",    -- Display name of the job
            description = "Repair broken lights and electrical panels in the prison.", -- Short job description
            payRateMin = 5,           -- Minimum pay rate (in your server's currency) for completing the job
            payRateMax = 10,          -- Maximum pay rate for the job
            SentenceReduction = 15,   -- How much prison time (in minutes or months) is reduced for completing the job
            icon = "fa-bolt",         -- FontAwesome icon to represent the job in UIs (if used)
            progressbarDuration = 2500, -- Duration of the progress bar in milliseconds (2.5 seconds)

            -- Possible contraband rewards while doing the job
            ContraBandItems = {
                ['1'] = { item = "circuit_board", amount = 1, chance = 30 }, -- 30% chance to get 1 circuit_board
                ['2'] = { item = "scrap_metal", amount = 2, chance = 20 },   -- 20% chance to get 1 scrap_metal
            },
        },
        {
            id = "move_boxes",
            title = "Move Boxes",
            description = "Transport supply boxes across the facility.",
            payRateMin = 4,
            payRateMax = 8,
            SentenceReduction = 10,
            icon = "fa-box",
            progressbarDuration = 2500,
            ContraBandItems = {
                ['1'] = { item = "scrap_metal", amount = 3, chance = 25 },
                ['2'] = { item = "prison_note", amount = 1, chance = 15 },
            },
        },
        {
            id = "clean_cells",
            title = "Clean Cells",
            description = "Sweep and sanitize prisoner cells to maintain hygiene.",
            payRateMin = 6,
            payRateMax = 10,
            SentenceReduction = 25,
            icon = "fa-broom",
            progressbarDuration = 5000,
            ContraBandItems = {
                ['1'] = { item = "shank_piece", amount = 1, chance = 20 },
                ['2'] = { item = "rag", amount = 1, chance = 25 },
                ['3'] = { item = "soap_bar", amount = 1, chance = 15 },
            },
        },
        {
            id = "repair_walls",
            title = "Facility Repairs",
            description = "Fix cracked walls, damaged floors, and broken televisions.",
            payRateMin = 6,
            payRateMax = 12,
            SentenceReduction = 25,
            icon = "fa-tools",
            progressbarDuration = 2500,
            ContraBandItems = {
                ['1'] = { item = "scrap_metal", amount = 1, chance = 30 },
                ['2'] = { item = "cleaning_chemicals", amount = 1, chance = 20 },
            },
        },
    },
}
-------------------------------
-- ๐Ÿ›’ Commissary Shop
-------------------------------

Config.PrisonShop = {
    {
        name = "sandwich",         -- The internal item name (must match your inventory system)
        label = "sandwich",        -- Display name for the item in the shop
        price = 15,                -- Price of the item (currency based on your economy system)
        description = "Fresh made sandwich", -- Short description for the shop UI
        category = "Food",         -- Category for organizing shop items
        limit = 5,                 -- Max number of this item you can buy per transaction
    },
}

Config.IllegalShop = {
    {
        name = "weapon_switchblade", -- The internal item name (must match your inventory system)
        label = "Shank",              -- Display name for the item in the shop
        price = 75,                   -- Price of the item (currency based on your economy system)
        description = "A sharp weapon for defense.", -- Short description for the shop UI
        limit = 2,                    -- Max number of this item you can buy per transaction
    },
   -- REST OF THE CODE HERE
}

Config.IllegalTrades = {
    {
        id = 1, -- Unique identifier for this trade

        -- Items required for the trade
        required = {
            { name = "circuit_board", label = "Circuit Board", amount = 3 }, -- 3 Circuit Boards
            { name = "cleaning_chemicals", label = "Cleaning Chemicals", amount = 6 }, -- 6 Cleaning Chemicals
            { name = "scrap_metal", label = "Scrap Metal", amount = 5 }, -- 5 Scrap Metal
        },

        -- Reward item(s) for completing the trade
        reward = {
            { name = "makeshift_explosive", label = "Makeshift Explosive", amount = 1 } -- 1 Makeshift Explosive
        }
    },
    -- REST OF THE CODE HERE

}

-------------------------------
-- ๐Ÿ“ฆ Prison Job Props
-------------------------------

Config.JobProps = {
    ElectricianJob = {
        -- Electrical panel
        {
            model = 'm23_1_prop_m31_electricbox_03a', -- Prop model for the electrical job
            coords = vector4(1773.68, 2487.05, 55.65, 30.0497), -- Location and rotation of this prop
        },
        -- REST OF THE CODE HERE
    },
    CleanCells = {
        {
            model = 'ng_proc_food_chips01a',
            coords = vector4(1758.6594, 2484.1870, 46.5611, 103.7450),
        },
       -- REST OF THE CODE HERE
    },
    FacilityRepairs = {
        {
            coords = vector4(1772.04, 2497.45, 46.33, 294.2439)
        },
        -- REST OF THE CODE HERE
    },
    MoveBoxes = {
        BoxLocations = {
        vector4(1739.2025, 2503.4131, 45.5651, 170.0822), -- Starting box location #1
         -- REST OF THE CODE HERE
        },

        BoxModel = 'prop_cs_cardbox_01', -- Model for the box the player carries
        DropoffBoxProp = 'prop_boxpile_01a', -- Model for the dropoff location (pile of boxes)
        DropoffPropCoords = vector4(1756.6708, 2499.4097, 45.7407, 298.6996), -- Where the dropoff prop is placed

        CanJump = false, -- Set to true if you want players to be able to jump while holding a box
        CanSprint = true, -- Set to true if you want players to be able to sprint while holding a box
    }
}

-------------------------------
-- ๐Ÿงป Toilet Stashes
-------------------------------

Config.ToiletStashInfo = {
    Enabled = true,     -- Enables the toilet stash system (hidden stash spots inside toilets)
    MaxActive = 3,      -- Maximum number of stash zones to activate at once
    Slots = 5,          -- Number of slots in the stash (like an inventory)
    Weight = 5000       -- Maximum weight of items the stash can hold
}

Config.ToiletStashCoords = { -- All possible stash spawn locations in the prison bathrooms (randomly chosen)
    vector3(1767.72, 2502.99, 45.52),
    vector3(1764.58, 2501.18, 45.53),
    -- REST OF THE CODE HERE
}


-------------------------------
-- โ›๏ธ Community Service
-------------------------------

Config.ComServCoords = vector4(-1201.7500, -1800.2966, 3.9086, 70.0877) -- Location where players do community service tasks
Config.ComServReleaseCoords = vector4(-1183.0693, -1773.5372, 3.9085, 303.1825) -- Location to release players after community service

Config.ComServProps = {
    { model = "prop_rub_binbag_sd_01" },  -- Trash bag prop
    { model = "prop_cardbordbox_05a" },   -- Cardboard box prop
    { model = "ng_proc_tyre_01" },        -- Old tire prop
}

Config.ComServAnimation = {
    duration = 4500,
    dict = "anim@amb@drug_field_workers@rake@male_a@base",
    anim = "base",
    prop = "prop_tool_broom",
    bone = 28422,
    pos = vector3(-0.01, 0.04, -0.03),
    rot = vector3(0, 0, 0)
}

Config.ComServ = {
    RespawnTime = 10, -- How long (in seconds) before a cleaned prop respawns
    Outline = {
        Enabled = true,                  -- Should props have an outline for players to see them easier?
        Blink = true,                    -- Should the outline blink?
        Color = { r = 72, g = 187, b = 120, a = 255 }, -- Outline color (RGBA)
        Speed = 500                      -- Speed of blinking outline in ms
    },
    CleaningScenario = "WORLD_HUMAN_JANITOR", -- Animation scenario while cleaning

    CommunityServicePolyZone = { -- Polygon zone for the entire community service area
        vec3(-1587.0, -1085.0, 6.0),
         -- REST OF THE CODE HERE
    }
}

Config.ComServTrash = {
    vector4(-1209.7437, -1830.4808, 2.5593, 127.4095), -- Location of the trash disposal or drop-off
    -- REST OF THE CODE HERE
}

-------------------------------
-- ๐Ÿšช Cells, Cutscene, Release
-------------------------------

Config.ReleaseCoords = vector4(1846.4813, 2586.0027, 45.6727, 274.5671) -- Where the player is teleported when released from prison
Config.CutsceneCell = vector4(1747.6288, 2489.1650, 49.5149, 29.4475)  -- Cell used for cutscene teleport (e.g., intro to prison scene)

Config.CellsLoc = { -- All possible cell spawn locations for prisoners
    vector4(1767.9493, 2500.9873, 45.7407, 203.8192), -- 1
    -- REST OF THE CODE HERE
}

Last updated