Agency Docs

Dev Partners

Integrating with Agency scripts

Building your own FiveM script and want it to talk to ours? Every public export and event is listed here, with a copy-and-paste Lua snippet for each one.

Exports let your script call a function inside ours: exports['script-name']:FunctionName(args), on the client and on the server alike. Events go the other way: you fire them with TriggerEvent or TriggerServerEvent and listen with RegisterNetEvent.

01Agency-Phone

Full multi-framework phone with SMS, calls, social feed, mail, camera, wallet and AgencyPay checkout.

Use inside any shop/robbery/job script where you want a clean in-phone payment flow instead of instantly deducting money. Also ideal for in-game notifications with accept/deny flows (e.g. taxi ride requests, dispatch calls).

Full documentation

Client exports

IsPhoneOpen()

Returns true if the phone UI is currently open.

Show example

Skips opening a custom menu while the phone UI is already on screen.

RegisterCommand('openmymenu', function() if exports['agency-phone']:IsPhoneOpen() then return end TriggerEvent('myresource:openMenu') end)
IsPhonePoweredOn()

Returns true if the phone is powered on.

Show example

Pauses background sync work while the phone is powered down by the player.

CreateThread(function() while true do Wait(2000) if not exports['agency-phone']:IsPhonePoweredOn() then print('Phone off, pausing background sync') end end end)
GetPhoneData()

Returns the raw phone data table.

Show example

Dumps the full client phone data table for debugging.

RegisterCommand('phonedebug', function() local data = exports['agency-phone']:GetPhoneData() print(json.encode(data, { indent = true })) end)
GetPhonePropEntity()

Returns the entity handle of the held phone prop, or 0 if not visible.

Show example

Hides the phone prop entity briefly without affecting the underlying logic.

CreateThread(function() Wait(500) local prop = exports['agency-phone']:GetPhonePropEntity() if prop ~= 0 and DoesEntityExist(prop) then SetEntityVisible(prop, false, false) end end)
IsPhoneExpanded()

Returns true if the phone is expanded on screen.

Show example

Legacy alias used to gate a minigame while the phone is open.

AddEventHandler('myresource:beforeMinigame', function() if exports['agency-phone']:IsPhoneExpanded() then TriggerEvent('chat:addMessage', { args = { 'Close phone first' } }) return end end)
HasCarrierContract()

Returns true when the player has an active carrier data plan.

Show example

Warns the player when no carrier data plan is currently active.

RegisterCommand('checkdata', function() if not exports['agency-phone']:HasCarrierContract() then TriggerEvent('chat:addMessage', { args = { 'No data plan, buy one in the store app' } }) end end)
GetPhoneState()

Returns the complete phone state object.

Show example

Caches phone state on the server only when the phone is open, on, and syncing.

AddEventHandler('myresource:saveProfile', function() local state = exports['agency-phone']:GetPhoneState() if state.isOpen and state.poweredOn and state.syncEnabled then TriggerServerEvent('myresource:server:cachePhoneState', state) end end)
HasPhone()

Returns true if the player has a phone item.

Show example

Blocks an emergency-call command unless the player carries the phone item.

RegisterCommand('callemergency', function() if not exports['agency-phone']:HasPhone() then TriggerEvent('chat:addMessage', { args = { 'You need a phone first' } }) return end TriggerEvent('myresource:client:openEmergency') end)
RegisterAgencyPayPoint(id, data)

Registers a recurring AgencyPay merchant terminal.

Show example

Spawns a runtime Agency Pay terminal for a mechanic shop checkout.

CreateThread(function() exports['agency-phone']:RegisterAgencyPayPoint('mechanic_main', { coords = vector3(-211.74, -1314.59, 31.29), label = 'Mechanic Pay Point', amount = 250, receiver = 'mechanic' }) end)
RemoveAgencyPayPoint(id)

Removes a previously registered AgencyPay terminal.

Show example

Removes the registered pay point when a shop closes for the night.

AddEventHandler('myresource:onShopClosed', function(shopId) exports['agency-phone']:RemoveAgencyPayPoint('mechanic_main') print('Removed pay point for shop ' .. shopId) end)
StartAgencyPayCheckout(data)

Opens the AgencyPay checkout sheet for secure card payment.

Show example

Opens the phone and starts a small Agency Pay tip checkout.

RegisterCommand('paytip', function() exports['agency-phone']:StartAgencyPayCheckout({ amount = 25, receiver = 'staff_tip_jar', label = 'Staff tip', memo = 'Thanks for great service' }) end)
StartCall(contactData)

Starts a pma-voice call using a contact table.

Show example

Starts an outgoing phone call to a dispatched contact when an event arrives.

RegisterNetEvent('myresource:client:incomingDispatch', function(payload) exports['agency-phone']:StartCall({ name = payload.callerName or 'Dispatch', number = payload.callerNumber or '911', anonymous = false }) end)
PhoneNotification(title, text, icon, color, timeout, acceptIcon, denyIcon)

Shows a phone notification with optional accept/deny buttons.

Show example

Shows a blocking accept/deny phone notification for a tow contract.

CreateThread(function() local accepted = exports['agency-phone']:PhoneNotification( 'Tow request', 'Accept the contract?', 'truck', '#FF8800', 15000, 'check', 'x' ) if accepted then TriggerServerEvent('myresource:server:acceptTow') end end)
RegisterApp(config)

Puts an app from your own resource on the phone home screen and in the Store. Returns true, or false and an error. See Custom Apps.

UnregisterApp(id)

Removes an app added with RegisterApp. Happens on its own when the resource that registered it stops.

GetRegisteredApps()

Returns the table of all apps registered by other resources, keyed by id.

ClosePhone()

Closes the phone, for example before your own interface opens.

IsPhoneRadioActive()

Returns two values: true while the phone radio is playing, and the station that is playing.

StopPhoneRadio()

Stops the phone radio.

Server exports

SendMail(identifier, mailData)

Sends mail to a player (online or offline).

Show example

Sends an order receipt mail to a player by their primary identifier.

RegisterNetEvent('myresource:server:sendReceipt', function(targetId) local identifier = GetPlayerIdentifier(targetId, 0) exports['agency-phone']:SendMail(identifier, { sender = '[email protected]', subject = 'Your receipt', body = 'Thanks for your purchase!' }) end)
AddChirp(chirpData)

Posts a message to the Pulse (chirper) feed.

Show example

Posts a bounty announcement to Chirper from a server-side event.

RegisterNetEvent('myresource:server:postBounty', function(targetName) local src = source exports['agency-phone']:AddChirp({ identifier = GetPlayerIdentifier(src, 0), firstName = 'Bounty', lastName = 'Office', message = 'Wanted: ' .. targetName, postId = ('bounty_%s'):format(GetGameTimer()) }) end)
usePhone(event, item, inventory, slot, data)

ox_inventory hook registered when ESX+ox_inventory is detected; opens the phone for the inventory holder.

Show example

Hooks ox_inventory's usingItem event to open the phone via the integration helper.

exports.ox_inventory:registerHook('usingItem', function(payload) if payload.item.name ~= 'phone' then return end return exports['agency-phone']:usePhone('inventory', payload.item, payload.inventory, payload.slot) end, { itemFilter = { phone = true } })
VerifyAgencyPayCharge(source, requestId, minAmount)

Confirms on the server that this player paid the Agency Pay checkout with this id in the last 60 seconds, for at least minAmount, and uses the charge up so it counts only once. requestId is the id you passed to StartAgencyPayCheckout. Returns true and the amount, or false. Call it before handing out goods.

Events

agency-phone:client:notify

Shows a phone notification (title, text, icon, color, timeout, silent).

Show example

Fires a non-blocking phone toast that the player's vehicle is ready.

TriggerEvent('agency-phone:client:notify', 'Heads up', 'Vehicle ready for pickup', 'car', '#22cc88', 5000, false)
agency-phone:client:usePhoneItem

Triggers the phone open flow when the phone inventory item is used.

Show example

Forwards a custom inventory item-use event to the phone open flow.

AddEventHandler('myresource:client:onItemUsed', function(itemName) if itemName == 'phone' then TriggerEvent('agency-phone:client:usePhoneItem') end end)
agency-phone:client:openApp

Asks the phone to navigate to a custom app by id (used by app modules).

Show example

Jumps the phone straight to a custom banking app by app id.

RegisterCommand('openbank', function() TriggerEvent('agency-phone:client:openApp', 'banking') end)
agency-phone:client:newMailNotify

Notifies the client of a freshly received mail.

Show example

Listens for new mail notifications and logs them for debugging.

AddEventHandler('agency-phone:client:newMailNotify', function(mail) print(('New mail from %s: %s'):format(mail.sender, mail.subject)) end)
agency-phone:server:requestPhoneData

Requests a fresh phone data sync for the calling player.

Show example

Asks the server to push a fresh copy of the phone data sync.

RegisterCommand('refreshphone', function() TriggerServerEvent('agency-phone:server:requestPhoneData') end)
agency-phone:server:cancelCall

Cancels or ends an active call.

Show example

Hangs up an active call from a custom keybind or chat command.

RegisterCommand('hangup', function() TriggerServerEvent('agency-phone:server:cancelCall') end)
agency-phone:server:sendMessage

Sends an SMS message (newMsg, targetNumber).

Show example

Quickly sends an SMS to a target phone number from chat input.

RegisterCommand('quicksms', function(_, args) local target, msg = args[1], table.concat(args, ' ', 2) TriggerServerEvent('agency-phone:server:sendMessage', { message = msg }, target) end)
agency-phone:server:saveSetting

Persists a single phone setting key/value for the player.

Show example

Persists a single phone setting whenever the user toggles it client-side.

AddEventHandler('myresource:client:onSettingChanged', function(key, value) TriggerServerEvent('agency-phone:server:saveSetting', key, value) end)
agency-phone:server:airdropPay

Performs an Agency Airdrop pay-to-nearby-player transfer.

Show example

Triggers an Agency Airdrop pay-to-nearby transfer with the typed amount.

RegisterCommand('airdrop', function(_, args) local amount = tonumber(args[1]) or 0 TriggerServerEvent('agency-phone:server:airdropPay', amount, 'Tip via airdrop') end)
agency-phone:server:buyDataPlan

Buys a carrier data plan for the player (price, planName).

Show example

Buys a chosen carrier data plan after the player picks one in a custom UI.

AddEventHandler('myresource:client:onPlanSelected', function(plan) TriggerServerEvent('agency-phone:server:buyDataPlan', plan.price, plan.name) end)
agency-phone:dispatch:create

Creates a phone dispatch from an emergency call/SMS.

Show example

Generates a phone dispatch entry from an incoming emergency call.

RegisterNetEvent('myresource:server:dispatchFromCall', function(payload) TriggerEvent('agency-phone:dispatch:create', { source = source, coords = payload.coords, type = 'robbery', title = '24/7 Robbery' }) end)

02Agency-Pad

AgencyOS tablet with a full app ecosystem. Register your own apps via config.lua.

Perfect for admin dashboards, business management apps, gang territory maps, or any custom UI your players need inside GTA, it lives inside a beautiful tablet shell with no extra work.

Full documentation

Client exports

IsPadOpen()

Returns true if the tablet UI is open (check tablet state before showing UIs).

Show example

Avoids re-opening custom tablet UI if the in-game tablet is already up.

RegisterCommand('opentablet', function() if exports['agency-pad']:IsPadOpen() then return end TriggerEvent('myresource:openTablet') end)
IsPadPoweredOn()

Returns true if the tablet is powered on.

Show example

Pauses fleet polling while the tablet is powered off by the player.

CreateThread(function() while true do Wait(3000) if not exports['agency-pad']:IsPadPoweredOn() then print('Tablet powered down, pausing fleet poll') end end end)
GetPadData()

Returns the full client-side PadData table.

Show example

Dumps the full client-side tablet data table for inspection.

RegisterCommand('paddebug', function() local data = exports['agency-pad']:GetPadData() print(json.encode(data, { indent = true })) end)
GetPadPropEntity()

Returns the entity handle of the held tablet prop, or 0 if not visible.

Show example

Hides the held tablet prop entity briefly during a custom cutscene.

CreateThread(function() Wait(750) local prop = exports['agency-pad']:GetPadPropEntity() if prop ~= 0 and DoesEntityExist(prop) then SetEntityVisible(prop, false, false) end end)
IsPadExpanded()

Alias of IsPadOpen() kept for backward compatibility.

Show example

Legacy alias used to gate a minigame while the tablet is open.

AddEventHandler('myresource:client:beforeMinigame', function() if exports['agency-pad']:IsPadExpanded() then return end TriggerEvent('myresource:client:startMinigame') end)
HasCarrierContract()

Returns true when the player has an active carrier data plan on the tablet.

Show example

Warns the player if no carrier data plan is currently active on the tablet.

RegisterCommand('checkpaddata', function() if not exports['agency-pad']:HasCarrierContract() then TriggerEvent('chat:addMessage', { args = { 'No tablet data plan, buy one in Settings' } }) end end)
GetPadState()

Returns table { isOpen, poweredOn, syncEnabled } summarising current tablet status.

Show example

Caches tablet state on the server only when it is open and powered on.

AddEventHandler('myresource:saveSession', function() local state = exports['agency-pad']:GetPadState() if state.isOpen and state.poweredOn then TriggerServerEvent('myresource:server:cachePadState', state) end end)
HasPad()

Returns true if the player has the configured tablet item in their inventory.

Show example

Blocks a dispatch UI command unless the player carries the tablet item.

RegisterCommand('opendispatch', function() if not exports['agency-pad']:HasPad() then TriggerEvent('chat:addMessage', { args = { 'You need a tablet first' } }) return end TriggerEvent('myresource:client:openDispatch') end)
RegisterAgencyPayPoint(id, data)

Registers a runtime Agency Pay terminal at a coordinate (markers, blip, checkout payload).

Show example

Spawns a runtime Agency Pay terminal at the hospital lobby for billing.

CreateThread(function() exports['agency-pad']:RegisterAgencyPayPoint('hospital_lobby', { coords = vector3(307.7, -1433.4, 30.0), label = 'Hospital Bill', amount = 500, receiver = 'medical' }) end)
RemoveAgencyPayPoint(id)

Removes a previously registered Agency Pay terminal by id.

Show example

Removes a registered tablet pay point when its location closes.

AddEventHandler('myresource:onLocationClosed', function(locationId) exports['agency-pad']:RemoveAgencyPayPoint(locationId) end)
StartAgencyPayCheckout(data)

Opens the tablet (if needed) and launches an Agency Pay checkout flow with the given payment payload.

Show example

Opens the tablet and starts an Agency Pay checkout for property tax.

RegisterCommand('paybill', function() exports['agency-pad']:StartAgencyPayCheckout({ amount = 1500, receiver = 'gov_taxes', label = 'Property tax', memo = 'Quarterly tax' }) end)
StartCall(contactData)

Starts an outgoing tablet call to the supplied contact ({ name, number, ... }).

Show example

Starts an outgoing tablet call when a dispatch event arrives.

RegisterNetEvent('myresource:client:dispatchOnTablet', function(payload) exports['agency-pad']:StartCall({ name = payload.name or 'Field Agent', number = payload.number, anonymous = false }) end)
PhoneNotification(title, text, icon, color, timeout, acceptIcon, denyIcon)

Shows an action notification with accept/deny buttons; blocks until the user responds and returns true/false.

Show example

Shows a blocking accept/deny tablet notification to start a delivery mission.

CreateThread(function() local accepted = exports['agency-pad']:PhoneNotification( 'Mission ready', 'Start the delivery now?', 'box', '#3399ff', 12000, 'check', 'x' ) if accepted then TriggerServerEvent('myresource:server:startDelivery') end end)
RegisterApp(config)

Puts an app from your own resource on the pad home screen and in the Store. Returns true, or false and an error.

UnregisterApp(id)

Removes an app added with RegisterApp.

GetRegisteredApps()

Returns the table of all apps registered by other resources, keyed by id.

ClosePad()

Closes the pad, for example before your own interface opens.

ClosePhone()

Same as ClosePad(), under the name the Agency Phone uses, so the same integration code works for both.

IsPhoneRadioActive()

Returns two values: true while the radio on the pad is playing, and the station that is playing.

StopPhoneRadio()

Stops the radio on the pad.

Server exports

SendMail(identifier, mailData)

Sends a mail to the player's primary mailbox by identifier (returns success).

Show example

Sends an invoice notification mail to a player by their identifier.

RegisterNetEvent('myresource:server:sendInvoiceMail', function(targetId) local identifier = GetPlayerIdentifier(targetId, 0) exports['agency-pad']:SendMail(identifier, { sender = '[email protected]', subject = 'New invoice available', body = 'Open the tablet to review your invoice.' }) end)
usePad(event, item, inventory, slot, data)

ox_inventory hook registered when ESX+ox_inventory is detected; opens the tablet for the inventory holder.

Show example

Hooks ox_inventory to open the tablet via the integration helper.

exports.ox_inventory:registerHook('usingItem', function(payload) if payload.item.name ~= 'tablet' then return end return exports['agency-pad']:usePad('inventory', payload.item, payload.inventory, payload.slot) end, { itemFilter = { tablet = true } })
usePhone(event, item, inventory, slot, data)

ox_inventory hook for the legacy phone item id; opens the tablet for the inventory holder.

Show example

Routes the legacy phone inventory item to open the tablet UI instead.

exports.ox_inventory:registerHook('usingItem', function(payload) if payload.item.name ~= 'phone' then return end return exports['agency-pad']:usePhone('inventory', payload.item, payload.inventory, payload.slot) end, { itemFilter = { phone = true } })
GetMarketPrices()

Returns the current stock and crypto prices of the markets, keyed by market id.

PushPadData(source)

Sends a fresh copy of the tablet data to this player's pad. Returns false if it could not be built.

Events

agency-pad:client:notify

Shows a tablet notification (title, text, icon, color, timeout, silent).

Show example

Fires a non-blocking tablet toast about a newly unlocked mission.

TriggerEvent('agency-pad:client:notify', 'Job update', 'New mission unlocked', 'briefcase', '#22cc88', 5000, false)
agency-pad:client:usePadItem

Opens the tablet when the inventory item is used.

Show example

Forwards a custom inventory item-use event to the tablet open flow.

AddEventHandler('myresource:client:onItemUsed', function(itemName) if itemName == 'tablet' then TriggerEvent('agency-pad:client:usePadItem') end end)
agency-pad:client:openApp

Trigger on the client to open a specific app inside the tablet.

Show example

Jumps the tablet straight to a custom fleet management app.

RegisterCommand('openfleet', function() TriggerEvent('agency-pad:client:openApp', 'fleet') end)
agency-pad:client:newMailNotify

Notifies the client of a freshly received mail.

Show example

Listens for new tablet mail notifications and logs them locally.

AddEventHandler('agency-pad:client:newMailNotify', function(mail) print(('Tablet mail from %s: %s'):format(mail.sender, mail.subject)) end)
agency-pad:client:hourlyPaycheck

Notifies the client of an hourly business paycheck event.

Show example

Reacts to an hourly business paycheck event from the tablet.

AddEventHandler('agency-pad:client:hourlyPaycheck', function(payload) print(('Hourly paycheck: $%s from %s'):format(payload.amount, payload.businessName)) end)
agency-pad:server:requestPadData

Requests a fresh tablet data sync for the calling player.

Show example

Asks the server to push a fresh tablet data sync to the player.

RegisterCommand('refreshpad', function() TriggerServerEvent('agency-pad:server:requestPadData') end)
agency-pad:server:sendMessage

Sends an SMS message (newMsg, targetNumber).

Show example

Sends an SMS from the tablet via a custom command and number argument.

RegisterCommand('quicksmsTab', function(_, args) local target, msg = args[1], table.concat(args, ' ', 2) TriggerServerEvent('agency-pad:server:sendMessage', { message = msg }, target) end)
agency-pad:server:airdropPay

Performs an Agency Airdrop pay-to-nearby-player transfer.

Show example

Triggers an Agency Airdrop transfer to nearby players from the tablet.

RegisterCommand('airdroppad', function(_, args) local amount = tonumber(args[1]) or 0 TriggerServerEvent('agency-pad:server:airdropPay', amount, 'Tablet airdrop') end)
agency-pad:server:buyDataPlan

Buys a carrier data plan for the player.

Show example

Buys a chosen tablet data plan after the player picks one in a custom UI.

AddEventHandler('myresource:client:padPlanSelected', function(plan) TriggerServerEvent('agency-pad:server:buyDataPlan', plan.price, plan.name) end)
agency-pad:dispatch:create

Creates a tablet dispatch from an emergency call/SMS.

Show example

Generates a tablet dispatch entry from an incoming emergency call.

RegisterNetEvent('myresource:server:padDispatchFromCall', function(payload) TriggerEvent('agency-pad:dispatch:create', { source = source, coords = payload.coords, type = 'medical', title = 'Medical assistance' }) end)
agency-pad:server:biz:create

Creates a new business/organisation for the player.

Show example

Creates a new business entry from a custom in-game command.

RegisterCommand('startbiz', function() TriggerServerEvent('agency-pad:server:biz:create', { name = 'Bennys Repair', type = 'mechanic', location = 'sandy_shores' }) end)
agency-pad:server:biz:adminCreate

Admin creates a business on behalf of another player.

Show example

Forwards an admin command to create a business on behalf of another player.

RegisterNetEvent('myresource:server:adminCreateBiz', function(targetSrc, payload) TriggerEvent('agency-pad:server:biz:adminCreate', targetSrc, payload) end)
agency-pad:server:biz:startMission

Starts a configured business mission for the player.

Show example

Starts a configured business mission for the calling player.

RegisterCommand('bizmission', function() TriggerServerEvent('agency-pad:server:biz:startMission', { bizId = 12, missionId = 'delivery_route_a' }) end)
agency-pad:server:applyToListing

Submits a job application to a business listing.

Show example

Submits a job application to a tablet business listing by id.

RegisterCommand('apply', function(_, args) local listingId = tonumber(args[1]) TriggerServerEvent('agency-pad:server:applyToListing', listingId, { coverNote = 'Available immediately' }) end)
agency-pad:server:createMechanicInvoice

Creates a mechanic invoice draft.

Show example

Creates a draft mechanic invoice for a vehicle plate and amount.

RegisterCommand('mechinvoice', function(_, args) TriggerServerEvent('agency-pad:server:createMechanicInvoice', { plate = args[1], amount = tonumber(args[2]) or 250, notes = 'Brake replacement' }) end)
agency-pad:server:sendMechanicInvoicePay

Sends a mechanic invoice to a customer for payment.

Show example

Sends a finalized mechanic invoice to the customer for payment.

AddEventHandler('myresource:client:onInvoiceConfirmed', function(invoice) TriggerServerEvent('agency-pad:server:sendMechanicInvoicePay', invoice.id, invoice.targetSrc) end)
agency-pad:server:mdtCreateInvoice

MDT creates a fine/invoice for a citizen.

Show example

Creates an MDT fine/invoice for a citizen from a custom net event.

RegisterNetEvent('myresource:server:mdtFine', function(targetSrc, amount, reason) TriggerEvent('agency-pad:server:mdtCreateInvoice', { target = targetSrc, amount = amount, reason = reason, officer = source }) end)

03Agency-Watch

Now with AgencyOS27: a free update for everyone who already owns the watch. A real smartwatch for FiveM, not a HUD. AgencyOS27 on the wrist: ten watch faces plus four of their own for the small always-on display, a Studio for case, strap and colours, activity rings with a daily step goal, stopwatch, timer, alarm, weather from real cities, compass, speedometer, garage, four games, a control centre and an app store where players install, reorder and delete apps themselves. Angy sits on the crown: press and hold, ask in plain words, and the watch does it, in all ten languages, on fixed rules without any AI, and without a single request leaving the server. Everything listed so far runs on its own, without any other resource. A detected Agency Phone unlocks calls, messages, mail, contacts and Agency Pay on the wrist, and opens the watch for apps of your own. That verdict is reached server-side through an HMAC handshake with the genuine phone, so a copied resource cannot fake it. Fall detection brings the watch out by itself after a crash or a long fall and offers an emergency call, with or without a phone. Free, QBCore / Qbox / ESX / standalone with auto-detection, ten languages with English as the default, and not a single font or icon loaded from the internet.

Full documentation

Client exports

OpenWatch(mitte)

Opens the watch. Pass true to open it centred on screen instead of in its configured corner.

CloseWatch()

Closes the watch and releases the NUI focus.

ToggleWatch()

Closes the watch if it is open, opens it otherwise.

IsWatchOpen()

Returns true while the watch UI is on screen.

IsWatchLinked()

Returns false when the player switched the link to the Agency Phone off in the control centre.

RunWatchAction()

Triggers whatever is bound to the orange action button (Config.ActionButton).

GetWatchSettings()

Returns the full settings table the watch UI is built from (theme, face, size, apps, locale).

SetWatchSetting(key, value)

Sets a single setting, saves it per character and applies it right away.

SetWatchSettings(table)

Sets several settings at once and rebuilds the UI a single time instead of once per value.

RequestWatchPairing()

Asks the server for a Companion app pairing code. The answer arrives as an event, not as a return value.

ShowUpdate()

Opens the software-update screen of AgencyOS.

HandlesDeath()

Returns true when the watch shows the emergency screen on death. The Agency Phone asks this so both devices never show it at once.

GetFitness()

Returns the current fitness values: steps, distance, active minutes and calories of the running day.

SetWatchAppInstalled(id, on)

Installs or removes one app for this player. The same thing the App Store does, so a server can hand out an app as a reward.

FindWatch()

Makes the watch ring and light up, the way the Companion app's find function does.

StopFindWatch()

Stops the ringing before it runs out on its own.

IsWatchRinging()

Returns true while the watch is ringing.

Server exports

IsPremium(src)

Returns true when this player's watch runs in the Pro version. The verdict comes from the handshake with the genuine Agency Phone, never from the client.

04Agency-Zero

A self driving electric four seater for FiveM, free of charge. Project 0 is its own vehicle, built from scratch in Blender with Sollumz: no door handles, doors that open in a wave, a real steering wheel and pedals for the manual override. Players call it from the Agency Phone, the Agency Pad or the Agency Companion app on their real phone, and it drives to them and parks at the kerb next to them instead of wandering off to look for a bay. Inside, AgencyOS27 runs on the tablet in the dashboard and on the Z menu: a map to tap, Angy, the built-in assistant, on fixed rules and without any AI, to talk to in plain words, six driver assistants with one master switch, chip tuning in stages, sound chips, and statistics counted per car and per owner. Every car carries its own number, bound to its owner in the database, so ownership, tuning and every setting survive a restart. QBCore, Qbox and ESX are detected automatically, it also runs standalone, and all texts ship in 27 languages with English underneath them.

Full documentation

Client exports

ZeroStatus()

Returns the state of the player's own Project 0: whether it exists, where it is, battery, range and whether a ride is running.

ZeroCall()

Calls the car to the player. It drives there and parks at the kerb next to them.

ZeroDeliver()

Has the car delivered when it is not on the map. Costs Config.Remote.deliveryFee, free without a framework.

ZeroGarage()

Sends the car back to its garage.

ZeroCancel()

Cancels a running call or ride.

ZeroFind()

Shows the bearing to the car at the bottom of the screen for Config.Remote.findRadarSeconds seconds.

ZeroDoors(on)

Opens the doors with true, closes them with false. They move in a wave, not all at once.

ZeroLock(on)

Locks the car with true, unlocks it with false.

ZeroLights(on)

Turns the lights on and off.

ZeroBuyInfo()

Returns whether the player may buy a Project 0 and what it costs. Someone who already owns one gets nothing back.

ZeroBuy()

Buys a Project 0 for this player. The car is bound to them in the same step.

ZeroRefresh()

Reads the state again, for a UI that wants fresh numbers without waiting for the next tick.

IsRideActive()

Returns true while an autonomous ride is running.

CallProjectZero()

Starts a ride to the current destination. Without one, the map waypoint is used.

CancelProjectZero()

Ends the ride. The car pulls over and stops.

IsCockpitOpen()

Returns true while the tablet in the dashboard is on screen.

IsManualOverride()

Returns true when the driver has taken the wheel. Without the override the Zero only drives itself.

AnyDoorOpen(veh)

Returns true when at least one door of that vehicle is open.

OpenDoors(veh, opts)

Opens the doors of a vehicle in the wave animation.

CloseDoors(veh, opts)

Closes them again.

AnimateDoors(veh, open, opts)

Opens or closes depending on the second argument, for code that decides at runtime.

SoundChipOf(veh)

Returns the sound chip fitted to that car. Changing the chip changes the engine, never the radio.

Server exports

IsPro(src)

Returns true when this player's Zero runs in the Pro version. The verdict comes from the HMAC handshake with the genuine Agency Phone, never from the client.

ZeroVin(plate)

Returns the vehicle number behind a plate. Every Project 0 gets one when it is handed out and keeps it for good.

ZeroCarsOf(src)

Returns every Project 0 this player owns, with number, plate, tuning stage and statistics.

ZeroSync(src)

Writes the registry state to this player again, for example after another script changed ownership.

Events

agency-zero:client:rideStarted

A ride has started. Carries the destination.

agency-zero:client:rideEnded

The ride is over, cancelled or arrived.

agency-zero:client:arrived

The car has reached the player and opened its doors.

05Agency-Lifeinvader V3

The ad agency of the city: player ads on every screen with categories, boosts, scheduling, drafts, review, a staff job, an AI writer and an app for Agency Phone and Agency Pad.

Fits business and job scripts that advertise on their own, event and casino scripts that announce what happens, Discord logs of every ad, phones and radial menus that open the app, and admin tools that check Lifeinvader admins.

Full documentation

Client exports

OpenApp(tab)

Opens the app on the page you name: 'feed', 'create', 'mine', 'drafts' or 'settings'. Without a page it opens the page used last, or the live feed.

Show example

Opens the app on New ad from your own radial menu or phone.

-- an entry in your radial menu exports['Agency-LifeinvaderV3']:OpenApp('create')
OpenFeed()

Opens the app on the live feed.

Show example

Opens the live feed, for example at a newspaper stand.

exports['Agency-LifeinvaderV3']:OpenFeed()
CloseApp()

Closes the app.

Show example

Closes the app before your own menu opens.

exports['Agency-LifeinvaderV3']:CloseApp()
IsOpen()

True while the app is open on this client.

Show example

Keeps your menu from opening over the app.

if not exports['Agency-LifeinvaderV3']:IsOpen() then -- open your own menu end

Server exports

PostAd(text, opts)

Posts an ad of the server itself: free, never reviewed and first in the queue. opts: author, category, instant (runs right away), reps, interval, duration and boosted. Returns the ad id, or nil and an error code.

Show example

Posts an official ad from your casino or event script, free and first in the queue.

exports['Agency-LifeinvaderV3']:PostAd('Casino night tonight at 20:00, free entry!', { author = 'Diamond Casino', category = 'events', instant = true, })
GetFeed(limit)

The live feed as the app shows it, newest first: id, text, category, boosted, author (nil for anonymous ads), sentAt, created, sent and live.

Show example

Reads the last ads, for a website, a newspaper or a phone app.

for _, ad in ipairs(exports['Agency-LifeinvaderV3']:GetFeed(10)) do print(ad.id, ad.author or 'anonymous', ad.text) end
GetAd(id)

One ad in the same form as the feed, or nil.

Show example

Looks up one ad by its number.

local ad = exports['Agency-LifeinvaderV3']:GetAd(412) if ad then print(ad.text) end
IsAdmin(source)

True when the player is a Lifeinvader admin by ACE, group or identifier.

Show example

Uses the Lifeinvader admin rights in your own script.

if exports['Agency-LifeinvaderV3']:IsAdmin(source) then -- show your admin tools end

Events

agency-lifeinvader:adShown

Local event on every client when an ad appears on the screen, with id, text, category, catLabel, icon, author (nil when anonymous), boosted, duration and system (true for official announcements).

Show example

Reacts on the client when an ad shows up, for example on a billboard.

AddEventHandler('agency-lifeinvader:adShown', function(ad) -- ad.text, ad.author, ad.category end)
agency-lifeinvader:adBroadcast

Local event on the server each time an ad runs, with the ad in the form of the feed. Good for logs or a Discord webhook.

Show example

Logs every ad that runs on the server.

AddEventHandler('agency-lifeinvader:adBroadcast', function(ad) -- send ad.text to your Discord log end)
agency_lifeinvader:openMenu

Kept from V3: opens the app on New ad, so scripts that opened the old menu keep working.

Show example

Opens the app on New ad for a player, as the V3 event did.

TriggerClientEvent('agency_lifeinvader:openMenu', source)
agency_lifeinvader:openRecentMenu

Kept from V3: opens the app on the live feed.

Show example

Opens the live feed for a player, as the V3 event did.

TriggerClientEvent('agency_lifeinvader:openRecentMenu', source)

06Agency-Blackmarket V2

A living black market with moving dealers, a live market, haggling, orders for pickup, courier runs, a fence, money laundering and five reputation levels.

Fits gang, heist and drug scripts that should give reputation or credit, police and dispatch tools that react to deals and dealer moves, and radial menus or phones that open the black market menu.

Full documentation

Client exports

OpenMenu()

Opens the /ablackmarket menu, for example from a radial menu or a phone app. The same checks apply as for the command.

Show example

Opens the black market menu from your own radial menu or phone app.

-- an entry in your radial menu exports['Agency-Blackmarket']:OpenMenu()
CloseMenu()

Closes the menu and gives the mouse back to the game.

Show example

Closes the menu, for example before a cutscene of your own.

-- before your own cutscene starts exports['Agency-Blackmarket']:CloseMenu()
IsMenuOpen()

Returns true while the black market menu is open, at a dealer or anywhere.

Show example

Checks whether the menu is open before your own interface appears.

if exports['Agency-Blackmarket']:IsMenuOpen() then return -- the player is busy in the black market menu end

Server exports

GetReputation(source)

The reputation points of a player, 0 for a player who has none yet.

Show example

Lets only players with enough reputation start your job or heist.

local rep = exports['Agency-Blackmarket']:GetReputation(source) if rep < 150 then return -- this heist needs a known name on the street end
SetReputation(source, value)

Sets the reputation of a player to a fixed value, never below 0. Returns true on success.

Show example

Sets the reputation of a player to a fixed value.

-- an admin tool resets a player exports['Agency-Blackmarket']:SetReputation(targetId, 0)
AddReputation(source, amount)

Adds reputation, or takes it away with a negative amount. A new level is announced to the player and to the Companion app. Returns true on success.

Show example

Rewards a finished job with reputation; a new level is announced.

-- a finished drug run earns street reputation exports['Agency-Blackmarket']:AddReputation(source, 15)
GetLevel(source)

Returns two values: the number of the player's level (1 to 5 by default) and its name.

Show example

Reads the level number and its name, for example to unlock your own content.

local level, name = exports['Agency-Blackmarket']:GetLevel(source) if level >= 4 then print(('%s is %s on the street'):format(GetPlayerName(source), name)) end
AddCredit(source, amount)

Adds dealer credit, which the player can spend on his next purchase or order. Returns true on success.

Show example

Gives a player dealer credit for his next purchase or order.

-- a gang boss pays out in dealer credit exports['Agency-Blackmarket']:AddCredit(source, 2500)
RelocateDealer(dealerId)

Moves a dealer to another of his places right away. Returns true when he moved.

Show example

Moves a dealer to another of his places right away.

-- a tip reached the police: the dealer changes his spot exports['Agency-Blackmarket']:RelocateDealer('vince')
SendDealerAway(dealerId, minutes)

The dealer vanishes for the given minutes and then turns up at another of his places, as after a police visit.

Show example

Sends a dealer away for a while, as after a police visit.

-- a raid in the area: Marlow goes quiet for 20 minutes exports['Agency-Blackmarket']:SendDealerAway('marlow', 20)
IsDealerPresent(dealerId)

True while the dealer stands at one of his places and is not away.

Show example

Checks whether a dealer is at one of his places right now.

if exports['Agency-Blackmarket']:IsDealerPresent('vince') then print('Vince is on the street') end
StartFlashSale(minutes)

Starts a flash sale with random items at a discount. Without minutes the time from Config.FlashSale is used.

Show example

Starts a flash sale from your own event or schedule.

-- the city had a big night: a flash sale for 10 minutes exports['Agency-Blackmarket']:StartFlashSale(10)

Events

agency-blackmarket:deal

Fires on the server with (source, kind, data) after every deal. kind is buy, sell, launder, order, pickup or job, and data holds the details of the deal, such as the dealer, the items and the total.

Show example

Reacts to every deal, for example for your own logs or a police tablet.

AddEventHandler('agency-blackmarket:deal', function(source, kind, data) if kind == 'buy' then print(('%s spent %d at %s'):format(GetPlayerName(source), data.total, data.dealer)) end end)
agency-blackmarket:dealerMoved

Fires on the server with (dealerId, pos, reason) when a dealer changes his place. reason is rotate, return, admin or export.

Show example

Follows the dealers, for example for an informant or a detective job.

AddEventHandler('agency-blackmarket:dealerMoved', function(dealerId, pos, reason) print(('%s moved to %.1f, %.1f (%s)'):format(dealerId, pos.x, pos.y, reason)) end)
agency-blackmarket:flashSale

Fires on the server with (items, minutes) when a flash sale starts. items maps every item on sale to its discount in percent.

Show example

Announces a flash sale on your own channels.

AddEventHandler('agency-blackmarket:flashSale', function(items, minutes) for item, discount in pairs(items) do print(('%s is %d%% off for %d minutes'):format(item, discount, minutes)) end end)

07Agency-Minerjob V2

A mining job with seven areas, three tools, 100 levels, furnaces, gem cutting, contracts and a market with moving prices, all in one menu.

Fits quest and achievement scripts that react to mining, economy and job scripts that read market prices, radial menus and phones that open the menu, and admin tools that set levels or hand out XP.

Full documentation

Client exports

OpenMenu(page)

Opens the menu, for example from a radial menu or a phone app. page is overview (default), market, tools, smelter, cutting or contracts.

Show example

Opens the menu on the market page from your own radial menu or phone app.

-- an entry in your radial menu exports['Agency-Minerjob']:OpenMenu('market')
CloseMenu()

Closes the menu and gives the mouse back to the game.

Show example

Closes the menu before your own menu opens.

exports['Agency-Minerjob']:CloseMenu()
IsMenuOpen()

True while the menu is open.

Show example

Keeps your menu from opening over the mining menu.

if not exports['Agency-Minerjob']:IsMenuOpen() then -- open your own menu end
IsWorking()

True while the player is mining or cutting a gem.

Show example

Keeps your script from interrupting the mining or cutting animation.

if exports['Agency-Minerjob']:IsWorking() then return -- no emotes while mining end
GetLevel()

The mining level of the player.

Show example

Reads the level of the player, for example for a HUD or a phone app.

local level = exports['Agency-Minerjob']:GetLevel() print('Mining level', level)

Server exports

GetLevel(source)

The mining level of a player, 0 when the player is unknown.

Show example

Checks the mining level on the server before your script allows something.

if exports['Agency-Minerjob']:GetLevel(source) < 25 then return -- the quarry job needs level 25 end
GetProgress(source)

Level and progress as { level, xp, need, pct, max }.

Show example

Reads level and progress, for example for a phone app or a scoreboard.

local p = exports['Agency-Minerjob']:GetProgress(source) print(p.level, p.xp, p.need, p.pct)
AddXp(source, amount)

Adds XP, with level ups and their message. Returns true when the player was found.

Show example

Hands out mining XP as a reward from your own quest or event.

-- a quest reward exports['Agency-Minerjob']:AddXp(source, 250)
SetLevel(source, level)

Sets the level between 1 and the highest level and starts it at 0 XP.

Show example

Sets the level, for example from your own admin tool.

exports['Agency-Minerjob']:SetLevel(source, 10)
GetStats(source)

What the player did so far: { mined, smelted, cut, broken, sold, earned, contracts }.

Show example

Reads what a player mined and earned, for a leaderboard or achievements.

local stats = exports['Agency-Minerjob']:GetStats(source) print(stats.mined, stats.earned)
GetPrice(item)

The current market price of an item per piece.

Show example

Reads the current market price, for example for a stock ticker or a shop that buys the same items.

local price = exports['Agency-Minerjob']:GetPrice('gold_bar') print('Gold bar pays', price)

Events

agency-minerjob:mined

Fired on the server after a mining paid out, with source, item, count and the mining area. Listen with AddEventHandler, for example for quests or statistics.

Show example

Reacts on the server to every mining that paid out.

AddEventHandler('agency-minerjob:mined', function(source, item, count, area) -- count mined ore for a quest end)
agency-minerjob:sold

Fired on the server after a sale, with source, item, count and the total paid.

Show example

Reacts on the server to every sale, for logs or statistics.

AddEventHandler('agency-minerjob:sold', function(source, item, count, total) -- log big sales end)
agency-minerjob:contract

Fired on the server when a contract was delivered, with source, item, count and the pay.

Show example

Reacts on the server when a contract was delivered.

AddEventHandler('agency-minerjob:contract', function(source, item, count, pay) -- an achievement for delivered contracts end)

08Agency-Repairkit V2

Realistic vehicle damage with four repair kits, skill checks and a mechanic bonus.

Fits mechanic and tow-truck jobs, shops that sell kits, and any script that should react to a finished repair or to the damage level of the car a player drives.

Full documentation

Client exports

IsRepairing()

Returns true while the local player is working on a vehicle, for example to keep your own menu closed.

Show example

Keeps your own menu closed while the player is repairing a vehicle.

if exports['Agency-Repairkit']:IsRepairing() then return -- keep your menu closed while the player works end
GetVehicleCondition(vehicle)

Engine, body and tank in %, the tyres, the dirt, the damage level and whether the tank leaks. Without an argument it reads the vehicle the player sits in.

Show example

Reads the condition of the vehicle the player drives.

local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) local cond = exports['Agency-Repairkit']:GetVehicleCondition(vehicle) if cond and cond.level == 'critical' then print(('Engine %d %%, leaking: %s'):format(cond.engine, tostring(cond.leaking))) end
OpenMenu()

Opens the /arepairkit menu, for example from a phone app or a radial menu.

Show example

Opens the repair kit menu from your own radial menu or phone app.

-- an entry in your radial menu or phone app exports['Agency-Repairkit']:OpenMenu()
CloseMenu()

Closes the menu and gives the mouse back to the game.

Show example

Closes the menu, for example before a cutscene of your own.

-- before your own cutscene starts exports['Agency-Repairkit']:CloseMenu()
IsMenuOpen()

Returns true while the menu is open.

Show example

Checks whether the menu is open before your own interface appears.

if exports['Agency-Repairkit']:IsMenuOpen() then return -- the player is busy in the repair kit menu end

Server exports

UseKit(source, kit)

Starts a kit for a player as if the item had been used, with all checks. Returns true, or false and the reason. For custom inventories and shops.

Show example

Starts the roadside kit for a player from a custom inventory.

-- your own inventory: start the repair when the item is used local ok, reason = exports['Agency-Repairkit']:UseKit(source, 'basic') if not ok then print('Repair refused: ' .. tostring(reason)) end
GiveKit(source, kit, amount)

Adds kits to a player's inventory through the detected inventory. Returns true on success.

Show example

Gives a player two tyre kits through the detected inventory.

-- a shop NPC sells two tyre kits exports['Agency-Repairkit']:GiveKit(source, 'tyre', 2)
IsRepairing(source)

True while that player is working on a vehicle.

Show example

Skips a task while the player is repairing.

if exports['Agency-Repairkit']:IsRepairing(source) then return -- no new job task while the player is busy end
GetKits()

Every configured kit with its item, label, type of work and duration.

Show example

Lists every kit with its item and label.

for name, kit in pairs(exports['Agency-Repairkit']:GetKits()) do print(name, kit.item, kit.label, kit.duration) end
useKit(event, item, inventory, slot, data)

The ox_inventory item export. The item entries in install/ox_inventory.lua point to it; it is not meant to be called directly.

Show example

The item entry that connects ox_inventory to the kits.

-- ox_inventory/data/items.lua ['agencyrepairkit'] = { label = 'Roadside Repair Kit', weight = 1500, consume = 0, server = { export = 'Agency-Repairkit.useKit' }, },

Events

agency-repairkit:repaired

Fires on the server with (source, netId, kit) after a repair was finished and the kit was used up. Good for logs, payments or job progress.

Show example

Logs every finished repair on the server.

AddEventHandler('agency-repairkit:repaired', function(src, netId, kit) print(('%s finished %s on vehicle %s'):format(GetPlayerName(src), kit, netId)) end)
agency-repairkit:client:repaired

Fires on the client of the repairing player with (netId, kit) when a repair is done.

Show example

Reacts on the client of the repairing player.

AddEventHandler('agency-repairkit:client:repaired', function(netId, kit) if kit == 'advanced' then -- play a sound or advance a job step end end)
agency-repairkit:client:damageLevel

Fires on the driver's client with (level, vehicle) whenever the damage level changes: ok, light, medium, heavy or critical.

Show example

Follows the damage level of the vehicle the player drives.

AddEventHandler('agency-repairkit:client:damageLevel', function(level, vehicle) if level == 'critical' then -- offer the tow-truck job end end)

09Agency-Vehiclekeys V2

Universal vehicle keys with a key ring and remote, saved and temporary keys, job keys, lockpicking and hotwiring with police alerts, and an admin page.

Fits garages, vehicle shops and rentals that hand out keys, job scripts with their own vehicles, heist and car theft scripts that should check or give keys, HUDs that follow the engine, and radial menus or phones that open the key ring.

Full documentation

Client exports

HasKeys(plate)

True when the player holds a key for this plate: owner, shared or temporary. Job vehicles open by their model and are not counted here.

Show example

Checks the key before your script lets the player use the car.

if exports['Agency-Vehiclekeys']:HasKeys(GetVehicleNumberPlateText(vehicle)) then -- the player may drive this car end
GetKeys()

All keys of the player as a list of { plate, kind }. kind is owner, shared or temp.

Show example

Lists every key of the player, for example for a phone app.

for _, key in ipairs(exports['Agency-Vehiclekeys']:GetKeys()) do print(key.plate, key.kind) end
ToggleLock(vehicle)

Locks or unlocks a vehicle the player has a key for, with the same animation and checks as G. Without a vehicle the nearest one in range is used.

Show example

Locks or unlocks the nearest car from your own radial menu.

-- an entry in your radial menu exports['Agency-Vehiclekeys']:ToggleLock()
ToggleEngine()

Starts or stops the engine of the vehicle the player drives, like U.

Show example

Starts or stops the engine from your own menu or car HUD.

exports['Agency-Vehiclekeys']:ToggleEngine()
OpenMenu()

Opens the key ring, for example from a radial menu or a phone app.

Show example

Opens the key ring from your own radial menu or phone app.

-- an entry in your radial menu exports['Agency-Vehiclekeys']:OpenMenu()
CloseMenu()

Closes the key ring and gives the mouse back to the game.

Show example

Closes the key ring before your own menu opens.

exports['Agency-Vehiclekeys']:CloseMenu()
IsMenuOpen()

True while the key ring is open.

Show example

Keeps your menu from opening over the key ring.

if not exports['Agency-Vehiclekeys']:IsMenuOpen() then -- open your own menu end
useLockpick()

Starts a lockpick try at the car in front of the player, or hotwiring in the driver seat. Meant for ox_inventory items: client = { export = 'Agency-Vehiclekeys.useLockpick' }.

Show example

Lets players use the lockpick from the ox_inventory menu.

-- ox_inventory/data/items.lua ['lockpick'] = { label = 'Lockpick', client = { export = 'Agency-Vehiclekeys.useLockpick' }, },

Server exports

GiveKeys(source, plate, mode, hours)

Gives a key. mode 'temp' (default) is a temporary key, optionally for a number of hours, 'perm' a saved key. A source or an identifier works.

Show example

Gives a temporary key, for example when a car is rented or spawned by a job.

-- a rental that lasts two hours exports['Agency-Vehiclekeys']:GiveKeys(source, plate, 'temp', 2)
RemoveKeys(source, plate)

Takes a shared or temporary key away again. Returns true when there was one.

Show example

Takes the key away again when the rental ends or the job is done.

exports['Agency-Vehiclekeys']:RemoveKeys(source, plate)
HasKeys(source, plate)

True when the player holds a key for the plate, job keys for a vehicle nearby included.

Show example

Checks on the server that the player really holds the key.

if not exports['Agency-Vehiclekeys']:HasKeys(source, plate) then return -- no key, no delivery end
SetOwner(source, plate)

Makes the player the owner of a plate, for garages and shops on standalone servers. A previous owner loses the key.

Show example

Makes the buyer the owner of the car on standalone servers.

-- your standalone vehicle shop, after the purchase exports['Agency-Vehiclekeys']:SetOwner(source, plate)
RemoveOwner(plate)

Removes the owner this script saved for a plate.

Show example

Removes the saved owner when the car is sold or scrapped.

exports['Agency-Vehiclekeys']:RemoveOwner(plate)
GetOwner(plate)

The identifier of the owner and where it comes from: 'framework' for owned vehicles of QBCore, Qbox or ESX, 'store' for owners saved by this script.

Show example

Finds the owner of a plate, for police tools or impound scripts.

local owner, from = exports['Agency-Vehiclekeys']:GetOwner(plate) print(owner, from) -- identifier, 'framework' or 'store'
GetKeyHolders(plate)

Everyone else with a key for the plate as a list of { identifier, kind, name, expires }.

Show example

Shows everyone who holds a key for a car, for example in a police computer.

for _, h in ipairs(exports['Agency-Vehiclekeys']:GetKeyHolders(plate)) do print(h.name, h.kind) end
SetVehicleLocked(vehicle, locked)

Locks or unlocks a vehicle for everyone, without a key check. For scripts that need to open a car.

Show example

Opens or locks a car for everyone without a key check.

-- a heist script opens the car for the crew exports['Agency-Vehiclekeys']:SetVehicleLocked(vehicle, false)
IsVehicleLocked(vehicle)

True when the vehicle is locked.

Show example

Reads the lock state on the server.

if exports['Agency-Vehiclekeys']:IsVehicleLocked(vehicle) then -- the car is closed end
GetFramework()

The framework the script found: qbcore, esx or standalone.

Show example

Lets your script follow the framework the key script found.

if exports['Agency-Vehiclekeys']:GetFramework() == 'standalone' then -- give the key yourself end

Events

Agency:Keys:GiveServer

Asks for a temporary key for a plate, as Agency Garage and Agency Vehicleshop do. Trigger it from the client with the plate. The car has to be next to the player or be his.

Show example

Asks for a key for a car that was just spawned next to the player.

-- client side, after your garage spawned the car TriggerServerEvent('Agency:Keys:GiveServer', GetVehicleNumberPlateText(vehicle))
qb-vehiclekeys:server:AcquireVehicleKeys

The key event of qb-vehiclekeys, understood the same way, so garages and shops made for qb-vehiclekeys keep working.

Show example

Scripts written for qb-vehiclekeys keep working without a change.

TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys', plate)
vehiclekeys:client:SetOwner

Client event many garages and shops fire after spawning a car. Leads to a temporary key for that plate after the same checks on the server.

Show example

The event many garages fire after spawning a car gives the player a key.

TriggerEvent('vehiclekeys:client:SetOwner', plate)
qb-vehiclekeys:client:AddKeys

The client event of qb-vehiclekeys for handing out keys, understood the same way.

Show example

Hands out a key the way qb-vehiclekeys did.

TriggerEvent('qb-vehiclekeys:client:AddKeys', plate)
simple_carkeys:client:toggleEngine

Fired on the client when the engine is started or stopped with a key, so HUDs such as Agency-Hud can follow the engine state.

Show example

Lets your HUD follow the engine when it is started or stopped with a key.

AddEventHandler('simple_carkeys:client:toggleEngine', function() -- update the engine icon of your HUD end)

10Agency-Vending

Vending machines with player ownership, cash or AgencyPay card payment.

Pair with Agency-Phone's AgencyPay export for card-based purchases. Use in jobs where players own vending locations (gas stations, offices, apartments) to generate passive income.

Full documentation

Events

agency-vending:notify

Generic server-driven notification dispatcher for the vending resource.

Show example

Sends a generic vending-themed notification to the player after a purchase.

-- Plug a vending receipt into a custom logger via notify event TriggerClientEvent('agency-vending:notify', src, 'success', 'Receipt #4821 saved to wallet')
agency-vending:startAgencyPay

Initiates an Agency Pay checkout via the agency-phone integration with merchant metadata.

Show example

Initiates an Agency Pay checkout via the phone with the kiosk's merchant data.

-- Pop a phone Agency Pay flow when a player taps a kiosk TriggerClientEvent('agency-vending:startAgencyPay', src, { merchant = 'Sprunk Co', amount = 4.50, ref = 'flash_sale_01' })
agency-vending:buyMachineResult

Result of a buy-machine purchase, forwarded to the NUI for feedback.

Show example

Forwards a buy-machine purchase result to a custom shop NUI for feedback.

-- Forward buy-machine outcome to a custom shop UI TriggerClientEvent('agency-vending:buyMachineResult', src, { success = true, machineId = 102 })
agency-vending:machineCreated

Broadcast that a new player-owned machine was created; updates local cache and notifies owner.

Show example

Broadcasts a freshly created player-owned vending machine to all clients.

-- Cache new owner-machine instantly when business script registers it TriggerClientEvent('agency-vending:machineCreated', -1, { id = 142, owner = identifier, type = 'sprunk' })
agency-vending:openManagementVerified

Server-verified open of the owner management menu with items, earnings and label.

Show example

Opens the verified management UI with items, earnings and label after auth.

-- After server-side ownership check open management menu with stock TriggerClientEvent('agency-vending:openManagementVerified', src, { items = items, earnings = 1240, label = 'East LS Sprunk' })
agency-vending:openOwnedList

Opens the owner overview NUI listing all of the player's machines with street names.

Show example

Opens the owner overview NUI listing all of the player's vending machines.

-- Hotkey opens the owner overview NUI listing all owned machines TriggerClientEvent('agency-vending:openOwnedList', src)
agency-vending:spawnMachineCreated

Admin-spawner broadcast that a new spawned machine entity was created.

Show example

Notifies all clients that an admin spawned a new vending machine entity.

-- Custom mapping tool tracks newly admin-spawned machine TriggerClientEvent('agency-vending:spawnMachineCreated', -1, { entity = netId, model = 'prop_vend_soda_01', id = 7 })
agency-vending:spawnMachineDeleted

Admin-spawner broadcast that a spawned machine entity was deleted.

Show example

Tells all clients that an admin deleted a previously spawned vending machine.

-- Mapping tool removes a deleted spawned machine from cache TriggerClientEvent('agency-vending:spawnMachineDeleted', -1, 7)
agency-vending:openSpawnerUI

Opens the admin spawner NUI after server-side permission check passes.

Show example

Opens the admin spawner NUI for placing world vending machines.

-- Custom command opens the admin spawner UI after permission passes TriggerClientEvent('agency-vending:openSpawnerUI', src)
agency-vending:buyMachine

Player buys a vending machine of a given type at the supplied coords/heading.

Show example

Player buys a sprunk-type vending machine at their current coords from an NPC.

-- Custom NPC sells vending machines via dialog local coords = GetEntityCoords(PlayerPedId()) local heading = GetEntityHeading(PlayerPedId()) TriggerServerEvent('agency-vending:buyMachine', 'sprunk', coords, heading)
agency-vending:requestOwnedList

Caller requests the list of their owned machines for the owner overview UI.

Show example

Requests the list of the player's owned vending machines from the server.

-- Refresh owner overview after a balance/restock action elsewhere TriggerServerEvent('agency-vending:requestOwnedList')
agency-vending:requestMachines

Caller requests a full sync of all player-owned machines from the server.

Show example

Requests a fresh full sync of all player-owned vending machines from server.

-- Scan for nearby machines after teleport finished TriggerServerEvent('agency-vending:requestMachines')
agency-vending:requestManagement

Server-verified open of the management UI for an owned machine.

Show example

Requests server-verified management UI for the clicked owned vending machine.

-- Owner UI requests verified management menu for a clicked machine TriggerServerEvent('agency-vending:requestManagement', machineId)
agency-vending:requestSpawnedMachines

Caller requests the list of admin-spawned machines for the spawner UI.

Show example

Requests the list of all admin-spawned vending machines for the spawner UI.

-- Admin spawner UI fetches all currently spawned machines TriggerServerEvent('agency-vending:requestSpawnedMachines')
agency-vending:adminSpawnMachine

Admin places a new vending machine prop server-side after permission check.

Show example

Admin spawns a new snack-type vending machine prop after a permission check.

-- Admin places a snack machine via custom slash command TriggerServerEvent('agency-vending:adminSpawnMachine', 'snack', vector3(120.5, -1280.7, 29.3), 90.0)
agency-vending:adminDeleteSpawned

Admin deletes a previously spawned vending machine prop server-side.

Show example

Admin removes a previously spawned vending machine prop server-side.

-- Admin removes a misplaced machine via map editor button TriggerServerEvent('agency-vending:adminDeleteSpawned', spawnedId)

11Agency-Admin

Full-featured admin panel with glass UI, AgencyAI chat, and 60+ admin tools.

The events are perfect as "primitives" for anti-cheat, moderation bots, or automated enforcement tools, call them from your server script to freeze/kick/notify without writing your own UI.

Full documentation

Events

agency-admin:client:refreshStaffRanks

Triggers the client to re-pull staff ranks data.

Show example

Refreshes the staff ranks cache for every online admin after a promotion.

-- After auto-promotion, refresh staff ranks for all online admins for _, src in ipairs(GetPlayers()) do TriggerClientEvent('agency-admin:client:refreshStaffRanks', tonumber(src)) end
agency-admin:client:freezeTime

Freezes / unfreezes the world time on the client at the given hour/minute.

Show example

Anti-cheat freezes the world clock at noon while reviewing a player.

-- Anti-cheat halts world time during an investigation local hour, minute = 12, 0 TriggerClientEvent('agency-admin:client:freezeTime', src, true, hour, minute)
agency-admin:client:dashboardValue

Pushes a single dashboard card value (e.g. live counter) to the panel UI.

Show example

Pushes the live online player count to the admin dashboard card.

-- Stream live online player count to admin dashboard cards local count = #GetPlayers() TriggerClientEvent('agency-admin:client:dashboardValue', adminSrc, 'players_online', count)
agency-admin:client:teleportToCoords

Teleports the caller to the supplied world coordinates.

Show example

Teleports a player to the saved coordinates after a respawn event.

-- Job script teleports a player back to last save point on respawn local coords = vector3(-1037.7, -2737.6, 20.16) TriggerClientEvent('agency-admin:client:teleportToCoords', src, coords)
agency-admin:client:announce

Shows a server-wide announcement banner.

Show example

Broadcasts a server-wide announcement banner from a named system sender.

-- Event bot announces a community contest start TriggerClientEvent('agency-admin:client:announce', -1, 'Event Crew', 'Heist contest starts in 5 minutes!')
agency-admin:client:notify

Pushes a notification to a specific admin.

Show example

Sends a styled notification to the player when their application is approved.

-- Whitelist bot informs a player they passed the application TriggerClientEvent('agency-admin:client:notify', src, 'Whitelist', 'Application approved!', 'success', 8000)
agency-admin:client:freeze

Freezes the target player in place.

Show example

Freezes a suspect player so staff can investigate without them moving.

-- Anti-cheat freezes a suspect player while staff investigates TriggerClientEvent('agency-admin:client:freeze', suspectSrc, true)
agency-admin:client:heal

Restores target's HP/armor.

Show example

Fully heals the patient after their RP medical treatment finishes.

-- Medic job script fully heals the player after RP treatment ends TriggerClientEvent('agency-admin:client:heal', patientSrc)
agency-admin:client:revive

Revives the target player.

Show example

Revives a downed player after the EMS minigame is successfully completed.

-- EMS revive minigame succeeds, server marks player alive again TriggerClientEvent('agency-admin:client:revive', downedSrc)
agency-admin:client:teleport

Teleports the local player to the supplied coords vector.

Show example

Teleports the local player to the supplied coordinates vector.

-- Tutorial system teleports new player to spawn pad on first join local coords = vector3(245.7, -871.5, 30.5) TriggerClientEvent('agency-admin:client:teleport', src, coords)
agency-admin:client:openMenu

Opens the admin panel UI (requires ACE permission).

Show example

Opens the main admin panel UI for the staff member when they go on duty.

-- Auto-open admin panel for staff right after they switch on duty TriggerClientEvent('agency-admin:client:openMenu', src)
agency-admin:client:openToolsMenu

Server-driven trigger to open the admin tools sub-menu.

Show example

Opens the admin tools sub-menu when the staff hotkey is pressed.

-- Quick-action keybind opens the admin tools sub-menu TriggerClientEvent('agency-admin:client:openToolsMenu', src)
agency-admin:client:closeMenu

Server-driven trigger to close the admin panel UI.

Show example

Force-closes the admin panel UI when the admin is being investigated.

-- Force-close the panel when admin gets reported themselves TriggerClientEvent('agency-admin:client:closeMenu', adminSrc)
agency-admin:client:openClothingMenu

Server-driven trigger to open the in-game clothing menu for the player.

Show example

Opens the clothing menu after the player buys an outfit from a tailor.

-- Tailor NPC opens clothing menu after a uniform purchase TriggerClientEvent('agency-admin:client:openClothingMenu', src)
agency-admin:server:requestPlayers

Requests the current online players list for the admin panel.

Show example

Requests the latest online players list from the server for the panel.

-- Custom dashboard widget refreshes its players list TriggerServerEvent('agency-admin:server:requestPlayers')
agency-admin:server:requestPanelPermissions

Requests the panel permission table for the rank editor.

Show example

Asks the server for the panel permission table used by the rank editor.

-- Permission editor needs the latest panel permission map TriggerServerEvent('agency-admin:server:requestPanelPermissions')
agency-admin:server:requestStaffRanks

Requests the staff ranks dataset for the panel.

Show example

Requests the full staff ranks dataset for use in a custom CRM widget.

-- Sync staff ranks dataset into a custom CRM widget TriggerServerEvent('agency-admin:server:requestStaffRanks')
agency-admin:server:createRank

Creates a new staff rank with metadata and permissions.

Show example

Creates a new staff rank from an external HR portal sync.

-- Sync rank from external HR portal -> create matching staff rank TriggerServerEvent('agency-admin:server:createRank', { name = 'Senior Mod', color = '#a855f7', priority = 50 })
agency-admin:server:requestMyPermissions

Caller requests their own resolved panel permission set.

Show example

Requests the caller's own resolved panel permission set on UI open.

-- Fetch caller's resolved permission set before showing dev tools TriggerServerEvent('agency-admin:server:requestMyPermissions')
agency-admin:server:requestSync

Caller asks the server to push the standard sync payload (duty/perms/etc.).

Show example

Forces the server to push the standard duty/perms sync payload to the caller.

-- Force a fresh sync after the player reconnects TriggerServerEvent('agency-admin:server:requestSync')
agency-admin:server:requestDutyRank

Caller requests their current admin-duty rank info.

Show example

Requests the caller's current admin-duty rank for a custom HUD overlay.

-- Display admin's duty rank on a custom HUD overlay TriggerServerEvent('agency-admin:server:requestDutyRank')
agency-admin:server:requestSpawnedObjects

Caller requests the list of admin-spawned world objects.

Show example

Requests the list of admin-spawned world objects for a minimap overlay.

-- Map editor needs to draw all admin-spawned objects on a minimap TriggerServerEvent('agency-admin:server:requestSpawnedObjects')

12Agency-Anticheat

An anticheat for FiveM that gets to know your server. It checks every player on the server side, where a cheat cannot hide: godmode, super jump, damage multipliers, teleports and blacklisted weapons are read from the synced game state. Cross-checks catch what single values miss: a lethal hit the victim survives, a pistol kill from 500 metres, aim statistics, and several weak signals that together become a pattern. The world protection cancels spawned tanks, explosions, fire and particle spam before anyone sees them. Bans cover identifiers and hardware tokens, so a new account on the same PC stays out, and a lockdown closes the server by itself when several cheaters attack at once. A fresh install runs 48 hours in Learning mode and punishes nobody. Its own in-game panel (/acpanel) shows everything live and runs every action, on any server. With Agency Admin its admins are exempt automatically and the same page also sits inside that panel; with AgencyMod bans also reach your Discord. No database, no subscription, 25 languages, QBCore, Qbox, ESX or standalone.

Full documentation

Server exports

AllowTeleport(source: number, seconds?: number)

Call it right before your script moves a player, then the jump is not counted as a teleport. Default 5 seconds.

SetExempt(source: number, seconds: number)

Exempts one player from every check for a while, for example during an event with godmode. 0 ends it.

Flag(source: number, detail: string)

Your own detection. Counts like any other hit, under the detection external.

BanPlayer(source: number, reason: string, duration?: number, by?: string)

Bans an online player by identifiers and hardware tokens. Duration in seconds, 0 is permanent. Returns the ban ID.

KickPlayer(source: number, reason: string, by?: string)

Kicks a player and logs it to Discord.

Unban(banId: string, by?: string)

Lifts a ban, for example AC-7K3P9.

SetMode(mode: string)

Switches the mode live: learning, relaxed, balanced or strict.

SetDetection(key: string, enabled: boolean)

Switches one detection on or off live.

SetLockdown(on: boolean, by?: string)

Starts or ends a lockdown.

IsExempt(source: number)

Returns whether a player is exempt from the checks.

IsKnownPlayer(source: number)

Returns whether a player has played here long enough without hits to count as known.

GetStatus()

Returns everything the panel shows: mode, layers, knowledge, today's numbers, server load and every detection with its rule.

GetDetections(limit?: number)

Returns the latest detections, newest first.

GetBans()

Returns every active ban with its evidence.

GetPlayers()

Returns the online players with risk score and open strikes, highest risk first.

Events

Agency-Anticheat:detection

Fires on every hit with player, detection, detail, action and strikes.

Agency-Anticheat:banned

Fires after every ban with the full ban record.

Agency-Anticheat:unbanned

Fires after a ban was lifted.

Agency-Anticheat:lockdown

Fires when a lockdown starts or ends.

Agency-Anticheat:learned

Fires when the anticheat learned a new teleport point of your server.

13Agency-Reports V2

Modern report system with live chat per report and AI-assisted replies.

Use as a "support ticket" backbone for your whole server. Your custom scripts can auto-open reports when things go wrong (stuck vehicles, duped items, failed SQL saves) for admin review.

Full documentation

Events

agency-reports:client:notify

Fires a "new report" notification to a specific admin.

Show example

Server-driven notification respecting the player's UI notification preference.

-- Server tells client a new admin reply landed TriggerClientEvent('agency-reports:client:notify', source, 'New reply on your report', 'info')
agency-reports:client:openPlayerUI

Opens the player-side report UI.

Show example

Opens the player report UI with categories, open/recent reports and AI/Discord settings.

-- Open the player report UI on a custom keybind local categories = { 'Bug', 'Player report', 'Stuck' } TriggerEvent('agency-reports:client:openPlayerUI', categories, {}, {}, {})
agency-reports:client:openAdminUI

Opens the admin-side report list.

Show example

Opens the admin reports dashboard with the full reports dataset.

-- Force-open the admin reports dashboard from a staff command TriggerEvent('agency-reports:client:openAdminUI', { reports = {}, total = 0 })
agency-reports:client:teleport

Teleports the calling admin to the supplied coordinates (for goto actions).

Show example

Teleports the calling admin to the supplied coordinates for goto actions.

-- Goto-action: teleport the responding admin to the report scene TriggerEvent('agency-reports:client:teleport', vector3(-247.6, -2010.2, 30.1))
agency-reports:client:healSelf

Fully heals the calling admin's ped.

Show example

Fully heals the calling admin's ped after responding to a report.

-- Heal admin after a hostile scene to keep them in service TriggerEvent('agency-reports:client:healSelf')
agency-reports:server:submitReport

Submits a new report from outside the UI.

Show example

Player submits a new report with title, category and description to the database.

-- Player submits a quick stuck-at-pier report TriggerServerEvent('agency-reports:server:submitReport', 'Stuck at pier', 'Stuck', 'Vehicle wedged under pier - cant move')
agency-reports:server:requestPlayerData

Caller requests their own report payload; optionally opens the player UI on response.

Show example

Caller requests their own report payload, optionally opening the player UI in response.

-- Pull fresh data and (optionally) auto-open the player UI TriggerServerEvent('agency-reports:server:requestPlayerData', true)
agency-reports:server:requestAdminData

Admin requests the full reports dataset and opens the admin dashboard if permitted.

Show example

Admin requests the full reports dataset and opens the admin dashboard if permitted.

-- Admin staff opens the dashboard after going on duty TriggerServerEvent('agency-reports:server:requestAdminData')
agency-reports:server:sendChatMessage

Sends a chat message to an open report.

Show example

Posts a chat message in a specific report thread for admin or player.

-- Player posts a follow-up chat message into report #42 TriggerServerEvent('agency-reports:server:sendChatMessage', 42, 'Still stuck, any ETA?')

14Agency-Doorlock

Lockable doors with in-game setup and per-door access by job, gang or player.

Use it from housing, property or key scripts: give a player a key to one specific door and take it away again. Keys are saved to the database and synced live, and nobody needs admin rights.

Full documentation

Client exports

ToggleNearestDoor()

Locks or unlocks the door the player is standing at. The server checks access exactly like the E key.

Show example

Adds your own key (L) that locks or unlocks the door the player stands at. Access is still checked on the server.

RegisterCommand('lockdoor', function() -- same as pressing E at the door; the server still checks access exports['Agency-Doorlock']:ToggleNearestDoor() end) RegisterKeyMapping('lockdoor', 'Lock / unlock door', 'keyboard', 'L')
GetNearbyDoorId()

Returns the id of the door the player is standing at, or nil.

Show example

Reads which door the player stands at, e.g. to link that door to a house in your own script.

local doorId = exports['Agency-Doorlock']:GetNearbyDoorId() if doorId then -- e.g. let the house owner pick this door when setting up keys TriggerServerEvent('myhousing:server:linkDoor', doorId) end
GetAllDoors()

Returns every door as { id, label, locked, static, leaves, access }. The PIN is never included.

Show example

Lists every door with its id and lock state. The PIN is never part of the data.

for _, door in ipairs(exports['Agency-Doorlock']:GetAllDoors()) do print(('#%d %s - %s'):format(door.id, door.label, door.locked and 'locked' or 'open')) end
GetDoorCoords(doorId: number)

Returns the position of the first door leaf as { x, y, z }, or nil.

Show example

Sets a GPS waypoint to a door, e.g. to guide a player to their new house.

local c = exports['Agency-Doorlock']:GetDoorCoords(doorId) if c then SetNewWaypoint(c.x, c.y) end

Server exports

AddPlayerAccess(doorId: number, player: number|string)

Gives one player access to one door. Saved to the database and synced to every player at once. Returns true, or false plus a reason. true, "unchanged" if the player already had access.

Show example

A house owner hands a key to another player. Your script checks ownership, Agency-Doorlock saves the key and syncs it live. Nobody gets admin rights.

RegisterNetEvent('myhousing:server:giveKey', function(targetId, houseId) local src = source if not IsHouseOwner(src, houseId) then return end -- your own check local doorId = GetHouseDoorId(houseId) -- id from /adoorlock local ok, reason = exports['Agency-Doorlock']:AddPlayerAccess(doorId, tonumber(targetId)) if not ok then print(('Key not given: %s'):format(reason)) end end)
RemovePlayerAccess(doorId: number, player: number|string)

Takes the access away again. Saved and synced at once. Returns true, or false plus a reason. true, "unchanged" if there was nothing to remove.

Show example

Takes a key away again, e.g. when a tenant moves out. With the citizenid it also works while that player is offline.

-- works while the player is offline: pass the citizenid local ok, reason = exports['Agency-Doorlock']:RemovePlayerAccess(doorId, 'ABC12345')
HasPlayerAccess(doorId: number, player: number|string)

true if the player is on the door's player list. Job, gang and "everyone" access are not counted.

Show example

Checks whether a player has a personal key for this door. Job, gang and "everyone" access are not counted.

if exports['Agency-Doorlock']:HasPlayerAccess(doorId, source) then TriggerClientEvent('myhousing:client:showKeyMenu', source, doorId) end
GetPlayerAccess(doorId: number)

Returns a copy of the door's player list, or nil if the door does not exist.

Show example

Lists everyone who holds a key for a door, e.g. for a "manage keys" menu. Returns a copy, changing it does nothing.

for _, citizenid in ipairs(exports['Agency-Doorlock']:GetPlayerAccess(doorId) or {}) do print('Key holder: ' .. citizenid) end
IsReady()

false while the doors are still loading from the database after a start, true afterwards.

Show example

Waits until the doors are loaded after a server start before your script hands out keys.

CreateThread(function() while not exports['Agency-Doorlock']:IsReady() do Wait(500) end -- doors are loaded, safe to grant keys from your own database now end)

Events

agency-doorlock:accessChanged

Fired on the server after AddPlayerAccess or RemovePlayerAccess changed a door. Arguments: doorId, identifier, granted (true / false). Listen with AddEventHandler.

Show example

Server-side log of every key that is given or taken, e.g. for a Discord webhook.

AddEventHandler('agency-doorlock:accessChanged', function(doorId, identifier, granted) print(('Door #%d: %s %s'):format(doorId, identifier, granted and 'got a key' or 'lost their key')) end)

15Agency-Hud

Animated HUD with vehicle dashboard, status bars, speedometer and seatbelt integration.

If you have a custom economy or needs-system, drive the HUD from your own script with these setters instead of hacking around it. The HUD handles animation and persistence for you.

Full documentation

Client exports

GetVehicleSettings()

Returns the current vehicle settings table.

Show example

Reads the local vehicle HUD settings table for inspection or syncing.

local settings = exports['Agency-Hud']:GetVehicleSettings() print('Speed unit:', settings.speedUnit) print('HUD scale:', settings.scale)
SetSpeedUnit(unit: string)

Switches speedometer between 'mph' and 'kmh'.

Show example

Switches the vehicle speedometer to miles per hour and saves locally.

RegisterCommand('usemph', function() exports['Agency-Hud']:SetSpeedUnit('mph') end)
SetHunger(value: number)

Sets the hunger bar value (0-100).

Show example

Pushes the player's current hunger level into the HUD.

AddEventHandler('player:hungerChanged', function(value) exports['Agency-Hud']:SetHunger(value) end)
SetThirst(value: number)

Sets the thirst bar value (0-100).

Show example

Pushes the player's current thirst level into the HUD.

AddEventHandler('player:thirstChanged', function(value) exports['Agency-Hud']:SetThirst(value) end)
SetStress(value: number)

Sets the stress bar value (0-100).

Show example

Updates the HUD stress meter from a custom stress system.

AddEventHandler('jobstress:onTick', function(stress) exports['Agency-Hud']:SetStress(stress) end)
SetMoney(value: number)

Sets the displayed cash balance.

Show example

Updates the cash amount displayed on the HUD wallet panel.

AddEventHandler('wallet:cashChanged', function(cash) exports['Agency-Hud']:SetMoney(cash) end)
SetBank(value: number)

Sets the displayed bank balance (for custom economy scripts).

Show example

Updates the bank balance value rendered in the HUD.

AddEventHandler('bank:balanceChanged', function(balance) exports['Agency-Hud']:SetBank(balance) end)
SetJob(label: string)

Sets the displayed job label.

Show example

Sets the displayed job label after the player changes occupation.

AddEventHandler('job:onChange', function(job) exports['Agency-Hud']:SetJob(job.label) end)
SetRank(rank: string)

Sets the displayed job rank/grade.

Show example

Updates the player rank string shown beside the job label.

AddEventHandler('job:onGradeChange', function(grade) exports['Agency-Hud']:SetRank(grade.label) end)
GetDetectedFramework()

Returns the framework string ("qb", "esx", "standalone") the HUD auto-detected.

Show example

Reads the detected framework key for branching custom HUD logic.

local fw = exports['Agency-Hud']:GetDetectedFramework() if fw == 'qb' then print('QB-Core detected') end

Events

Agency-HUD:client:applyVehicleSettingsPatch

Applies a partial vehicle-settings patch to local vehicle HUD.

Show example

Applies a partial vehicle HUD settings patch on the local client.

TriggerEvent('Agency-HUD:client:applyVehicleSettingsPatch', { style = 'modern', speedUnit = 'kmh' })
Agency-HUD:client:openAdminMenu

Opens the HUD admin menu (requires permission).

Show example

Opens the admin HUD menu NUI on the receiving client.

TriggerEvent('Agency-HUD:client:openAdminMenu')
Agency-HUD:server:checkAdminPermission

Verifies caller's admin rights and opens the admin menu on success.

Show example

Asks the server to verify admin rights and open the HUD admin menu.

RegisterCommand('checkhudadmin', function() TriggerServerEvent('Agency-HUD:server:checkAdminPermission') end)
Agency-HUD:server:saveGlobalSettings

Admin-only persistence of global HUD settings; broadcasts sync.

Show example

Saves a new global HUD configuration (admin only) and broadcasts it.

TriggerServerEvent('Agency-HUD:server:saveGlobalSettings', { style = 'modern', accent = '#ff6b00' })
Agency-HUD:server:requestGlobalSettings

Returns current global settings to the requesting client.

Show example

Requests the current global HUD settings on resource start.

AddEventHandler('onClientResourceStart', function(res) if res == GetCurrentResourceName() then TriggerServerEvent('Agency-HUD:server:requestGlobalSettings') end end)
Agency-HUD:server:requestTime

Returns current server time to the caller for the HUD clock.

Show example

Polls the server clock every minute to refresh the HUD time display.

CreateThread(function() while true do TriggerServerEvent('Agency-HUD:server:requestTime') Wait(60000) end end)

16Agency-Progressbar V2

Animated progress bar with glass UI, 4 themes, cancellable actions and client/server exports.

Use anywhere you would normally show "doing thing X for Y seconds". Replaces multiple legacy progress-bar resources with a single consistent UI across your whole server.

Full documentation

Client exports

StartProgress(data: table)

Starts a progress bar with a full options table. Returns immediately; callbacks fire on completion/cancel.

Show example

Starts an 8 second lockpick progress with animation and finish callback.

exports['Agency-Progressbar']:StartProgress({ label = 'Picking lock...', duration = 8000, animation = { dict = 'anim@heists@fleeca_bank@drilling', clip = 'drill_straight_idle' }, onFinish = function() TriggerServerEvent('garage:lockpicked', vehNet) end, onCancel = function() print('Lockpick cancelled') end })
StopProgress(completed: boolean)

Stops the currently running progress bar. Pass true to mark as cancelled.

Show example

Cancels the active progress bar when the player presses X.

if IsControlJustPressed(0, 73) then exports['Agency-Progressbar']:StopProgress(false) end
IsProgressActive()

Returns true if a progress bar is currently shown.

Show example

Prevents starting a new crafting action while a progress bar is active.

if exports['Agency-Progressbar']:IsProgressActive() then return end startCrafting()
GetProgressPercentage()

Returns the current fill percentage (0-100).

Show example

Triggers a minigame tick once the progress bar is more than 75 percent done.

CreateThread(function() while exports['Agency-Progressbar']:IsProgressActive() do local pct = exports['Agency-Progressbar']:GetProgressPercentage() if pct > 75 then SendMinigameTick() end Wait(100) end end)
SetProgressTheme(theme: string)

Switches theme at runtime: 'modern', 'neon', 'minimal' or 'classic'.

Show example

Switches the active progress bar appearance to the modern theme.

RegisterCommand('darkbar', function() exports['Agency-Progressbar']:SetProgressTheme('modern') end)
SetProgressPosition(position: string)

Changes position: 'top', 'bottom', 'center'.

Show example

Moves the active progress bar to the bottom-center of the screen.

RegisterCommand('barbottom', function() exports['Agency-Progressbar']:SetProgressPosition('bottom-center') end)
TryReload(usedItem?: string)

Plays the ESX-style reload sequence.

Show example

Initiates a server-validated reload using a 9mm ammo box item.

RegisterKeyMapping('+reload', 'Reload weapon', 'keyboard', 'R') RegisterCommand('+reload', function() exports['Agency-Progressbar']:TryReload('ammo-9') end)
UseConsumable(itemName: string, isDrink: boolean)

Plays the eat/drink animation with progress bar.

Show example

Plays the drink animation and applies thirst gain when using water.

RegisterNetEvent('inventory:useItem', function(item) if item == 'water_bottle' then exports['Agency-Progressbar']:UseConsumable('water_bottle', true) end end)

Server exports

StartProgressForPlayer(playerId: number, data: table)

Trigger a progress bar on a specific client from the server.

Show example

Starts a 5 second lift-crate progress bar on the requesting player.

RegisterCommand('lift', function(source) exports['Agency-Progressbar']:StartProgressForPlayer(source, { label = 'Lifting crate...', duration = 5000 }) end, false)
StopProgressForPlayer(playerId: number, completed?: boolean)

Cancels a specific player's progress bar remotely.

Show example

Cancels a target player's active progress bar from the server.

RegisterNetEvent('admin:cancelProgress', function(targetId) exports['Agency-Progressbar']:StopProgressForPlayer(targetId, false) end)
StartProgressForAllPlayers(data: table)

Broadcasts a progress bar to every connected client.

Show example

Broadcasts a 30 second storm warning progress bar to every player.

RegisterNetEvent('event:weatherWarning', function() exports['Agency-Progressbar']:StartProgressForAllPlayers({ label = 'Storm incoming - take shelter', duration = 30000 }) end)
StopProgressForAllPlayers(completed?: boolean)

Cancels every player's progress bar (e.g. round end).

Show example

Stops the global storm warning progress bar on every player.

RegisterNetEvent('event:weatherCleared', function() exports['Agency-Progressbar']:StopProgressForAllPlayers(true) end)

Events

Agency:Progressbar:LoadSettings

Loads per-player UI settings (position, color, scale, style) from DB into the client.

Show example

Loads the player's saved progress bar UI settings on spawn.

AddEventHandler('playerSpawned', function() TriggerEvent('Agency:Progressbar:LoadSettings') end)
agency-progressbar:client:start

Starts the progress bar on the receiving client with the supplied data.

Show example

Starts a 12 second engine repair progress bar that can be cancelled.

TriggerEvent('agency-progressbar:client:start', { label = 'Repairing engine...', duration = 12000, canCancel = true })
agency-progressbar:client:stop

Stops the active progress bar with a completion flag.

Show example

Aborts the active progress bar when the player gets cuffed.

RegisterNetEvent('police:cuffed', function() TriggerEvent('agency-progressbar:client:stop', false) end)
agency:consumables:useFood

Inventory bridge to consume a food item (animation + secured server apply).

Show example

Triggers the inventory food bridge to consume a sandwich item.

TriggerEvent('agency:consumables:useFood', 'sandwich')
agency:consumables:useDrink

Inventory bridge to consume a drink item (animation + secured server apply).

Show example

Triggers the inventory drink bridge to consume a coffee cup item.

TriggerEvent('agency:consumables:useDrink', 'coffee_cup')
Agency:Progressbar:SaveSettings

Validates and persists the player's progress bar UI settings to the DB.

Show example

Persists the player's progress bar UI preferences to the database.

TriggerServerEvent('Agency:Progressbar:SaveSettings', { position = 'top-right', color = '#00aaff', scale = 1.2 })
agency-progressbar:server:start

Server-side trigger to start a progress bar on a target (or self).

Show example

Server-side trigger to start a 6 second crate loading bar on a target.

RegisterCommand('movecrate', function(source) TriggerEvent('agency-progressbar:server:start', source, { label = 'Loading crate onto truck', duration = 6000 }) end, false)
agency-progressbar:server:stop

Server-side trigger to stop a progress bar on a target (or self).

Show example

Server-side trigger to stop a target's progress bar with cancel state.

RegisterNetEvent('admin:abortJob', function(targetId) TriggerEvent('agency-progressbar:server:stop', targetId, false) end)
agency:reload:request

Validates ammo/weapon/item before granting a reload to the requesting player.

Show example

Asks the server to validate ammo and grant a pistol reload.

TriggerServerEvent('agency:reload:request', 'WEAPON_PISTOL', 'ammo-9')
agency:consumables:apply

Validates inventory, removes one item and applies hunger/thirst gains.

Show example

Asks the server to remove the food item and apply hunger gains.

RegisterNetEvent('food:onEatStart', function(itemName) TriggerServerEvent('agency:consumables:apply', itemName) end)

17Agency-Notify V2

Notification system with V1/V2 styles, AgencyAI smart priority, spam protection and database persistence.

Replace every other notification resource on your server (qb-notify, esx_notify, mythic_notify, okok-notify, etc.) with one consistent look. The AgencyAI priority system auto-rate-limits spammy notifications.

Full documentation

Client exports

Notify(data: { title, text, type, duration, ... })

Shows a notification. Accepts { type, title, text, duration, icon, color }.

Show example

Sends a 6 second success notification announcing a heist objective.

exports['Agency-Notify']:Notify({ title = 'Bank Heist', text = 'Vault drilled, grab the loot!', type = 'success', duration = 6000 })

Events

Agency:Notify:Send

Same as the export, lets you use the legacy Trigger-based pattern.

Show example

Legacy v1 client event that displays the same payload as the export.

TriggerEvent('Agency:Notify:Send', { title = 'Old Notify', text = 'Legacy v1 entry point still works', type = 'info' })
Agency:Notify:LoadSettings

Applies per-player saved UI settings (position, color, scale, style) from the server.

Show example

Loads saved per-player notify UI settings on spawn.

AddEventHandler('playerSpawned', function() TriggerEvent('Agency:Notify:LoadSettings') end)
Agency:Notify:SaveSettings

Validates and persists the player's notify settings (position, accent, scale, style).

Show example

Persists the player's notify position, accent and scale to the database.

TriggerServerEvent('Agency:Notify:SaveSettings', { position = 'top-right', accent = '#ff8800', scale = 1.1, style = 'modern' })

18Agency-Seatbelt V2

Seatbelt with ejection physics, 3D sounds, multi-occupant support and HUD integration.

Plug the state into your own HUD, or force-enable at the start of a police chase / heist escape. The force-enable/disable exports are great for RP moments.

Full documentation

Client exports

isSeatbeltOn()

Returns true if the player currently has their seatbelt on.

Show example

Disables the exit-vehicle control while the seatbelt is buckled.

if exports['Agency-Seatbelt']:isSeatbeltOn() then DisableControlAction(0, 75, true) end
enableSeatbelt()

Forces the seatbelt on (use e.g. on police arrest).

Show example

Buckles the local player's seatbelt with HUD and sound feedback.

RegisterNetEvent('vehicle:autoBuckle', function() if IsPedInAnyVehicle(PlayerPedId(), false) then exports['Agency-Seatbelt']:enableSeatbelt() end end)
disableSeatbelt()

Forces the seatbelt off (cutscenes, rp scenarios).

Show example

Unbuckles the local player's seatbelt when leaving a vehicle.

RegisterNetEvent('vehicle:onExit', function() exports['Agency-Seatbelt']:disableSeatbelt() end)
toggleSeatbelt()

Toggles the seatbelt (what the default keybind does).

Show example

Toggles the local player's seatbelt buckled state on key press.

RegisterKeyMapping('+seatbelt', 'Toggle seatbelt', 'keyboard', 'B') RegisterCommand('+seatbelt', function() exports['Agency-Seatbelt']:toggleSeatbelt() end)
isAutoBuckled()

Returns true while the belt was fastened by the car and not by the player.

autoBuckle(on: boolean)

Fastens or releases the belt as an automatic belt, the same way a self-driving car does.

getSeatbeltState()

Returns a table with the fastened state, whether it is automatic, the seat and the vehicle.

setSeatbeltEnabled(on: boolean)

Turns the whole seatbelt off or on for this player, for cutscenes or admin situations.

isPlayerSeatbeltOn(serverId: number)

Returns another player's belt state, read from the replicated state bag.

bucklesItselfVehicle(vehicle: number)

Returns whether this vehicle buckles its occupants itself, by model list or by the agAuto state bag.

openSettings()

Opens the settings card.

closeSettings()

Closes the settings card.

isSettingsOpen()

Returns whether the settings card is open.

Server exports

isSeatbeltOn(source: number)

Returns a player's belt state on the server, read from the replicated state bag.

getBuckledPlayers()

Returns the server ids of every player currently buckled up.

setSeatbelt(source: number, on: boolean)

Fastens or releases a player's belt from the server.

Events

Agency-HUD:seatbeltStateChanged

Fires on every change with the new state. Agency-HUD listens for it; any other resource may too.

19Agency-Elevator

Realistic elevator system with Liquid Glass UI and a configurator.

Perfect inside apartment/housing scripts, police HQ, hospital, or any multi-floor interior. Use the configurator to place elevators visually without touching config files.

Full documentation

Events

Agency-Elevator:server:requestTravel

Server-validated request to travel between floors.

Show example

Asks the server to validate access then travel to floor 3 of an elevator.

TriggerServerEvent('Agency-Elevator:server:requestTravel', 'lspd-tower-1', 3)
Agency-Elevator:server:travelComplete

Acknowledges client arrival and pushes the 'arrived at floor' notification.

Show example

Tells the server the player arrived at floor 3 to push the arrival notification.

TriggerServerEvent('Agency-Elevator:server:travelComplete', 'lspd-tower-1', 3)
Agency-Elevator:server:requestElevators

Syncs the loaded elevator list from the database to the requesting client.

Show example

Requests the full elevator list from the server on client init.

AddEventHandler('onClientResourceStart', function(res) if res == GetCurrentResourceName() then TriggerServerEvent('Agency-Elevator:server:requestElevators') end end)
Agency-Elevator:server:saveElevator

Permission-gated upsert of an elevator (id/label/floors) into MySQL.

Show example

Admin upsert of an elevator with a single Lobby floor entry.

TriggerServerEvent('Agency-Elevator:server:saveElevator', { id = 'lspd-tower-1', label = 'LSPD HQ', floors = { { name = 'Lobby', coords = vector3(441.0, -981.5, 30.7) } } })
Agency-Elevator:server:loadElevator

Spawns/loads a saved elevator from the database.

Show example

Loads a single elevator's data into the configurator NUI for editing.

TriggerServerEvent('Agency-Elevator:server:loadElevator', 'lspd-tower-1')
Agency-Elevator:server:saveSettings

Persists UI settings (position/scale/accent color) to MySQL and re-syncs all clients.

Show example

Saves elevator UI position, accent color and scale and re-syncs all clients.

TriggerServerEvent('Agency-Elevator:server:saveSettings', { position = 'top-right', accent = '#22c55e', scale = 1.0 })
Agency-Elevator:client:startTravel

Starts an elevator travel cutscene for the player.

Show example

Plays fade and animation, then teleports the ped to floor 2 of the garage.

TriggerEvent('Agency-Elevator:client:startTravel', 'parking-garage', 2)
Agency-Elevator:client:applySettings

Pushes UI settings (accent/scale/position) into the NUI.

Show example

Applies elevator NUI accent, scale and position on the local client.

TriggerEvent('Agency-Elevator:client:applySettings', { accent = '#0ea5e9', scale = 0.9, position = 'bottom-left' })
Agency-Elevator:client:openConfigurator

Opens the in-game elevator configurator (admin only).

Show example

Opens the admin configurator NUI with the current elevator list.

TriggerEvent('Agency-Elevator:client:openConfigurator')
Agency-Elevator:client:refreshConfigurator

Refreshes the open configurator after a save/delete without closing it.

Show example

Refreshes the open configurator NUI after a save without closing it.

AddEventHandler('Agency-Elevator:server:elevatorSaved', function() TriggerEvent('Agency-Elevator:client:refreshConfigurator') end)

20Agency-Multicharacter

A cinematic character selection and creation for FiveM. Every character stands in a scene that matches its job, police by the cruiser, medics by the ambulance, mechanics in the workshop, wearing its saved outfit, with its own head picture, job, gang, cash, bank, phone number, playtime and last location on a clean card. New characters get name and age rules, a searchable nationality list and height, then the clothing script of the server opens by itself. Slots can be sold through Tebex: buyers unlock them with their transaction id. Players switch characters with /logout. Framework, clothing script, inventory, spawn selector and loading screen are detected automatically; existing characters, playtimes and bought slots from the old multicharacter are taken over. QBCore, Qbox, ESX or fully standalone with its own character storage, 25 languages, the colour follows the server logo.

Full documentation

Client exports

IsOpen()

True while the character selection is open.

OpenSelection()

Opens the selection, for example from your own logout button.

Server exports

GetCharacter(source)

The loaded character (standalone: the full record).

GetCharacterId(source)

citizenid, ESX identifier or agency:<id> of the loaded character.

IsInSelection(source)

True while the player is in the selection.

GetSlots(license)

Slots of a licence.

AddSlots(license, amount)

Adds slots, returns the new total.

Logout(source)

Saves the character and opens the selection.

Events

agency-multicharacter:server:loaded

A character was loaded or created (source, charid, isNew).

agency-multicharacter:server:deleted

A character was deleted (source, charid).

agency:selection

true while a selection screen is open, HUDs can hide themselves.

21Agency-Spawn

A spawn selector with a live camera for FiveM. While the player browses, the camera flies over Los Santos to every location; choosing one brings them down from the sky to their character. It offers the last location, public spawns from one commented list, job and gang spawns only the right characters see, every Agency Housing house the character owns or holds a key for, qb-apartments and a fixed arrival point for new characters. Players can switch on auto spawn at their last location. It answers the qb-spawn and apartment events, so most multicharacter scripts open it without a change, and works hand in hand with Agency Multicharacter. QBCore, Qbox, ESX or standalone, 25 languages, the colour follows the server logo.

Full documentation

Client exports

Open(options)

Opens the selector. options.isNew = true sends new characters to the arrival point.

IsOpen()

True while the selector is open.

Events

agency-spawn:client:spawned

The character landed (id, kind).

agency-spawn:server:spawned

A player spawned (source, id, kind).

qb-spawn:client:setupSpawns / openUI

Answered when qb-spawn is not running, so other multicharacters open Agency Spawn.

22Agency-Housing

Database driven housing system for FiveM. Detects QBCore, QBox and ESX by itself, or runs fully standalone without any framework. Houses are built in game through a step by step creator instead of a config file: interiors, shells, MLOs and whole apartment buildings with up to 40 flats behind one front door, each plot fenced by a property border marked from the air. Players buy houses, sell them to each other, rent and let them, browse every offer in the market and pay rent ahead, and money that arrives while they are offline is paid out when they next join. Keys, MLO door locking with auto lock and doorbell, furnishing from a catalogue of more than 1,300 props, security cameras and the built-in wardrobe are included, and a Housing app brings lock control and live cameras to Agency Phone, Agency Pad, lb-phone and qs-smartphone-pro. Inventory, clothing and garage scripts are found automatically, the database updates itself, and everything persists in MySQL.

Full documentation

Client exports

IsInsideHouse()

Returns true while the player is inside a house.

GetCurrentHouse()

The house the player is currently inside, or nil.

LeaveHouse()

Puts the player back outside through the entrance.

GetHouseAtPoint(coords)

The first house whose property border owns this ground.

GetHousesAtPoint(coords)

Every house owning this ground, for overlapping plots such as an apartment block.

GetCurrentProperty()

The plot the player is standing on right now, or nil.

IsOnProperty(houseId)

Whether the player stands on the property of that house.

GetHouseZone(houseId)

The stored border shape of a house.

GetAccent()

The accent colour the player picked in Housing > Settings.

GetAppUrl(theme)

The address of the Housing app page, to add the app to any other phone. Pass 'light' or 'dark' to force a theme.

GetAppData()

Everything the Housing app shows: the homes the player owns, rents or holds a key to.

AppAction(action, houseId)

Runs an app action for a house: 'waypoint', 'lock' or 'cams'.

Server exports

GetHouses()

Every house on the server, keyed by id.

GetPlayerHouses(source)

The houses that player owns.

HasHouseAccess(source, houseId)

Whether that player owns the house or holds a key to it.

GetHouseAtPoint(coords)

The first house whose property border owns this ground.

GetHousesAtPoint(coords)

Every house owning this ground, for overlapping plots.

GetHouseZone(houseId)

The stored border shape of a house.

Events

agency-housing:client:enteredZone

Fires with (houseId, house) when the player steps onto a property, so a job or robbery script does not have to poll.

agency-housing:client:leftZone

Fires with (houseId, house) when the player leaves a property.

agency-housing:garage:open

Fires with (houseId, houseName) when a house garage is used and Config.Garage.script is 'event', so your own garage script can open it.

23Agency-Banking

A complete bank for FiveM that runs on QBCore, Qbox, ESX or fully standalone. Players get a wallet with bank and cash, bank cards in four themes, transfers by ID or to nearby players, fixed deposits with interest that only the server decides, stock and crypto trading, an ATM PIN and a full activity log. Without a framework the bank keeps its own accounts, and other resources can use it as their money system through server exports. Two menu designs, 13 languages, markers or qb-target / ox_target, a display size slider for every player, tables that create themselves on the first start and the free Agency Companion app for balance, transfers, fixed deposits and cards on the go.

Full documentation

Client exports

OpenBank()

Opens the bank for the local player, wherever they stand.

OpenATM()

Opens the ATM PIN screen for the local player. The player must have set up an ATM PIN at a bank first.

Server exports

GetBankBalance(source)

Returns the player's bank balance, on every framework and standalone.

GetCashBalance(source)

Returns the player's cash.

AddBankMoney(source, amount, reason)

Adds money to the bank balance. Returns true on success, and an open bank refreshes itself.

RemoveBankMoney(source, amount, reason)

Takes money from the bank balance. Returns false when the balance is too low, and nothing is taken then.

AddCashMoney(source, amount, reason)

Adds cash. Returns true on success.

RemoveCashMoney(source, amount, reason)

Takes cash. Returns false when there is not enough, and nothing is taken then.

AddTransaction(identifier, type, amount, reason)

Writes an entry into a player's activity log by identifier (citizenid on QBCore and Qbox, identifier on ESX, licence standalone).

GetFramework()

Returns the framework the bank detected: qbcore, esx or standalone.

Events

agency_banking:client:OpenBank

Trigger it from the server to open the bank for that player.

agency_banking:client:MoneyChanged

Trigger it from the server after another script changed a player's money, and an open bank refreshes.

Still stuck after this page? Our support team takes it from here.

Still stuck after this page? Our support team takes it from here.