Configuratie
Configuratie
Alles wordt geconfigureerd in config.lua. Deze pagina behandelt elke optie.
Algemeen
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.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.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 viaIsPlayerAceAllowedvia een ox_lib callback (meest veilig). Geef toegang metadd_ace ... animpos.use allow.job— de framework-jobnaam van de speler moet in deJobs-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.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.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)
endox_lib—lib.notify(standaard).qbcore—QBCore:Notifyevent.esx—esx:showNotificationevent.custom— je eigen handler inConfig.CustomNotify.
Een ongeldige Config.Notify-waarde logt een waarschuwing in de serverconsole en schakelt veilig terug naar ox_lib.
UI
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.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.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.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.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
endBesturing
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.