Standalone
Agency-Seatbelt V2 الإعدادات
حزام أمان مستقل لـ FiveM، أُعيد بناؤه بالكامل للإصدار 2.0.0.
v2.0.0مدفوع4 صفحات

01الإعدادات
تثبيت سريع · config.lua · Agency-Seatbelt V2
-- ╔══════════════════════════════════════════════════════════════╗
-- ║ A G E N C Y S E A T B E L T · 2.0 ║
-- ╠══════════════════════════════════════════════════════════════╣
-- ║ Everything a server owner is meant to change lives in this ║
-- ║ file. Nothing here is read anywhere else than where the ║
-- ║ comment says, and every single option below is actually ║
-- ║ used — the 1.x config carried thirty settings that did ║
-- ║ nothing, which is worse than having no setting at all. ║
-- ║ ║
-- ║ Texts do NOT belong here. They live in locales/, and ║
-- ║ Config.Text further down overrides any of them. ║
-- ╚══════════════════════════════════════════════════════════════╝
Config = {}
-- =====================================================
-- 1. GENERAL
-- =====================================================
-- Interface language. 25 ship with the resource:
--
-- ar Arabic bg Bulgarian cs Czech da Danish de German
-- el Greek en English es Spanish fi Finnish fr French
-- hi Hindi hr Croatian hu Hungarian it Italian ja Japanese
-- ko Korean nl Dutch pl Polish pt Portuguese ro Romanian
-- ru Russian sv Swedish tr Turkish uk Ukrainian zh Chinese
--
-- 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'
-- 'auto' finds QBCore, QBox or ESX on its own and falls back to standalone when
-- there is none. The script needs no framework to work — the framework is only
-- used for notifications and for the /seatbelt permission check. Force a
-- specific one with 'qbcore', 'esx', or turn detection off with 'standalone'.
Config.Framework = 'auto'
-- 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
-- Title on notifications sent by this resource.
Config.NotifyTitle = 'Seatbelt'
-- =====================================================
-- 2. 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
-- =====================================================
-- 3. 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
-- =====================================================
-- 4. 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.
}
-- =====================================================
-- 5. 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
},
}
-- =====================================================
-- 6. 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,
}
-- =====================================================
-- 7. 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,
}
-- =====================================================
-- 8. 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,
}
-- =====================================================
-- 9. INTERFACE
-- =====================================================
Config.UI = {
-- Accent colour, as three channels. Every border, glow and keycap in the
-- interface is built from these, so one line here re-colours all of it.
-- Agency gold: 226, 182, 73. Cyan would be 0, 212, 255.
accent = '226, 182, 73',
-- Where the reminder sits: 'bottom', 'bottom-left', 'bottom-right', 'top'.
position = 'bottom',
-- Whole interface scale. 1.0 is designed for 1080p and up.
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,
-- Notifications through Agency-Notify when it is running. With this off the
-- framework's own notification is used, and standalone servers fall back to
-- the game's ticker.
useAgencyNotify = true,
-- 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,
}
-- =====================================================
-- 10. 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,
}
-- =====================================================
-- 11. 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 = {}