Configuration

This section includes all configurable files for the selected script. Most settings are configured automatically, but each config.lua file contains a header comment explaining the purpose and usage of every configuration type. Be sure to read the header of each file carefully to fully understand how to customize and adapt the system for QBCORE, ESX, or standalone environments, ensuring seamless integration with your server.


qs-billboards/config.lua
-- ============================================================================
-- BILLBOARD SYSTEM CONFIGURATION
-- ============================================================================

Config = {
    Debug = true,
    ResourceName = GetCurrentResourceName(),
    Locale = 'en',
-- Command to open secondary menu
     Command = "billboard",
    -- Billboard System Settings
    Billboard = {
        Enabled = true,

        -- Available billboard models
        Models = {
            ['prop_huge_display_01'] = {
                name = 'Large Billboard (Type 1)',
                width = 8.0,
                height = 4.5,
                duiSize = { x = 1280, y = 720 },
                defaultRenderDistance = 150.0  -- Default render distance for this model
            },
            ['prop_huge_display_02'] = {
                name = 'Large Billboard (Type 2)',
                width = 8.0,
                height = 4.5,
                duiSize = { x = 1280, y = 720 },
                defaultRenderDistance = 150.0  -- Default render distance for this model
            },
            ['v_ilev_cin_screen'] = {
                name = 'Cinema Screen (Large)',
                width = 6.0,
                height = 3.5,
                duiSize = { x = 1280, y = 720 },
                defaultRenderDistance = 300.0  -- Higher default for cinema screens to match DUI visibility
            }
        },

        -- Model render target mapping for DUI texture replacement
        -- textureDict and textureName default to renderTarget if not specified
        RenderTargets = {
            ['prop_huge_display_01'] = { renderTarget = 'big_disp', width = 1.0, height = 1.0 },
            ['prop_huge_display_02'] = { renderTarget = 'big_disp', width = 1.0, height = 1.0 },
            ['v_ilev_cin_screen']   = { renderTarget = 'cinscreen', width = 1.0, height = 1.0 }  -- Changed from 'cinscreen' to 'cinescreen' (with 'e')
        },

        -- Default settings
        DefaultRenderDistance = 90.0,
        DefaultVolume = 0.5,
        MaxBillboards = 5,
        
        -- Legacy/fallback settings for DUI system
        Model = `prop_huge_display_01`,  -- Default model for spawning
        RenderTarget = "big_disp",
        Range = 10.0,
        Scale = 1.0,
        Offset = vector3(0.0, 0.0, 0.0),
        DUIWidth = 1280,   -- Default DUI width (720p)
        DUIHeight = 720,   -- Default DUI height (720p)

        -- Content types
        ContentTypes = {
            'utube',    -- YouTube video
            'website',  -- Website iframe
            'image',    -- Static image with optional audio
            'video'     -- Direct video file (.mp4/.m3u8)
        },

        -- Permission settings
        Permissions = {
            AdminOnly = false, -- Set to false to allow all players
            UseAcePermissions = false, -- Use FiveM ACE permissions instead of job checks
            AcePermission = 'billboard.admin', -- ACE permission to check
            AdminJobs = {
                'admin',
                'god',
                'owner'
            },
            -- Add specific job permissions here if needed
            JobPermissions = {
                -- 'police': true,
                -- 'ambulance': true,
            }
        },

        -- Player Menu Options (controls ox_lib menu options for all players)
        PlayerMenuOptions = {
            AllowVideoInput = true,  -- Allow players to input YouTube videos via /billboard command
            AllowStopVideo = true,   -- Allow players to stop videos via /billboard command
            AllowSetVolume = true    -- Allow players to set volume via /billboard command
        }
    },

    -- Database settings
    Database = {
        TableName = 'billboards'
    },

    -- UI Settings
    UI = {
        MaxDistance = 10.0, -- Max distance to interact with billboards
        FadeDistance = 25.0, -- Distance at which billboards start fading
        UpdateInterval = 1000 -- How often to update billboard states (ms)
    },

    -- Audio Settings
    Audio = {
        MaxVolume = 1.0,
        MinVolume = 0.0,
        DefaultVolume = 0.5,
        FadeOutDistance = 50.0 -- Distance at which audio starts fading out
    },

    -- Development settings
    Dev = {
        LogLevel = 'info', -- debug, info, warn, error
        EnableCommands = true,
        TestMode = false -- Enable test billboards
    }
}

-- ============================================================================
-- DEBUG LOGGING 
-- ============================================================================

function Config.Log(level, message, ...)
    if not Config.Debug and level == 'debug' then return end

    local levels = { debug = 0, info = 1, warn = 2, error = 3 }
    if levels[level] < levels[Config.Dev.LogLevel or 'info'] then return end

    local prefix = string.format('[^5%s^7] ', Config.ResourceName:upper())
    local formatted = string.format(message, ...)

    if level == 'error' then
        print(prefix .. '^1' .. formatted .. '^7')
    elseif level == 'warn' then
        print(prefix .. '^3' .. formatted .. '^7')
    elseif level == 'info' then
        print(prefix .. '^2' .. formatted .. '^7')
    else
        print(prefix .. formatted)
    end
end
qs-televisions/config.lua
Config = {}

-- Debug mode - Enable to see debug messages in console/F8
-- true = Shows debug messages, false = Hides debug messages
Config.Debug = false

-- Language/Locale Settings
-- Set the language for all notifications and UI text
-- Available languages: 'en' (English), 'es' (Spanish), 'fr' (French), 'de' (German), 'pt' (Portuguese), 'nl' (Dutch)
-- If you set a language that doesn't exist, it will fall back to English
Config.Locale = 'en'

-- List of available locale files (for reference)
Config.AvailableLocales = {'en', 'es', 'fr', 'de', 'pt', 'nl'}

-- Framework Detection
-- Set to 'auto' to automatically detect your framework, or manually set to: 'qbcore', 'qbox', 'esx', 'standalone'
-- 'auto' = Automatically detects QBCore, QBox, ESX, or runs standalone
Config.Framework = 'auto'

-- Inventory System Detection
-- Set to 'auto' to automatically detect your inventory, or manually set to: 'ox_inventory', 'qb-inventory', 'qs-inventory', 'lj-inventory', 'framework'
-- 'auto' = Automatically detects ox_inventory, qb-inventory, qs-inventory, lj-inventory, or uses framework inventory
Config.Inventory = 'auto'

-- TV Interaction Settings
-- Controls how players interact with TVs (drawtext only)
Config.Interaction = {
    -- Interaction type: 'drawtext' (uses basic 3D drawtext with key press)
    Type = 'drawtext',
    
    -- Distance players can interact with TVs from (in meters)
    -- Increase for easier interaction, decrease to require being closer
    Distance = 2.5,
    
    -- Key code to press for interaction
    -- Default: 38 (E key) - See FiveM key codes for other keys
    -- Common keys: 38 = E, 51 = G, 47 = G, 46 = E
    Key = 38,
    
    -- Icons for interaction menu items (Font Awesome icons)
    Icons = {
        TurnOn = 'fas fa-power-off',      -- Icon for "Turn TV On" option
        TurnOff = 'fas fa-power-off',     -- Icon for "Turn TV Off" option
        Interact = 'fas fa-hand-pointer', -- Icon for "Interact with TV" option
        Pickup = 'fas fa-box'             -- Icon for "Pick Up TV" option
    }
}

-- TV General Settings
-- Controls TV behavior and placement system
Config.TV = {
    -- Allow players to pick up TVs placed by other players
    -- true = Anyone can pick up any TV, false = Only owner/creator can pick up
    AllowPickupAny = false,
    
    -- Return TV item to player's inventory when they pick up a TV
    -- true = Returns item to inventory, false = TV is removed without returning item
    ReturnItemOnPickup = true,
    
    -- Maximum number of TVs a player can place (0 = unlimited)
    -- Set to a number to limit how many TVs each player can have (e.g., 5 = max 5 TVs per player)
    MaxPerPlayer = 0,
    
    -- Render distance for TV displays (in meters)
    -- TVs will only create and render displays when player is within this distance
    -- This allows different TVs of the same model to show different content
    -- Audio range will match this render distance
    DefaultRenderDistance = 7.0,
    
    -- TV Placement Mode Settings
    -- Controls the placement camera and movement when placing a new TV
    Placement = {
        -- Alpha/transparency of the TV preview during placement (0-255)
        -- Lower = more transparent, Higher = more solid
        -- Recommended: 200 (semi-transparent so you can see through it)
        PreviewAlpha = 200,
        
        -- Automatically snap TV to ground level when placing
        -- true = TV snaps to ground, false = TV can be placed at any height
        SnapToGround = false,
        
        -- Allow rotation of TV during placement
        -- true = Players can rotate TV (Q/E keys), false = No rotation allowed
        AllowRotation = true,
        
        -- Rotation speed/step when rotating TV (in degrees per key press)
        -- Higher = faster rotation, Lower = slower, more precise rotation
        RotationStep = 1.0,
        
        -- Height adjustment step when scrolling during placement (in meters)
        -- Higher = larger height increments, Lower = finer height control
        HeightStep = 0.05,
        
        -- Movement speed when moving TV during placement (WASD keys)
        -- Higher = faster movement, Lower = slower, more precise movement
        MoveSpeed = 0.02,
        
        -- Distance of camera from TV during placement (in meters)
        -- Higher = camera further away, Lower = camera closer
        CameraDistance = 4.0
    }
}

-- TV Models Configuration
-- Add or remove TV models that players can place
-- Each model needs a label (display name) and renderTarget (screen texture target)
-- To add a new TV model:
--   1. Find the GTA5 model name (e.g., 'prop_tv_flat_01')
--   2. Add it to this table with a label and renderTarget
--   3. Make sure the renderTarget matches the model's screen texture target
-- Common renderTargets: 'tvscreen', 'prop_ex_computer_screen', 'big_disp'
Config.TVModels = {
    ['ex_prop_monitor_01_ex'] = {
        label = 'Small Computer Monitor',           -- Display name in menus
        renderTarget = 'prop_ex_computer_screen'    -- Screen texture target for this model
    },
    ['prop_tv_flat_01'] = {
        label = 'Flat Screen TV',
        renderTarget = 'tvscreen'
    },
    ['prop_tv_flat_02'] = {
        label = 'Flat TV (Model 2)',
        renderTarget = 'tvscreen'
    },
    ['prop_tv_flat_03'] = {
        label = 'Flat TV Medium',
        renderTarget = 'tvscreen'
    },
    ['prop_tv_flat_03b'] = {
        label = 'Flat TV Medium B',
        renderTarget = 'tvscreen'
    },
    ['prop_trev_tv_01'] = {
        label = "Trevor's TV",
        renderTarget = 'tvscreen'
    }
}

-- Key Bindings for TV Placement Mode
-- Change these if you want different keys for placement controls
-- See FiveM key codes documentation for full list: https://docs.fivem.net/docs/game-references/controls/
-- Common keys: 191 = Enter, 194 = Backspace, 32 = W, 33 = S, 34 = A, 35 = D, 44 = Q, 38 = E, 200 = ESC, 241 = Scroll Up, 242 = Scroll Down
Config.Keys = {
    Confirm = 191,      -- Key to confirm TV placement (default: ENTER)
    Cancel = 194,       -- Key to cancel TV placement (default: BACKSPACE)
    RotateLeft = 44,    -- Key to rotate TV left (default: Q)
    RotateRight = 38,   -- Key to rotate TV right (default: E)
    MoveForward = 32,   -- Key to move TV forward (default: W)
    MoveBackward = 33,  -- Key to move TV backward (default: S)
    MoveLeft = 34,      -- Key to move TV left (default: A)
    MoveRight = 35,     -- Key to move TV right (default: D)
    ScrollUp = 241,     -- Mouse wheel up for height adjustment
    ScrollDown = 242,   -- Mouse wheel down for height adjustment
    Exit = 200          -- Key to exit TV interaction (default: ESC)
}

-- Command for TV system (legacy/fallback command)
-- Players can type this command to access TV controls (if enabled)
Config.Command = "television"

-- Resource name (automatically set, don't change this)
Config.ResourceName = GetCurrentResourceName()

-- Default Television Settings
-- These settings apply to TVs when using the /television command or export system
-- NOTE: For item-based TVs, use Config.TVModels above instead
Config.Television = {
    -- Default TV model hash (used for /television command system)
    -- Change this if you want a different default TV model
    Model = `prop_huge_display_01`,
    
    -- Render target for the TV screen (texture target name)
    -- Must match the model's screen texture target
    RenderTarget = "big_disp",
    
    -- Default volume level (0.0 to 1.0)
    -- 0.0 = Muted, 0.5 = 50% volume, 1.0 = 100% volume
    DefaultVolume = 0.5,
    
    -- Audio range in meters - how far players can hear the TV audio
    -- Audio fades out as players move away from the TV
    -- Higher = audio can be heard from further away
    Range = 50.0,
    
    -- Scale of the TV screen texture (1.0 = normal size)
    -- Adjust if screen appears too large/small on the model
    Scale = 1.0,
    
    -- Offset position for the screen texture (in meters)
    -- Adjust if screen appears misaligned on the TV model
    -- vector3(x, y, z) - Positive X = right, Positive Y = forward, Positive Z = up
    Offset = vector3(0.0, 0.0, 0.0),
}

return Config