For the complete documentation index, see llms.txt. This page is also available as Markdown.

Exports & Events

Madonne Seatbelt exposes two client-side exports for integration with other resources, allowing you to read or control the seatbelt state programmatically.


πŸ“€ GetSeatbeltStatus

Returns the current seatbelt status of the local player.

local isBuckled = exports['MS_Madonne_Seatbelt']:GetSeatbeltStatus()
-- Returns: true (buckled) or false (unbuckled)

Example use case

-- Prevent a player from exiting a vehicle if unbuckled
if not exports['MS_Madonne_Seatbelt']:GetSeatbeltStatus() then
    TriggerEvent('chat:addMessage', { args = { "You must fasten your seatbelt before exiting!" } })
end

πŸ“₯ SetSeatbeltStatus

Forces the seatbelt state of the local player to a specific value.

exports['MS_Madonne_Seatbelt']:SetSeatbeltStatus(status)
Parameter
Type
Description

status

boolean

true to force buckle, false to force unbuckle

Example use case

⚠️ SetSeatbeltStatus only updates the internal state. It does not trigger the buckle/unbuckle sounds, notifications, or custom hooks. If you need those, trigger the seatbelt toggle manually through player input or use FastenedSeatbelt() / UnfastenedSeatbelt() in custom/main.lua.


πŸͺ Custom Hook Functions

Two functions in custom/main.lua are called automatically by the resource when the player toggles their seatbelt. You can add any logic inside them:


πŸ“‘ Custom Notification Events

When NotificationsType is set to "custom", the following client-side events are triggered:

These are already set up in custom/notifs.lua for you to fill in.

Last updated