Skip to content

Configuratie

Configuratie

Alles wordt geconfigureerd in config.lua. Deze pagina behandelt elke optie.

Algemeen

config.lua
Config.Framework = 'qbox'    -- qbox / qbcore / esx / standalone
Config.Command   = 'animpos' -- chat command name
Config.Cooldown  = 15        -- cooldown between uses (seconds)
  • Framework — selecteert de core resource en welke metadatabeperkingen van toepassing zijn.
  • Command — het chatcommando dat de tool opent (wordt tevens gebruikt als de keymapping-naam).
  • Cooldown — minimum aantal seconden tussen gebruik.

Sneltoets

Hiermee kunnen spelers de tool openen met een toets, opnieuw instelbaar in de GTA V-instellingen.

config.lua
Config.Keybind = {
    Enabled = true,
    Default = 'F6',  -- default key (empty for none; player can rebind)
}

De keymapping wordt alleen geregistreerd wanneer Enabled = true en Default niet leeg is. Spelers kunnen deze altijd opnieuw instellen via Instellingen → Toetsenbindingen → FiveM.

Toestemming (optioneel)

Beperk wie de tool kan gebruiken. Standaard uitgeschakeld.

config.lua
Config.Permission = {
    Enabled = false,
    Type    = 'ace',                     -- 'ace' / 'job'
    Ace     = 'animpos.use',             -- used when Type == 'ace'
    Jobs    = { 'police', 'ambulance' }, -- used when Type == 'job'
}
  • ace — wordt aan de serverkant gecontroleerd via IsPlayerAceAllowed via een ox_lib callback (meest veilig). Geef toegang met add_ace ... animpos.use allow.
  • job — de framework-jobnaam van de speler moet in de Jobs-lijst staan (QBox / QB-Core / ESX).

Beperkingen

Blokkeer gebruik terwijl de speler in bepaalde statussen verkeert. Native checks werken op elk framework; metadatachecks zijn alleen van toepassing op QBox en QB-Core.

config.lua
Config.Restrictions = {
    -- Framework based (qbox / qbcore only)
    CheckDead        = true,   -- block while dead
    CheckLastStand   = true,   -- block while in last stand
    CheckHandcuffed  = true,   -- block while handcuffed

    -- Native based (works on ALL frameworks incl. standalone)
    CheckInVehicle   = true,   -- block while inside a vehicle
    CheckFalling     = true,   -- block while falling / parachuting
    CheckSwimming    = false,  -- block while swimming

    -- Metadata field names read from the player data
    MetaKeys = {
        Dead       = 'isdead',
        LastStand  = 'inlaststand',
        Handcuffed = 'ishandcuffed',
    },
}

MetaKeys koppelen aan de metadata-veldonnamen in de spelerdata van je framework. Als jouw core (of een aangepast pakket) deze onder andere sleutels opslaat, pas ze dan hier aan zodat de checks voor dood / last stand / geboeid de juiste waarden uitlezen.

Notificaties

Kies de backend die wordt gebruikt voor elk bericht.

config.lua
Config.Notify = 'ox_lib'  -- 'ox_lib' / 'qbcore' / 'esx' / 'custom'

-- Only used when Config.Notify == 'custom'.
-- ntype is one of: 'success' / 'error' / 'primary' / 'inform'
Config.CustomNotify = function(message, ntype)
    -- exports['my-notify']:SendAlert(message, ntype)
end
  • ox_liblib.notify (standaard).
  • qbcoreQBCore:Notify event.
  • esxesx:showNotification event.
  • custom — je eigen handler in Config.CustomNotify.

Een ongeldige Config.Notify-waarde logt een waarschuwing in de serverconsole en schakelt veilig terug naar ox_lib.

UI

config.lua
Config.UI = {
    Position = 'right',       -- left / right / center
    OffsetX  = 30,            -- distance from the edge (px)
    OffsetY  = 0,             -- vertical offset (px)
    AccentColor = '#f4cb98',  -- accent colour for key highlights / glow
    ShowHeader = true,        -- show the title/subtitle header
    ShowTip    = true,        -- show the bottom tip line
    ShowAnimations = true,    -- key press animations
    AnimationType = {
        Movement = 'pulse',   -- pulse / glow
        Action   = 'glow',    -- pulse / glow
    }
}

Beweging

config.lua
Config.Movement = {
    Speed         = 0.01,  -- movement speed
    RotationSpeed = 0.5,   -- rotation speed
    MaxDistance   = 5.0,   -- max distance from start (m)
    MaxHeight     = 3.5,   -- max height above start (m)
    MinHeight     = -3.5,  -- min height below start (m)
    PrecisionMultiplier = 0.25, -- speed multiplier while holding Precision
}

Prestaties

config.lua
Config.Performance = {
    NetworkUpdateDelay = 50,   -- network sync delay (ms)
    LoopWait           = 0,    -- main loop wait (ms)
    AnimationDuration  = 300,  -- UI animation duration (ms)
    SyncCooldown       = 50,   -- server-side anti-spam sync cooldown (ms)
}

AnimationDuration wordt naar de UI doorgegeven als de overgangstijd voor het paneel. De synchronisatie-gerelateerde waarden bepalen hoe vaak positie-updates worden verzonden en geaccepteerd.

Geluiden

Optionele GTA V frontend-geluiden voor openen / bevestigen / annuleren / resetten.

config.lua
Config.Sounds = {
    Enabled = true,
    Open    = { name = 'SELECT',        set = 'HUD_FRONTEND_DEFAULT_SOUNDSET' },
    Confirm = { name = 'SELECT',        set = 'HUD_FRONTEND_DEFAULT_SOUNDSET' },
    Cancel  = { name = 'CANCEL',        set = 'HUD_FRONTEND_DEFAULT_SOUNDSET' },
    Reset   = { name = 'RESET_PROMPTS', set = 'HUD_FRONTEND_DEFAULT_SOUNDSET' },
}

Zet Enabled = false om alle geluiden te dempen.

CanUse hook

Een aangepaste check die elke keer wordt uitgevoerd wanneer een speler probeert de tool te openen. Retourneer true om toe te staan, of false (optioneel met een berichttekenreeks) om te blokkeren.

config.lua
Config.CanUse = function()
    -- Example: block while taking damage
    -- local ped = PlayerPedId()
    -- if HasEntityBeenDamagedByAnyPed(ped) then
    --     return false, 'You cannot do this while taking damage!'
    -- end
    return true
end

Besturing

De scancodes van de besturingstoetsen zijn ook volledig te configureren onder Config.Controls (vooruit, achteruit, omhoog, omlaag, links, rechts, draaien, bevestigen, annuleren + twee alternatieven, reset en precisie). Bekijk de Gebruik & Besturing pagina voor de standaardindeling.