Agency Docs
Standalone

Agency-Seatbelt V2 Konfiguration

Standalone-Sicherheitsgurt, der sich in selbstfahrenden Autos automatisch anlegt, nicht angeschnallte Fahrer beim.

v2.2.0Bezahlt4 Seiten

01Konfiguration

Schnellinstallation · config.lua · Agency-Seatbelt V2

config.lua herunterladen

--[[ ╔══════════════════════════════════════════════════════════════════════╗ ║ AGENCY SEATBELT - CONFIGURATION ║ ║ (c) Agency Scripts ║ ╚══════════════════════════════════════════════════════════════════════╝ CONTENTS 1. Agency Companion The free app for your players, accent colour 2. Core Language, framework, debug 3. Integrations Agency-Notify, Agency-Hud, state bag 4. Key and command Belt key, chat command, hold to get out 5. Where it applies Excluded classes and models, passengers 6. Automatic belt Agency Zero and any self-driving car 7. Player settings The small menu on /aseatbelt 8. Reminder When and how players are reminded 9. Crash and ejection What happens without a belt 10. Sound Buckle clips and warning tones 11. Interface Card position, status chip 12. Own texts Your own wording, survives updates Everything a server owner is meant to change lives in this file. Texts live in locales/, Config.Text at the bottom overrides any of them. Discord: https://discord.gg/RTax3aBMUs · Shop: https://shop.agencyg.de ]] Config = {} --============================================================================== -- 1 · AGENCY COMPANION --============================================================================== -- Agency-Companion (free): https://shop.agencyg.de/en/product/agency-companion -- One resource for every Agency script: your players link them with the free -- Agency Companion app (iPhone, Android, web), and your admins pick one accent -- colour for all Agency scripts in game (/app, admin page). Drop it into your -- resources and Agency Seatbelt follows it by itself. Nothing else to set up. Config.Companion = { Enabled = true, -- follow Agency-Companion (accent colour) } -- ── Accent colour ──────────────────────────────────────────────────────────── -- false = the colour from Agency-Companion, gold without it -- { r,g,b } = a fixed colour for this script only, e.g. { 0, 190, 255 } -- Every border, glow and keycap of the reminder, the chip and the menu follows it. -- (The old Config.UI.accent = 'r, g, b' still works and counts as a fixed colour.) Config.AccentColor = false --============================================================================== -- 2 · CORE --============================================================================== -- ── Language ───────────────────────────────────────────────────────────────── -- en bg cs da de el es fi fr hr hu it ja ko nb nl pl pt ro ru sk sv tr uk zh -- (also ar Arabic and hi Hindi; 'no' works as Norwegian too) -- English is the base and the fallback: a key missing in another language is -- shown in English, never as its raw key name. Right-to-left (ar) is handled -- by the interface on its own. Config.Locale = 'en' -- ── Framework ──────────────────────────────────────────────────────────────── -- 'auto' finds QBCore, QBox or ESX on its own and falls back to standalone when -- there is none. The framework is only used for notifications and for the -- /seatbelt permission check. 'qbcore' | 'esx' | 'standalone' to force one. Config.Framework = 'auto' -- ── Debug ──────────────────────────────────────────────────────────────────── -- Console output about detection, state changes and crash maths. Server console -- always, and the player's F8 only while this is on. Config.Debug = false --============================================================================== -- 3 · INTEGRATIONS --============================================================================== -- ── Notifications ──────────────────────────────────────────────────────────── -- Agency-Notify (free): https://shop.agencyg.de/en/product/notify -- true = Agency-Notify when it runs, otherwise your framework's notification, -- and the game's ticker on standalone servers -- false = never Agency-Notify Config.UseAgencyNotify = true Config.NotifyTitle = 'Seatbelt' -- title on notifications from this resource -- ── Progress bar ───────────────────────────────────────────────────────────── -- Agency-Progressbar (free): https://shop.agencyg.de/en/product/progressbar -- Not needed here: buckling is one key press and has no waiting time. -- ── Agency-Hud and other resources ─────────────────────────────────────────── Config.Integration = { -- Agency-Hud reads the belt state and shows it in the vehicle panel. It -- polls the export on its own; this only fires the extra event that makes -- the change instant instead of up to 200 ms late. agencyHud = true, -- The state is published as a replicated state bag, so other resources can -- read any player's belt without an event: -- Player(serverId).state.seatbelt -- client and server -- Turning it off keeps the exports working and stops the replication. stateBag = true, } --============================================================================== -- 4 · KEY AND COMMAND --============================================================================== -- The default key. It is registered through RegisterKeyMapping, so every player -- can rebind it in the game's own Settings ▸ Key Bindings ▸ FiveM screen without -- touching this file. Use the FiveM names: 'K', 'F5', 'MOUSE2', 'NUMPAD5'… Config.Key = 'K' -- Chat command that does the same thing. Set to false to register none. Config.Command = 'seatbelt' -- Getting out is blocked while buckled. Instead of the key silently doing -- nothing, the first press explains why, and holding it this long unbuckles and -- lets the player out in one motion. Set to 0 to require a separate unbuckle. Config.HoldExitMs = 900 --============================================================================== -- 5 · WHERE THE BELT APPLIES --============================================================================== -- Vehicle classes that have no belts. 8 motorcycles, 13 cycles, 14 boats, -- 15 helicopters, 16 planes, 21 trains. -- Full list: docs.fivem.net/natives/?_0x29439776AAA00A62 Config.ExcludedClasses = { 8, 13, 14, 15, 16, 21 } -- Individual models that are excluded on top of the classes above. Config.ExcludedModels = {} -- Passengers get a belt of their own. With this off only the driver's seat (-1) -- can buckle, and passengers are never reminded. Config.PassengersCanBuckle = true -- Buckling is remembered while the player stays in the same vehicle. Changing -- seat keeps the belt; changing vehicle always starts unbuckled. Config.KeepBeltOnSeatChange = true --============================================================================== -- 6 · AUTOMATIC BELT (Agency Zero and any self-driving car) --============================================================================== -- A car that drives itself fastens the belt itself. This is what the Agency Zero -- does the moment somebody sits down in it, and it is why the option exists: -- but it is written for any vehicle, so a server can hand it to a taxi, a bus or -- a mission car without touching a line of code. Config.AutoBuckle = { enabled = true, -- ── Which cars fasten the belt by themselves ────────────────────────── -- -- Every vehicle on the server, not just the ones listed below. One line -- for a server that wants belts to be automatic everywhere and the key to -- stay for taking it off again. The excluded classes still apply, so no -- motorbike grows a seatbelt. allVehicles = false, -- The list. Spawn names as they are in the vehicle's meta, lower case, -- exactly what you would type after /car. This is the setting to edit: -- -- models = { 'zero', 'taxi', 'bus', 'mycar' }, -- -- 'zero' is Agency Zero (Project 0), from the Agency-Zero resource: it -- drives itself, so it fastens the belt itself. Ignored while -- allVehicles is on, because then every car is on the list. models = { 'zero' }, -- Any vehicle currently driving autonomously buckles too, recognised by the -- state bag its own script sets. Agency-Zero sets `agAuto` while the -- autopilot has the wheel; leave the name as it is unless another resource -- of yours uses a different one. Set `statebag` to false to switch this off -- and go by the model list alone. statebag = 'agAuto', -- Milliseconds between sitting down and the belt closing. Short enough to -- feel automatic, long enough that the click is heard as its own moment -- rather than on top of the door. delay = 1100, -- One press of the exit key opens an automatic belt and gets the player -- out in the same motion: no unbuckling first, no holding. It was not -- their decision to put the belt on, so it should not be their work to -- take it off. Only applies to belts the car fastened; a belt the player -- fastened themselves still follows Config.HoldExitMs. exitReleases = true, -- A player who unbuckles by hand inside such a car is not buckled again for -- as long as they stay in it. Turning this off makes the car overrule them -- on the next check, which is the correct behaviour for a prison transport -- and the wrong one for everything else. respectManualRelease = true, -- Show the small "automatic" note when it happens. notify = true, -- Deliberately not a player setting and not in the menu: this is what the -- car does, the same way its doors open on their own. A player who does not -- want it takes the belt off, and it stays off until they leave that car. } --============================================================================== -- 7 · THE PLAYER'S OWN SETTINGS --============================================================================== -- A small menu on /aseatbelt where a player sets the things that are only about -- them: whether they want to be reminded, whether it makes noise, and where the -- card sits. Their choice is kept on their own machine and survives a -- reconnect. -- -- Everything else stays here in the config, because it is the server's decision -- and not the player's. The automatic belt in particular is not in the menu: -- that is what the car does, not a preference. -- -- The values set further down in this file are the starting point for every -- player who has not changed anything. Config.Menu = { enabled = true, command = 'aseatbelt', -- Which rows a player may change. A row set to false is not shown at all -- rather than shown greyed out: a setting nobody can move is not -- information, it is clutter. With every row off, the menu does not open. allow = { reminder = true, -- be reminded when driving unbelted sound = true, -- make any noise at all volume = true, -- how loud position = true, -- where the card sits on screen chip = true, -- the short confirmation after buckling }, } --============================================================================== -- 8 · REMINDER --============================================================================== Config.Reminder = { enabled = true, -- Below this speed nobody is reminded of anything (km/h). speed = 25, -- Milliseconds between two reminders. interval = 5000, -- Seconds the card stays on screen. duration = 4.0, -- After this many ignored reminders the card turns red and the beep gets -- sharper. 0 keeps it calm forever. escalateAfter = 3, -- Above this speed it starts red straight away (km/h). escalateSpeed = 110, sound = true, showSpeed = true, -- Passengers are reminded as well. Only has an effect with -- Config.PassengersCanBuckle on. passengers = false, } --============================================================================== -- 9 · CRASH AND EJECTION --============================================================================== Config.Ejection = { enabled = true, -- Minimum speed at the moment of impact (km/h). speed = 65.0, -- How much speed has to be lost in one 50 ms step for it to count as a -- crash (km/h). Full braking loses about 2, a wall takes 30 and up. This is -- the number that decides whether hard braking throws people through the -- windshield, so it is deliberately far above anything brakes can do. deceleration = 22.0, -- On top of the speed drop the vehicle must actually have hit something. -- Leave this on: it is what separates a crash from a rally handbrake turn. requireCollision = true, -- How hard the ped is thrown. 1.0 is already violent. force = 1.0, -- Health taken on landing, plus or minus `damageVariance`. damage = 45, damageVariance = 15, -- Milliseconds of ragdoll after the throw. ragdollMs = 5000, -- The windshield breaks where the ped went through it. smashWindshield = true, -- Red flash, shake and the crash card. screenEffect = true, -- Unbelted NPCs riding along are thrown as well, when this client owns them. ejectNpcs = true, } --============================================================================== -- 10 · SOUND --============================================================================== -- Each of the five events below takes one of two forms, and the form decides -- where the sound comes from: -- -- 'name.mp3' a file in html/sfx, played by the interface -- { name = ..., set = ... } a sound the game already has -- false silent -- -- The belt itself uses files, because no sound in the game is a seatbelt and -- the ones that come close are phone and menu clicks. The warnings stay with -- the game's own tones: those are HUD beeps rather than objects, and they -- belong next to the rest of the interface. Config.Sound = { enabled = true, -- Applies to both forms below. The clips themselves are normalised to -- almost full scale, so this is the only thing setting how loud the belt is -- next to the engine. volume = 0.35, -- Five real buckle recordings ship in html/sfx. Which one you use is -- taste, so they are all included: -- -- buckle.mp3 dry and close, one clean snap (shipped) -- buckle-2.mp3 the same kind of snap, a touch softer -- buckle-3.mp3 brighter, with the housing rattling after it -- unbuckle-2.mp3 a short, flat release (shipped) -- unbuckle.mp3 a longer release: button, then the tongue coming out -- buckle = 'buckle.mp3', unbuckle = 'unbuckle-2.mp3', -- The car fastening the belt is the same physical event as a player doing -- it, so it is the same sound. Put a different file or a game sound here if -- you want the automatic belt to announce itself. auto = 'buckle.mp3', reminder = { name = 'Beep_Red', set = 'DLC_HEIST_HACKING_SNAKE_SOUNDS' }, warning = { name = '5_SEC_WARNING', set = 'HUD_MINI_GAME_SOUNDSET' }, -- Only applies to the { name = , set = } form: the sound comes from the -- player's own position rather than flat in the ear, so a passenger hears -- the driver. A file played by the interface is always heard by that one -- player: which is the trade for having a belt that sounds like a belt. positional = true, } --============================================================================== -- 11 · INTERFACE --============================================================================== Config.UI = { -- Where the reminder sits: 'bottom', 'bottom-left', 'bottom-right', 'top'. position = 'bottom', -- not used any more (automatic): the interface fits the resolution by itself scale = 1.0, -- The small chip that says "belt on" / "belt off" for a moment after every -- change. Off if your HUD already shows the belt (Agency-Hud does). statusChip = true, statusChipMs = 1800, -- Send a notification on every buckle and unbuckle. The chip above already -- says it, so this is off by default: two messages for one key press is -- exactly the kind of noise that makes people uninstall a script. notifyOnToggle = false, -- The accent colour is set in section 1 (Config.AccentColor), notifications -- in section 3 (Config.UseAgencyNotify). The old keys accent and -- useAgencyNotify are still read when you put them here. } --============================================================================== -- 12 · OWN TEXTS (optional) --============================================================================== -- Anything set here wins over locales/ for every language and survives updating -- the resource. Keys are the ones in locales/en.lua. -- -- Config.Text = { -- buckled = 'Belt on', -- unbuckled = 'Belt off', -- } Config.Text = {}

Kommst du nach dieser Seite nicht weiter? Dann übernimmt unser Support.