开发者对接
对接 Agency 脚本
你正在写自己的 FiveM 脚本,想让它和我们的脚本通信?这里列出了所有公开的导出与事件,每一项都配有可直接复制的 Lua 片段。
导出让你的脚本调用我们脚本里的函数:exports['script-name']:FunctionName(args),客户端和服务端用法相同。事件方向相反:用 TriggerEvent 或 TriggerServerEvent 触发,用 RegisterNetEvent 监听。
01Agency-Phone
支持多框架的全功能手机,集成SMS、通话、社交动态、邮件、相机、钱包和AgencyPay支付。
适用于任何商店/抢劫/职业脚本,当你想要在手机内呈现整洁的支付流程,而不是直接扣款时使用。也非常适合带接受/拒绝按钮的游戏内通知(如出租车请求、dispatch呼叫)。
客户端导出
IsPhoneOpen()若手机UI当前已打开则返回true。
查看示例
手机界面已打开时跳过自定义菜单。
RegisterCommand('openmymenu', function()
if exports['agency-phone']:IsPhoneOpen() then
return
end
TriggerEvent('myresource:openMenu')
end)IsPhonePoweredOn()若手机已开机则返回true。
查看示例
玩家关机期间暂停后台同步任务。
CreateThread(function()
while true do
Wait(2000)
if not exports['agency-phone']:IsPhonePoweredOn() then
print('Phone off, pausing background sync')
end
end
end)GetPhoneData()返回原始的手机数据表。
查看示例
为调试输出完整的手机数据表。
RegisterCommand('phonedebug', function()
local data = exports['agency-phone']:GetPhoneData()
print(json.encode(data, { indent = true }))
end)GetPhonePropEntity()返回手持电话prop的实体句柄,不可见时返回0。
查看示例
在不改动逻辑的情况下短暂隐藏手机道具。
CreateThread(function()
Wait(500)
local prop = exports['agency-phone']:GetPhonePropEntity()
if prop ~= 0 and DoesEntityExist(prop) then
SetEntityVisible(prop, false, false)
end
end)IsPhoneExpanded()若手机在屏幕上处于展开状态则返回true。
查看示例
在手机打开时阻止小游戏的旧版别名。
AddEventHandler('myresource:beforeMinigame', function()
if exports['agency-phone']:IsPhoneExpanded() then
TriggerEvent('chat:addMessage', { args = { 'Close phone first' } })
return
end
end)HasCarrierContract()玩家拥有有效运营商data plan时返回true。
查看示例
当玩家没有有效的流量套餐时提示。
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()返回完整的手机状态对象。
查看示例
仅当手机开启、通电并同步时才缓存状态。
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()若玩家拥有手机物品则返回true。
查看示例
玩家未携带手机时阻止紧急通话命令。
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)注册一个循环使用的AgencyPay商户终端。
查看示例
运行时为修理厂收银台创建Agency Pay终端。
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)移除先前已注册的AgencyPay终端。
查看示例
商店打烊时移除已注册的支付点位。
AddEventHandler('myresource:onShopClosed', function(shopId)
exports['agency-phone']:RemoveAgencyPayPoint('mechanic_main')
print('Removed pay point for shop ' .. shopId)
end)StartAgencyPayCheckout(data)打开AgencyPay结账页面进行安全的银行卡支付。
查看示例
打开手机并发起一笔小额小费支付。
RegisterCommand('paytip', function()
exports['agency-phone']:StartAgencyPayCheckout({
amount = 25,
receiver = 'staff_tip_jar',
label = 'Staff tip',
memo = 'Thanks for great service'
})
end)StartCall(contactData)使用contact表启动pma-voice通话。
查看示例
事件到达时向调度联系人发起呼出通话。
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)显示带有可选接受/拒绝按钮的手机通知。
查看示例
为拖车合同显示阻塞式接受/拒绝通知。
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)服务端导出
SendMail(identifier, mailData)向玩家(在线或离线)发送邮件。
查看示例
通过主标识符向玩家发送订单回执邮件。
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)向Pulse(chirper)动态发布消息。
查看示例
通过服务端事件向Chirper发布悬赏公告。
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)检测到ESX+ox_inventory时注册的ox_inventory钩子;为持有者打开phone。
查看示例
挂接ox_inventory的usingItem以打开手机。
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 } })事件
agency-phone:client:notify显示phone通知 (title, text, icon, color, timeout, silent)。
查看示例
发送非阻塞提示,告知车辆已准备好。
TriggerEvent('agency-phone:client:notify', 'Heads up', 'Vehicle ready for pickup', 'car', '#22cc88', 5000, false)agency-phone:client:usePhoneItem使用phone物品时触发打开流程。
查看示例
将自定义物品使用事件转发到手机打开流程。
AddEventHandler('myresource:client:onItemUsed', function(itemName)
if itemName == 'phone' then
TriggerEvent('agency-phone:client:usePhoneItem')
end
end)agency-phone:client:openApp请求phone按id导航到自定义应用(应用模块使用)。
查看示例
通过应用id直接跳转到自定义银行应用。
RegisterCommand('openbank', function()
TriggerEvent('agency-phone:client:openApp', 'banking')
end)agency-phone:client:newMailNotify向client通知新收到的邮件。
查看示例
监听新邮件通知并记录以便调试。
AddEventHandler('agency-phone:client:newMailNotify', function(mail)
print(('New mail from %s: %s'):format(mail.sender, mail.subject))
end)agency-phone:server:requestPhoneData为调用方玩家请求新的phone数据同步。
查看示例
请求服务器推送最新的手机数据同步。
RegisterCommand('refreshphone', function()
TriggerServerEvent('agency-phone:server:requestPhoneData')
end)agency-phone:server:cancelCall取消或结束当前通话。
查看示例
通过自定义按键或聊天命令挂断当前通话。
RegisterCommand('hangup', function()
TriggerServerEvent('agency-phone:server:cancelCall')
end)agency-phone:server:sendMessage发送SMS消息 (newMsg, targetNumber)。
查看示例
通过聊天命令快速向目标号码发送短信。
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为玩家持久化单个phone设置键/值。
查看示例
当玩家在客户端切换设置时立即保存到服务端。
AddEventHandler('myresource:client:onSettingChanged', function(key, value)
TriggerServerEvent('agency-phone:server:saveSetting', key, value)
end)agency-phone:server:airdropPay向附近玩家执行Agency Airdrop转账。
查看示例
以输入金额向附近玩家发起Agency Airdrop付款。
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为玩家购买运营商data plan (price, planName)。
查看示例
玩家在自定义界面选择后购买相应的流量套餐。
AddEventHandler('myresource:client:onPlanSelected', function(plan)
TriggerServerEvent('agency-phone:server:buyDataPlan', plan.price, plan.name)
end)agency-phone:dispatch:create从紧急呼叫/SMS创建phone调度。
查看示例
根据来电的紧急呼叫生成手机调度记录。
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平板。通过config.lua注册你自己的应用。
适用于管理员仪表板、业务管理应用、帮派领地地图,或GTA中玩家需要的任何自定义UI, 无需额外工作即可在精美的平板外壳中运行。
客户端导出
IsPadOpen()若平板UI已打开则返回true(显示UI前请先检查平板状态)。
查看示例
平板已经打开时,不再打开自定义平板界面。
RegisterCommand('opentablet', function()
if exports['agency-pad']:IsPadOpen() then
return
end
TriggerEvent('myresource:openTablet')
end)IsPadPoweredOn()tablet已开机时返回true。
查看示例
玩家关闭平板期间暂停车队轮询。
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()返回完整的客户端PadData表。
查看示例
输出客户端完整的平板数据表以便检查。
RegisterCommand('paddebug', function()
local data = exports['agency-pad']:GetPadData()
print(json.encode(data, { indent = true }))
end)GetPadPropEntity()返回手持tablet prop的实体句柄,不可见时返回0。
查看示例
在自定义过场动画中短暂隐藏手持平板道具。
CreateThread(function()
Wait(750)
local prop = exports['agency-pad']:GetPadPropEntity()
if prop ~= 0 and DoesEntityExist(prop) then
SetEntityVisible(prop, false, false)
end
end)IsPadExpanded()为向后兼容保留的IsPadOpen()别名。
查看示例
在平板打开时阻止小游戏的旧版别名。
AddEventHandler('myresource:client:beforeMinigame', function()
if exports['agency-pad']:IsPadExpanded() then
return
end
TriggerEvent('myresource:client:startMinigame')
end)HasCarrierContract()玩家在tablet上拥有有效运营商data plan时返回true。
查看示例
当平板没有有效流量套餐时提示玩家。
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()返回汇总当前tablet状态的{ isOpen, poweredOn, syncEnabled }表。
查看示例
仅当平板处于开启且通电状态时才缓存到服务端。
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()玩家库存中拥有配置的tablet物品时返回true。
查看示例
玩家未携带平板时阻止打开调度界面命令。
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)在坐标处注册运行时Agency Pay terminal (markers, blip, checkout payload)。
查看示例
运行时在医院大厅创建Agency Pay结算终端。
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)按id移除先前注册的Agency Pay terminal。
查看示例
当场所关闭时移除已注册的平板支付点位。
AddEventHandler('myresource:onLocationClosed', function(locationId)
exports['agency-pad']:RemoveAgencyPayPoint(locationId)
end)StartAgencyPayCheckout(data)按需打开tablet,并以给定支付payload启动Agency Pay结算流程。
查看示例
打开平板并发起房产税的Agency Pay付款。
RegisterCommand('paybill', function()
exports['agency-pad']:StartAgencyPayCheckout({
amount = 1500,
receiver = 'gov_taxes',
label = 'Property tax',
memo = 'Quarterly tax'
})
end)StartCall(contactData)向给定联系人发起tablet外拨呼叫 ({ name, number, ... })。
查看示例
调度事件到达时通过平板发起呼出通话。
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)显示带accept/deny按钮的操作通知;阻塞至响应并返回true/false。
查看示例
在平板上显示阻塞式接受/拒绝通知以开始配送任务。
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)服务端导出
SendMail(identifier, mailData)按identifier向玩家主邮箱发送mail(返回success)。
查看示例
通过标识符向玩家发送账单通知邮件。
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)检测到ESX+ox_inventory时注册的ox_inventory钩子;为持有者打开tablet。
查看示例
通过集成助手挂接ox_inventory以打开平板。
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)用于旧phone物品id的ox_inventory钩子;为持有者打开tablet。
查看示例
将旧版手机物品改为打开平板界面。
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 } })事件
agency-pad:client:notify显示tablet通知 (title, text, icon, color, timeout, silent)。
查看示例
为新解锁的任务在平板上显示非阻塞提示。
TriggerEvent('agency-pad:client:notify', 'Job update', 'New mission unlocked', 'briefcase', '#22cc88', 5000, false)agency-pad:client:usePadItem使用库存物品时打开tablet。
查看示例
将自定义物品使用事件转发到平板打开流程。
AddEventHandler('myresource:client:onItemUsed', function(itemName)
if itemName == 'tablet' then
TriggerEvent('agency-pad:client:usePadItem')
end
end)agency-pad:client:openApp在client端触发以打开平板中的特定应用。
查看示例
直接跳转到自定义车队管理应用。
RegisterCommand('openfleet', function()
TriggerEvent('agency-pad:client:openApp', 'fleet')
end)agency-pad:client:newMailNotify向client通知新收到的邮件。
查看示例
监听平板的新邮件通知并在本地记录。
AddEventHandler('agency-pad:client:newMailNotify', function(mail)
print(('Tablet mail from %s: %s'):format(mail.sender, mail.subject))
end)agency-pad:client:hourlyPaycheck向client通知每小时business paycheck事件。
查看示例
对平板触发的每小时企业薪资事件做出响应。
AddEventHandler('agency-pad:client:hourlyPaycheck', function(payload)
print(('Hourly paycheck: $%s from %s'):format(payload.amount, payload.businessName))
end)agency-pad:server:requestPadData为调用方玩家请求新的tablet数据同步。
查看示例
请求服务器向玩家推送最新的平板数据同步。
RegisterCommand('refreshpad', function()
TriggerServerEvent('agency-pad:server:requestPadData')
end)agency-pad:server:sendMessage发送SMS消息 (newMsg, targetNumber)。
查看示例
通过自定义命令和号码参数从平板发送短信。
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向附近玩家执行Agency Airdrop转账。
查看示例
从平板向附近玩家发起Agency Airdrop转账。
RegisterCommand('airdroppad', function(_, args)
local amount = tonumber(args[1]) or 0
TriggerServerEvent('agency-pad:server:airdropPay', amount, 'Tablet airdrop')
end)agency-pad:server:buyDataPlan为玩家购买运营商data plan。
查看示例
玩家在自定义界面选择后购买相应的平板流量套餐。
AddEventHandler('myresource:client:padPlanSelected', function(plan)
TriggerServerEvent('agency-pad:server:buyDataPlan', plan.price, plan.name)
end)agency-pad:dispatch:create从紧急呼叫/SMS创建tablet调度。
查看示例
根据来电的紧急呼叫生成平板调度记录。
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为玩家创建新的business/组织。
查看示例
通过自定义游戏命令创建新的企业条目。
RegisterCommand('startbiz', function()
TriggerServerEvent('agency-pad:server:biz:create', {
name = 'Bennys Repair',
type = 'mechanic',
location = 'sandy_shores'
})
end)agency-pad:server:biz:adminCreateAdmin代表其他玩家创建business。
查看示例
转发管理员命令以代表其他玩家创建企业。
RegisterNetEvent('myresource:server:adminCreateBiz', function(targetSrc, payload)
TriggerEvent('agency-pad:server:biz:adminCreate', targetSrc, payload)
end)agency-pad:server:biz:startMission为玩家启动已配置的business任务。
查看示例
为发起命令的玩家启动已配置的企业任务。
RegisterCommand('bizmission', function()
TriggerServerEvent('agency-pad:server:biz:startMission', {
bizId = 12,
missionId = 'delivery_route_a'
})
end)agency-pad:server:applyToListing向business职位列表提交求职申请。
查看示例
通过id向平板的招聘列表提交求职申请。
RegisterCommand('apply', function(_, args)
local listingId = tonumber(args[1])
TriggerServerEvent('agency-pad:server:applyToListing', listingId, {
coverNote = 'Available immediately'
})
end)agency-pad:server:createMechanicInvoice创建机修工发票草稿。
查看示例
为指定车牌和金额创建机械维修发票草稿。
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向客户发送机修工发票以收款。
查看示例
将定稿的维修发票发送给客户进行付款。
AddEventHandler('myresource:client:onInvoiceConfirmed', function(invoice)
TriggerServerEvent('agency-pad:server:sendMechanicInvoicePay', invoice.id, invoice.targetSrc)
end)agency-pad:server:mdtCreateInvoiceMDT为市民创建罚款/账单。
查看示例
通过自定义网络事件为市民创建MDT罚单/发票。
RegisterNetEvent('myresource:server:mdtFine', function(targetSrc, amount, reason)
TriggerEvent('agency-pad:server:mdtCreateInvoice', {
target = targetSrc,
amount = amount,
reason = reason,
officer = source
})
end)03Agency-Watch
A real smartwatch for FiveM, not a HUD. AgencyOS 26.5 on the wrist: six watch faces, seven cases, activity rings with a daily step goal, stopwatch, timer, alarm, weather, compass, speedometer, a control centre and an app store where players install, reorder and delete apps themselves. 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. 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, and not a single font or icon loaded from the internet.
客户端导出
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.
服务端导出
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-LifeinvaderV3
现代化广告系统,支持分级定价、广告队列和管理员审批。
用作Twitter/Instagram的游戏内替代品。适用于宣传新产品的商家、宣布领地的帮派,或发布服务器新闻的管理团队。
事件
agency_lifeinvader:showAd向玩家显示广告(broadcast辅助函数)。
查看示例
Xiang fu wu qi shang mei wei wan jia guang bo she qu huo dong guang gao tong zhi.
-- Push a server-wide announcement ad to every player on event start
local ad = { author = 'Event Crew', text = 'Drag race at airport in 5min!', category = 'event' }
TriggerClientEvent('agency_lifeinvader:showAd', -1, ad)agency_lifeinvader:openMenu打开"创建广告"菜单。
查看示例
Gou mai shou ji ying yong hou da kai Lifeinvader zhu yao guang gao chuang jian cai dan.
-- Open the ad creation menu when the player buys a phone app
TriggerClientEvent('agency_lifeinvader:openMenu', src)agency_lifeinvader:openRecentMenu打开"最近广告"动态。
查看示例
Zai shou ji ying yong dian ji lian xi ren hou da kai zui jin guang gao xin xi liu cai dan.
-- Open the recent ads feed after a contact tap in the phone app
TriggerClientEvent('agency_lifeinvader:openRecentMenu', src)agency_lifeinvader:notify在玩家屏幕上显示框架通知(message, type)。
查看示例
Dang wan jia pai dui de guang gao bei pi zhun shi xian shi kuang jia tong zhi xin xi.
-- Notify the player when their queued ad gets reviewed by staff
TriggerClientEvent('agency_lifeinvader:notify', src, 'Your ad was approved!', 'success')agency_lifeinvader:submitAd从代码提交新广告(由UI使用,可复用)。
查看示例
Mei 60 miao zhong fu wu ci ti jiao yi tiao che liang chu shou guang gao.
-- Submit a vehicle sale ad from a custom dealership UI
TriggerServerEvent('agency_lifeinvader:submitAd', '2018 Pegassi Emperor for sale', 5, 60, 'vehicles', { vehicle = 'emperor2' })05Agency-Blackmarket
基于声望的黑市,支持黑客小游戏、限时特卖、车辆交易和洗钱。
对接你自己的抢劫、劫案或毒品交易脚本, 玩家可在此出售赃物,或在脏钱变干净前进行洗钱。
事件
blackmarket:client:openMenu打开黑市主菜单。
查看示例
Wan cheng gong zuo zhi fu hou wei wan jia da kai hei shi jiao yi shang zhu cai dan.
-- Custom dealer NPC opens the black market menu when its job pays out
TriggerClientEvent('blackmarket:client:openMenu', src)blackmarket:client:closeMenuGuanbi wanjia de suoyou hei shichang caidan.
查看示例
Dang wan jia bei jing cha kao shou hou guan bi suo you da kai de hei shi cai dan.
-- Force-close menu when player gets cuffed by police
TriggerClientEvent('blackmarket:client:closeMenu', suspectSrc)blackmarket:client:openLaunderingMenuDaka xiqian zicaidan.
查看示例
Cheng gong qiang jie hou wei wan jia da kai xi qian zi cai dan.
-- Heist crew NPC opens money laundering submenu after a successful job
TriggerClientEvent('blackmarket:client:openLaunderingMenu', src)blackmarket:client:showNotificationXianshi yi tiao yangshi hua de hei shichang tongzhi (biaoti, xiaoxi, leixing, shijian).
查看示例
Xian shi guan yu cheng zhen xin huo wu de dai yang shi de hei shi tong zhi xin xi.
-- Drop a black-market styled notification when product enters the city
TriggerClientEvent('blackmarket:client:showNotification', -1, 'Dealer', 'New shipment in town', 'info', 6000)blackmarket:server:checkAccess检查玩家当前的访问等级。
查看示例
Jian cha hu jiao zhe shi fou ke yi fang wen hei shi bing huo qu sheng yu zhi.
-- Storefront NPC checks if player can access the black market before opening
TriggerServerEvent('blackmarket:server:checkAccess')blackmarket:server:completeBuyZai keduan xiao youxi chenggong hou wancheng goumai.
查看示例
Zai ke hu duan xiao you xi cheng gong hou wan cheng hei shi jiao yi gou mai.
-- Finalise a buy after the lockpick minigame succeeds
TriggerServerEvent('blackmarket:server:completeBuy', 'weapon_pistol', 1, 8500)blackmarket:server:sellItem处理物品出售。
查看示例
Yi ke xuan xiao you xi he leng que shi jian qi dong tou de lao li shi de chu shou liu cheng.
-- Trigger the sell flow with optional minigame for a stolen item
TriggerServerEvent('blackmarket:server:sellItem', 'rolex', 1)blackmarket:server:completeSellZai keduan xiao youxi chenggong hou wancheng xiaoshou.
查看示例
Zai ke hu duan tao jia hai jia xiao you xi cheng gong hou wan cheng xiao shou.
-- Finalise a sale after the haggle minigame succeeds
TriggerServerEvent('blackmarket:server:completeSell', 'rolex', 1, 4250)blackmarket:server:launderMoney处理洗钱交易。
查看示例
Yi shou xu fei he le suo jiang du pin jiao yi de zang qian xi cheng gan jing xian jin.
-- Launder dirty cash earned from drug trafficking
TriggerServerEvent('blackmarket:server:launderMoney', 'dirty_money', 25000)06Agency-Minerjob
多框架挖矿职业,100 级技能进度、ox_lib 技能检查和 6 种矿石。
适合新手玩家的入门职业。将 XP 进度与帮派声望、白名单职业关联,或作为失业玩家的兜底选择。
事件
agency_minerJob:openSellMenu在矿石精炼厂打开出售菜单。
查看示例
Da kai shang ren xiao shou cai dan, gong wan jia chu shou kuang shi.
-- Open the trader sell menu for the local player
TriggerEvent('agency_minerJob:openSellMenu')agency_minerJob:sellItems按当前市场价一次性出售所有矿石。
查看示例
Yi shang ren dang qian dong tai jia ge mai chu suo you ming ming kuang shi.
-- Sell every copper ore in the player's inventory at current price
TriggerServerEvent('agency_minerJob:sellItems', 'copper')agency_minerJob:requestPlayerItems通过 receivePlayerItems 返回玩家可出售的采矿物品。
查看示例
Xiang fu wu qi qing qiu wan jia ke yi xiang shang ren chu shou de kuang shi lie biao.
-- Ask server which ores are sellable; reply comes via receivePlayerItems
TriggerServerEvent('agency_minerJob:requestPlayerItems')agency_minerJob:requestPlayerSkill通过 receiveSkillInfo 返回采矿技能的快速摘要。
查看示例
Tong guo receiveSkillInfo qing qiu kuai su de wa kuang ji neng zhai yao.
-- Refresh the HUD widget with the current mining level/xp
TriggerServerEvent('agency_minerJob:requestPlayerSkill')agency_minerJob:requestDetailedStats通过 receiveDetailedStats 返回详细的采矿统计数据。
查看示例
Qing qiu xiang xi de wa kuang tong ji bing tong guo receiveDetailedStats da kai cai dan.
-- Open the detailed stats panel after admin command
TriggerServerEvent('agency_minerJob:requestDetailedStats')07Agency-Repairkits
带渐进式损伤机制和现代 UI 的车辆维修包。
适合机修师职业、拖车职业,或作为通用库存中的消耗品。渐进式损伤系统与拆车场或保险脚本完美搭配。
事件
agencyrepairkit:client:startRepair在目标车辆上启动维修动画和进度条。
查看示例
Tong yong chu fa qi yong yu zai wan jia che liang shang qi dong xiu li tao jian liu cheng.
-- Universal trigger when player uses a custom 'repair' button
TriggerEvent('agencyrepairkit:client:startRepair')esx-agencyrepairkit:client:useRepairKit启动维修套件进度流程的 ESX 专用别名。
查看示例
ESX zhuan yong bie ming, qi dong wan jia che liang shang de xiu li tao jian liu cheng.
-- Use this alias from your ESX item handler
TriggerEvent('esx-agencyrepairkit:client:useRepairKit')qb-agencyrepairkit:client:useRepairKit启动维修套件进度流程的 QBCore 专用别名。
查看示例
QBCore zhuan yong bie ming, qi dong wan jia che liang shang de xiu li tao jian liu cheng.
-- QBCore item callback can use this alias directly
TriggerEvent('qb-agencyrepairkit:client:useRepairKit')08Agency-Vehiclekeys
车辆钥匙系统,支持锁定/解锁、远程启动引擎、转向灯和钥匙共享。
作为所有其他脚本的"是否拥有此车辆"校验, 拖车、扣押场、代客泊车、抢车 minigame。validate export 可安全地从任何其他资源调用。
事件
simple_carkeys:client:toggleLock切换车辆锁定状态(遵循所有权)。
查看示例
Wang luo tong bu de suo che qie huan, dai yao kong qi dong hua, deng guang he sheng yin.
-- Sync lock toggle to all clients near a tow truck
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
TriggerEvent('simple_carkeys:client:toggleLock', vehicle)simple_carkeys:client:toggleEngine远程启动或停止目标车辆的引擎。
查看示例
Wei zhi ding che liang shi ti zhi xing wang luo yin qing kai/guan qie huan.
-- Cut the engine remotely on the vehicle the player just left
local lastVeh = GetVehiclePedIsIn(PlayerPedId(), true)
TriggerEvent('simple_carkeys:client:toggleEngine', lastVeh)simple_carkeys:client:showErrorZai keduan xianshi tongyong de 'bu shi nin de che' cuowu tongzhi.
查看示例
Zai ke hu duan xian shi tong yong de bu shi nin de che liang cuo wu tong zhi.
-- Show the standard 'not your car' notification on a failed lockpick
TriggerEvent('simple_carkeys:client:showError')simple_carkeys:client:showNotificationTextZai keduan xianshi dai you renyi wenben de chenggong tongzhi.
查看示例
Zai ke hu duan xian shi dai you ren yi wen ben de cheng gong tong zhi.
-- Tell the player the engine started OK after a custom hotwire script
TriggerEvent('simple_carkeys:client:showNotificationText', 'Engine started')simple_carkeys:client:showErrorTextZai keduan xianshi dai you renyi wenben de cuowu tongzhi.
查看示例
Zai ke hu duan xian shi dai you ren yi wen ben de cuo wu tong zhi.
-- Block engine start when fuel is empty
TriggerEvent('simple_carkeys:client:showErrorText', 'Out of fuel')simple_carkeys:server:forceToggleLockZhiye/guanliyuan lujing: bu jianyan suoyouquan, guangbo cheliang de suoding qiehuan.
查看示例
Zhi ye/guan li yuan lu jing: bu jin xing suo you quan jian cha guang bo che suo qie huan.
-- Police impound forces an unlock without ownership checks
TriggerServerEvent('simple_carkeys:server:forceToggleLock', VehToNet(vehicle))simple_carkeys:server:forceToggleEngineZhiye/guanliyuan lujing: bu jianyan suoyouquan, guangbo cheliang de yinqing qiehuan.
查看示例
Zhi ye/guan li yuan lu jing: bu jin xing suo you quan jian cha guang bo che yin qing qie huan.
-- Ambulance script force-starts a parked car for an evac mission
TriggerServerEvent('simple_carkeys:server:forceToggleEngine', VehToNet(vehicle))simple_carkeys:server:checkOwnershipAndLockYanzheng chepai de suoyouquan/gongxiang yaoshi, chenggong shi guangbo suoding qiehuan.
查看示例
Yan zheng pai zhao de suo you quan/gong xiang yao shi, cheng gong shi guang bo suo qie huan.
-- Player presses L; verify ownership before locking the vehicle
TriggerServerEvent('simple_carkeys:server:checkOwnershipAndLock', 'AB12XYZ', VehToNet(vehicle))simple_carkeys:server:checkOwnershipAndStartYanzheng chepai de suoyouquan/gongxiang yaoshi, chenggong shi guangbo yinqing qiehuan.
查看示例
Yan zheng pai zhao de suo you quan/gong xiang yao shi, cheng gong shi guang bo yin qing qie huan.
-- Validate then start engine on the vehicle the player is in
TriggerServerEvent('simple_carkeys:server:checkOwnershipAndStart', 'AB12XYZ', VehToNet(vehicle))simple_carkeys:server:universalEngineStartDang Config.AllowUniversalEngineStart kaiqi shi, yunxu renhe wanjia qidong renhe yinqing.
查看示例
AllowUniversalEngineStart kai qi shi, yun xu ren he wan jia qi dong ren he yin qing.
-- Hotwire mini-game success: any player starts any engine when allowed in config
TriggerServerEvent('simple_carkeys:server:universalEngineStart', VehToNet(vehicle))09Agency-Vending
支持玩家所有权、现金或 AgencyPay 卡付款的自动售货机。
与 Agency-Phone 的 AgencyPay export 配合使用以支持卡付款。在玩家拥有自动售货机点位(加油站、办公室、公寓)的职业中使用,产生被动收入。
事件
agency-vending:notifyYong yu vending ziyuan de tongyong server qudong tongzhi diaodu qi.
查看示例
Zai gou mai hou xiang wan jia fa song tong yong fan shou ji zhu ti tong zhi.
-- Plug a vending receipt into a custom logger via notify event
TriggerClientEvent('agency-vending:notify', src, 'success', 'Receipt #4821 saved to wallet')agency-vending:startAgencyPayTongguo agency-phone jicheng yi shanghu yuan shuju qidong AgencyPay jiezhang.
查看示例
Tong guo dian hua shi yong zi dong shou huo ji shang jia shu ju qi dong Agency Pay.
-- 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:buyMachineResultGoumai jiqi de jieguo, zhuan fa zhi NUI yi tigong fankui.
查看示例
Jiang gou ji jie guo zhuan fa dao zi ding yi shang dian NUI yi huo qu fan kui.
-- Forward buy-machine outcome to a custom shop UI
TriggerClientEvent('agency-vending:buyMachineResult', src, { success = true, machineId = 102 })agency-vending:machineCreatedGuangbo xin de wanjia ziyou jiqi yi chuangjian; gengxin bendi huanchun bing tongzhi suoyouren.
查看示例
Xiang suo you ke hu duan guang bo xin chuang jian de wan jia yong you zi dong shou huo ji.
-- Cache new owner-machine instantly when business script registers it
TriggerClientEvent('agency-vending:machineCreated', -1, { id = 142, owner = identifier, type = 'sprunk' })agency-vending:openManagementVerifiedJingguo server yanzheng de daka suoyouzhe guanli caidan, baohan wupin, shouyi he biaoqian.
查看示例
Ren zheng hou da kai dai shang pin shou yi he biao qian de jing yan zheng guan li jie mian.
-- 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:openOwnedListDaka suoyouzhe gailan NUI, lieshou wanjia suoyou jiqi ji jiedao mingcheng.
查看示例
Da kai lie chu wan jia suo you zi dong shou huo ji de yong you zhe gai lan jie mian.
-- Hotkey opens the owner overview NUI listing all owned machines
TriggerClientEvent('agency-vending:openOwnedList', src)agency-vending:spawnMachineCreatedGuanliyuan shengcheng qi guangbo xin de shengcheng jiqi shiti yi chuangjian.
查看示例
Tong zhi suo you ke hu duan guan li yuan sheng cheng le xin de zi dong shou huo ji.
-- Custom mapping tool tracks newly admin-spawned machine
TriggerClientEvent('agency-vending:spawnMachineCreated', -1, { entity = netId, model = 'prop_vend_soda_01', id = 7 })agency-vending:spawnMachineDeletedGuanliyuan shengcheng qi guangbo yi shengcheng de jiqi shiti yi shanchu.
查看示例
Gao zhi suo you ke hu duan guan li yuan shan chu le yi sheng cheng de zi dong shou huo ji.
-- Mapping tool removes a deleted spawned machine from cache
TriggerClientEvent('agency-vending:spawnMachineDeleted', -1, 7)agency-vending:openSpawnerUIZai server duan quanxian jianyan tongguo hou daka guanliyuan shengcheng qi NUI.
查看示例
Da kai guan li yuan sheng cheng qi NUI yong yu fang zhi shi jie zi dong shou huo ji.
-- Custom command opens the admin spawner UI after permission passes
TriggerClientEvent('agency-vending:openSpawnerUI', src)agency-vending:buyMachineWanjia zai zhiding zuobiao/fangxiang chu goumai zhiding leixing de zidong shoumai ji.
查看示例
Wan jia zai dang qian zuo biao xiang NPC gou mai yi tai sprunk lei xing zi dong shou huo ji.
-- Custom NPC sells vending machines via dialog
local coords = GetEntityCoords(PlayerPedId())
local heading = GetEntityHeading(PlayerPedId())
TriggerServerEvent('agency-vending:buyMachine', 'sprunk', coords, heading)agency-vending:requestOwnedListQingqiuzhe wei suoyouzhe gailan UI qingqiu ziji yongyou de jiqi liebiao.
查看示例
Cong fu wu qi qing qiu wan jia yong you de zi dong shou huo ji lie biao.
-- Refresh owner overview after a balance/restock action elsewhere
TriggerServerEvent('agency-vending:requestOwnedList')agency-vending:requestMachinesQingqiuzhe xiang server qingqiu suoyou wanjia ziyou jiqi de wanzheng tongbu.
查看示例
Cong fu wu qi qing qiu suo you wan jia yong you de zi dong shou huo ji de quan xin tong bu.
-- Scan for nearby machines after teleport finished
TriggerServerEvent('agency-vending:requestMachines')agency-vending:requestManagementJingguo server yanzheng de daka suoyou jiqi de guanli UI.
查看示例
Wei dian ji de yong you zi dong shou huo ji qing qiu fu wu qi yan zheng guan li jie mian.
-- Owner UI requests verified management menu for a clicked machine
TriggerServerEvent('agency-vending:requestManagement', machineId)agency-vending:requestSpawnedMachinesQingqiuzhe wei shengcheng qi UI qingqiu guanliyuan shengcheng de jiqi liebiao.
查看示例
Wei sheng cheng qi jie mian qing qiu suo you guan li yuan sheng cheng de zi dong shou huo ji lie biao.
-- Admin spawner UI fetches all currently spawned machines
TriggerServerEvent('agency-vending:requestSpawnedMachines')agency-vending:adminSpawnMachineGuanliyuan zai quanxian jianyan hou zai server duan fangzhi xin de zidong shoumai ji wujian.
查看示例
Quan xian jian cha hou guan li yuan sheng cheng yi ge xin de ling shi zi dong shou huo ji.
-- 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:adminDeleteSpawnedGuanliyuan zai server duan shanchu zhiqian shengcheng de zidong shoumai ji wujian.
查看示例
Guan li yuan zai fu wu qi duan shan chu zhi qian sheng cheng de zi dong shou huo ji wu pin.
-- Admin removes a misplaced machine via map editor button
TriggerServerEvent('agency-vending:adminDeleteSpawned', spawnedId)10Agency-Admin
全功能管理面板,配备玻璃 UI、AgencyAI 聊天和 60 多种管理工具。
这些事件非常适合作为反作弊、审核机器人或自动化执法工具的"原语", 从服务器脚本调用即可冻结/踢出/通知,无需编写自己的 UI。
事件
agency-admin:client:refreshStaffRanksChufa keduan chongxin huoqu yuangong dengji shuju.
查看示例
Sheng zhi hou shua xin suo you zai xian guan li yuan de zhi yuan deng ji huan cun.
-- After auto-promotion, refresh staff ranks for all online admins
for _, src in ipairs(GetPlayers()) do
TriggerClientEvent('agency-admin:client:refreshStaffRanks', tonumber(src))
endagency-admin:client:freezeTimeZai zhiding xiaoshi/fenzhong dongjie huo jiedong keduan de shijie shijian.
查看示例
Fan zuo bi xi tong zai shen cha wan jia shi jiang shi jian ding ge zai zheng wu.
-- 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:dashboardValueTuisong yige yibanpan kapian de zhi (li ji jishuqi) dao mianban UI.
查看示例
Shi shi tui song zai xian wan jia shu liang dao guan li yuan yi biao pan ka pian.
-- Stream live online player count to admin dashboard cards
local count = #GetPlayers()
TriggerClientEvent('agency-admin:client:dashboardValue', adminSrc, 'players_online', count)agency-admin:client:teleportToCoordsJiang qingqiuzhe chuansong dao zhiding de shijie zuobiao.
查看示例
Zai chong sheng shi jian hou jiang wan jia chuan song dao bao cun de zuo biao.
-- 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显示全服公告横幅。
查看示例
Cong zhi ding xi tong fa song fang guang bo quan fu wu qi de gong gao heng fu.
-- 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向特定管理员推送通知。
查看示例
Dang shen qing pi zhun shi xiang wan jia fa song dai yang shi de tong zhi xin xi.
-- Whitelist bot informs a player they passed the application
TriggerClientEvent('agency-admin:client:notify', src, 'Whitelist', 'Application approved!', 'success', 8000)agency-admin:client:freeze将目标玩家原地冻结。
查看示例
Dong jie ke yi wan jia ying shi yuan gong neng wu yi dong di jin hang diao cha.
-- Anti-cheat freezes a suspect player while staff investigates
TriggerClientEvent('agency-admin:client:freeze', suspectSrc, true)agency-admin:client:heal恢复目标的 HP/护甲。
查看示例
Zai RP yi liao zhi liao jie shu hou wan quan zhi yu huan zhe.
-- Medic job script fully heals the player after RP treatment ends
TriggerClientEvent('agency-admin:client:heal', patientSrc)agency-admin:client:revive复活目标玩家。
查看示例
Zai EMS xiao you xi cheng gong wan cheng hou fu huo dao xia de wan jia.
-- EMS revive minigame succeeds, server marks player alive again
TriggerClientEvent('agency-admin:client:revive', downedSrc)agency-admin:client:teleportJiang bendi wanjia chuansong dao zhiding de zuobiao xiangliang.
查看示例
Jiang ben di wan jia chuan song dao zhi ding de zuo biao xiang liang.
-- 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打开管理面板 UI(需要 ACE 权限)。
查看示例
Dang ren yuan shang ban shi da kai zhu guan li yuan mian ban jie mian.
-- Auto-open admin panel for staff right after they switch on duty
TriggerClientEvent('agency-admin:client:openMenu', src)agency-admin:client:openToolsMenuServer qudong de chufa qi, daka guanliyuan gongju zicaidan.
查看示例
An xia ren yuan kuai jie jian shi da kai guan li yuan gong ju zi cai dan.
-- Quick-action keybind opens the admin tools sub-menu
TriggerClientEvent('agency-admin:client:openToolsMenu', src)agency-admin:client:closeMenuServer qudong de chufa qi, guanbi guanliyuan mianban UI.
查看示例
Dang guan li yuan bei diao cha shi qiang zhi guan bi guan li yuan mian ban.
-- Force-close the panel when admin gets reported themselves
TriggerClientEvent('agency-admin:client:closeMenu', adminSrc)agency-admin:client:openClothingMenuServer qudong de chufa qi, wei wanjia daka youxinei fuzhuang caidan.
查看示例
Wan jia zai cai feng dian gou mai fu zhuang hou da kai fu zhuang cai dan.
-- Tailor NPC opens clothing menu after a uniform purchase
TriggerClientEvent('agency-admin:client:openClothingMenu', src)agency-admin:server:requestPlayersWei guanliyuan mianban qingqiu dangqian zaixian wanjia liebiao.
查看示例
Cong fu wu qi qing qiu zui xin de zai xian wan jia lie biao yong yu mian ban.
-- Custom dashboard widget refreshes its players list
TriggerServerEvent('agency-admin:server:requestPlayers')agency-admin:server:requestPanelPermissionsWei dengji bianjiqi qingqiu mianban quanxian biao.
查看示例
Wei deng ji bian ji qi xiang fu wu qi qing qiu mian ban quan xian biao ge.
-- Permission editor needs the latest panel permission map
TriggerServerEvent('agency-admin:server:requestPanelPermissions')agency-admin:server:requestStaffRanksWei mianban qingqiu yuangong dengji shujuji.
查看示例
Wei zi ding yi CRM xiao gong ju qing qiu wan zheng zhi yuan deng ji shu ju.
-- Sync staff ranks dataset into a custom CRM widget
TriggerServerEvent('agency-admin:server:requestStaffRanks')agency-admin:server:createRankChuangjian dai you yuan shuju he quanxian de xin yuangong dengji.
查看示例
Cong wai bu ren li zi yuan men hu tong bu chuang jian xin zhi yuan deng ji.
-- 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:requestMyPermissionsQingqiuzhe qingqiu zixing jiexi de mianban quanxian jihe.
查看示例
Da kai jie mian shi qing qiu hu jiao zhe zi ji yi jie xi de mian ban quan xian.
-- Fetch caller's resolved permission set before showing dev tools
TriggerServerEvent('agency-admin:server:requestMyPermissions')agency-admin:server:requestSyncQingqiuzhe qing server tuisong biaozhun sync fuzai (zhiwu/quanxian/deng).
查看示例
Qiang zhi fu wu qi xiang hu jiao zhe fa song biao zhun duty/perms tong bu bao.
-- Force a fresh sync after the player reconnects
TriggerServerEvent('agency-admin:server:requestSync')agency-admin:server:requestDutyRankQingqiuzhe qingqiu zishen dangqian de admin-duty dengji xinxi.
查看示例
Wei zi ding yi HUD die ceng qing qiu hu jiao zhe dang qian guan li zhi wu deng ji.
-- Display admin's duty rank on a custom HUD overlay
TriggerServerEvent('agency-admin:server:requestDutyRank')agency-admin:server:requestSpawnedObjectsQingqiuzhe qingqiu guanliyuan shengcheng de shijie wuti liebiao.
查看示例
Wei xiao di tu die ceng qing qiu guan li yuan sheng cheng de shi jie wu pin lie biao.
-- Map editor needs to draw all admin-spawned objects on a minimap
TriggerServerEvent('agency-admin:server:requestSpawnedObjects')11Agency-Reports V2
现代化举报系统,每个举报都有实时聊天和 AI 辅助回复。
作为整个服务器的"支持工单"基础。当出现问题(车辆卡住、物品复制、SQL 保存失败)时,你的自定义脚本可自动开启举报供管理员审核。
事件
agency-reports:client:notify向特定管理员发送"新举报"通知。
查看示例
Zun zhong wan jia UI tong zhi pian hao de fu wu qi tui song tong zhi.
-- Server tells client a new admin reply landed
TriggerClientEvent('agency-reports:client:notify', source, 'New reply on your report', 'info')agency-reports:client:openPlayerUI打开玩家端举报 UI。
查看示例
Da kai bao han fen lei, kai fang bao gao yi ji AI/Discord she zhi de wan jia bao gao UI.
-- 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打开管理员端举报列表。
查看示例
Da kai bao han wan zheng bao gao shu ju ji de guan li yuan bao gao yi biao ban.
-- Force-open the admin reports dashboard from a staff command
TriggerEvent('agency-reports:client:openAdminUI', { reports = {}, total = 0 })agency-reports:client:teleportJiang qingqiu de guanliyuan chuansong dao zhiding zuobiao (yong yu goto caozuo).
查看示例
Wei goto cao zuo jiang guan li yuan chuan song dao zhi ding zuo biao.
-- 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:healSelfWanquan zhiyu qingqiu de guanliyuan de ped.
查看示例
Zai chu li bao gao hou wan quan zhi liao guan li yuan ped.
-- Heal admin after a hostile scene to keep them in service
TriggerEvent('agency-reports:client:healSelf')agency-reports:server:submitReport从 UI 外部提交新举报。
查看示例
Wan jia ti jiao bao han biao ti, fen lei he miao shu de xin bao gao zhi shu ju ku.
-- 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:requestPlayerDataQingqiuzhe qingqiu zishen de baogao fuzai; xuanze xing di zai xiangying shi daka wanjia UI.
查看示例
Diao yong zhe qing qiu zi ji de bao gao shu ju, ke xuan da kai wan jia UI.
-- Pull fresh data and (optionally) auto-open the player UI
TriggerServerEvent('agency-reports:server:requestPlayerData', true)agency-reports:server:requestAdminDataGuanliyuan qingqiu wanzheng baogao shujuji, ru you quanxian ze daka guanliyuan yibanpan.
查看示例
Guan li yuan qing qiu wan zheng bao gao shu ju ji bing zai yun xu shi da kai yi biao ban.
-- Admin staff opens the dashboard after going on duty
TriggerServerEvent('agency-reports:server:requestAdminData')agency-reports:server:sendChatMessage向已打开的举报发送聊天消息。
查看示例
Zai te ding bao gao xian cheng zhong wei guan li yuan huo wan jia fa song liao tian xiao xi.
-- Player posts a follow-up chat message into report #42
TriggerServerEvent('agency-reports:server:sendChatMessage', 42, 'Still stuck, any ETA?')12Agency-Hud
动画 HUD,集车辆仪表盘、状态栏、速度表和安全带集成于一体。
如果你有自定义经济或需求系统,请使用这些 setter 从自己的脚本驱动 HUD,而非绕开它。HUD 会为你处理动画和持久化。
客户端导出
GetVehicleSettings()返回当前车辆设置表。
查看示例
读取本地车辆HUD设置表用于检查或同步。
local settings = exports['Agency-Hud']:GetVehicleSettings()
print('Speed unit:', settings.speedUnit)
print('HUD scale:', settings.scale)SetSpeedUnit(unit: string)在 'mph' 和 'kmh' 之间切换速度表。
查看示例
将车辆速度表切换为英里每小时并本地保存。
RegisterCommand('usemph', function()
exports['Agency-Hud']:SetSpeedUnit('mph')
end)SetHunger(value: number)设置饥饿条数值(0-100)。
查看示例
将玩家当前的饥饿值推送到HUD。
AddEventHandler('player:hungerChanged', function(value)
exports['Agency-Hud']:SetHunger(value)
end)SetThirst(value: number)设置口渴条数值(0-100)。
查看示例
将玩家当前的口渴值推送到HUD。
AddEventHandler('player:thirstChanged', function(value)
exports['Agency-Hud']:SetThirst(value)
end)SetStress(value: number)设置压力条数值(0-100)。
查看示例
从自定义压力系统更新HUD压力计。
AddEventHandler('jobstress:onTick', function(stress)
exports['Agency-Hud']:SetStress(stress)
end)SetMoney(value: number)设置显示的现金余额。
查看示例
更新HUD钱包面板上显示的现金金额。
AddEventHandler('wallet:cashChanged', function(cash)
exports['Agency-Hud']:SetMoney(cash)
end)SetBank(value: number)设置显示的银行余额(用于自定义经济脚本)。
查看示例
更新HUD中显示的银行余额。
AddEventHandler('bank:balanceChanged', function(balance)
exports['Agency-Hud']:SetBank(balance)
end)SetJob(label: string)设置显示的职业标签。
查看示例
玩家更换职业后设置显示的职业标签。
AddEventHandler('job:onChange', function(job)
exports['Agency-Hud']:SetJob(job.label)
end)SetRank(rank: string)设置显示的职业等级。
查看示例
更新职业标签旁边显示的玩家职级。
AddEventHandler('job:onGradeChange', function(grade)
exports['Agency-Hud']:SetRank(grade.label)
end)GetDetectedFramework()返回 HUD 自动检测到的框架字符串("qb"、"esx"、"standalone")。
查看示例
读取检测到的框架键以分支自定义HUD逻辑。
local fw = exports['Agency-Hud']:GetDetectedFramework()
if fw == 'qb' then
print('QB-Core detected')
end事件
Agency-HUD:client:applyVehicleSettingsPatch向本地车辆 HUD 应用部分车辆设置补丁。
查看示例
在本地客户端应用部分车辆HUD设置补丁。
TriggerEvent('Agency-HUD:client:applyVehicleSettingsPatch', {
style = 'modern',
speedUnit = 'kmh'
})Agency-HUD:client:openAdminMenu打开 HUD 管理菜单(需要权限)。
查看示例
在接收客户端打开管理员HUD菜单NUI。
TriggerEvent('Agency-HUD:client:openAdminMenu')Agency-HUD:server:checkAdminPermission验证调用方的管理员权限,成功后打开管理员菜单。
查看示例
请求服务器验证管理员权限并打开HUD管理员菜单。
RegisterCommand('checkhudadmin', function()
TriggerServerEvent('Agency-HUD:server:checkAdminPermission')
end)Agency-HUD:server:saveGlobalSettings仅管理员可持久化全局 HUD 设置;广播同步。
查看示例
保存新的全局HUD配置(仅管理员)并广播。
TriggerServerEvent('Agency-HUD:server:saveGlobalSettings', {
style = 'modern',
accent = '#ff6b00'
})Agency-HUD:server:requestGlobalSettings向请求的客户端返回当前全局设置。
查看示例
在资源启动时请求当前的全局HUD设置。
AddEventHandler('onClientResourceStart', function(res)
if res == GetCurrentResourceName() then
TriggerServerEvent('Agency-HUD:server:requestGlobalSettings')
end
end)Agency-HUD:server:requestTime向调用方返回当前服务器时间用于 HUD 时钟。
查看示例
每分钟轮询服务器时钟以刷新HUD时间显示。
CreateThread(function()
while true do
TriggerServerEvent('Agency-HUD:server:requestTime')
Wait(60000)
end
end)13Agency-Progressbar
动画进度条,配玻璃 UI、4 种主题、可取消操作和 client/server 导出。
在通常显示"执行 X 操作 Y 秒"的任何地方使用。用单一一致的 UI 替代整个服务器上的多个旧版进度条资源。
客户端导出
StartProgress(data: table)使用完整的选项表启动进度条。立即返回;完成/取消时触发回调。
查看示例
启动一个8秒的开锁进度条,带动画和完成回调。
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)停止当前运行的进度条。传入 true 标记为已取消。
查看示例
玩家按X键时取消活动的进度条。
if IsControlJustPressed(0, 73) then
exports['Agency-Progressbar']:StopProgress(false)
endIsProgressActive()如果当前显示进度条则返回 true。
查看示例
当进度条处于活动状态时,阻止开始新的制作动作。
if exports['Agency-Progressbar']:IsProgressActive() then
return
end
startCrafting()GetProgressPercentage()返回当前填充百分比(0-100)。
查看示例
当进度条超过75%时触发小游戏tick。
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)运行时切换主题:'modern'、'neon'、'minimal' 或 'classic'。
查看示例
将活动进度条的外观切换为现代主题。
RegisterCommand('darkbar', function()
exports['Agency-Progressbar']:SetProgressTheme('modern')
end)SetProgressPosition(position: string)更改位置:'top'、'bottom'、'center'。
查看示例
将活动进度条移动到屏幕底部中央。
RegisterCommand('barbottom', function()
exports['Agency-Progressbar']:SetProgressPosition('bottom-center')
end)TryReload(usedItem?: string)播放 ESX 风格的重新装填序列。
查看示例
使用9mm弹药盒物品启动经服务器验证的重新装填。
RegisterKeyMapping('+reload', 'Reload weapon', 'keyboard', 'R')
RegisterCommand('+reload', function()
exports['Agency-Progressbar']:TryReload('ammo-9')
end)UseConsumable(itemName: string, isDrink: boolean)播放带进度条的吃/喝动画。
查看示例
使用水时播放饮用动画并增加口渴值。
RegisterNetEvent('inventory:useItem', function(item)
if item == 'water_bottle' then
exports['Agency-Progressbar']:UseConsumable('water_bottle', true)
end
end)服务端导出
StartProgressForPlayer(playerId: number, data: table)从服务器在特定客户端上触发进度条。
查看示例
在请求的玩家上启动5秒举起木箱进度条。
RegisterCommand('lift', function(source)
exports['Agency-Progressbar']:StartProgressForPlayer(source, {
label = 'Lifting crate...',
duration = 5000
})
end, false)StopProgressForPlayer(playerId: number, completed?: boolean)远程取消特定玩家的进度条。
查看示例
从服务器取消目标玩家的活动进度条。
RegisterNetEvent('admin:cancelProgress', function(targetId)
exports['Agency-Progressbar']:StopProgressForPlayer(targetId, false)
end)StartProgressForAllPlayers(data: table)向每个已连接的客户端广播进度条。
查看示例
向所有玩家广播30秒的风暴警告进度条。
RegisterNetEvent('event:weatherWarning', function()
exports['Agency-Progressbar']:StartProgressForAllPlayers({
label = 'Storm incoming - take shelter',
duration = 30000
})
end)StopProgressForAllPlayers(completed?: boolean)取消每个玩家的进度条(例如回合结束)。
查看示例
停止所有玩家上的全局风暴警告进度条。
RegisterNetEvent('event:weatherCleared', function()
exports['Agency-Progressbar']:StopProgressForAllPlayers(true)
end)事件
Agency:Progressbar:LoadSettings将每位玩家的 UI 设置(位置、颜色、缩放、样式)从数据库加载到 client。
查看示例
在出生时加载玩家保存的进度条UI设置。
AddEventHandler('playerSpawned', function()
TriggerEvent('Agency:Progressbar:LoadSettings')
end)agency-progressbar:client:start使用提供的数据在接收 client 上启动进度条。
查看示例
启动一个可取消的12秒发动机修理进度条。
TriggerEvent('agency-progressbar:client:start', {
label = 'Repairing engine...',
duration = 12000,
canCancel = true
})agency-progressbar:client:stop使用完成标志停止活动的进度条。
查看示例
当玩家被铐上时中止活动的进度条。
RegisterNetEvent('police:cuffed', function()
TriggerEvent('agency-progressbar:client:stop', false)
end)agency:consumables:useFood用于消耗食物物品的 inventory 桥接(动画 + 安全的 server 应用)。
查看示例
触发库存食物桥接以消耗一个三明治物品。
TriggerEvent('agency:consumables:useFood', 'sandwich')agency:consumables:useDrink用于消耗饮品物品的 inventory 桥接(动画 + 安全的 server 应用)。
查看示例
触发库存饮料桥接以消耗一杯咖啡物品。
TriggerEvent('agency:consumables:useDrink', 'coffee_cup')Agency:Progressbar:SaveSettings验证并将玩家的进度条 UI 设置保存到数据库。
查看示例
将玩家的进度条UI首选项持久化到数据库。
TriggerServerEvent('Agency:Progressbar:SaveSettings', {
position = 'top-right',
color = '#00aaff',
scale = 1.2
})agency-progressbar:server:start在目标(或自身)上启动进度条的 server 端触发器。
查看示例
服务器端触发器,在目标上启动6秒的木箱装载条。
RegisterCommand('movecrate', function(source)
TriggerEvent('agency-progressbar:server:start', source, {
label = 'Loading crate onto truck',
duration = 6000
})
end, false)agency-progressbar:server:stop在目标(或自身)上停止进度条的 server 端触发器。
查看示例
服务器端触发器,以取消状态停止目标的进度条。
RegisterNetEvent('admin:abortJob', function(targetId)
TriggerEvent('agency-progressbar:server:stop', targetId, false)
end)agency:reload:request在向请求玩家授予重新装填之前验证弹药/武器/物品。
查看示例
请求服务器验证弹药并授权手枪重新装填。
TriggerServerEvent('agency:reload:request', 'WEAPON_PISTOL', 'ammo-9')agency:consumables:apply验证 inventory,移除一个物品并应用饥饿/口渴增益。
查看示例
请求服务器移除食物物品并应用饥饿值增加。
RegisterNetEvent('food:onEatStart', function(itemName)
TriggerServerEvent('agency:consumables:apply', itemName)
end)14Agency-Notify
具有V1/V2样式、AgencyAI智能优先级、垃圾信息防护和数据库持久化的通知系统。
用统一外观替换服务器上所有其他通知资源(qb-notify、esx_notify、mythic_notify、okok-notify等)。AgencyAI优先级系统会自动限速垃圾通知。
客户端导出
Notify(data: { title, text, type, duration, ... })显示一条通知。接受 { type, title, text, duration, icon, color }。
查看示例
发送一个6秒的成功通知,宣布抢劫目标。
exports['Agency-Notify']:Notify({
title = 'Bank Heist',
text = 'Vault drilled, grab the loot!',
type = 'success',
duration = 6000
})事件
Agency:Notify:Send与export相同, 让您使用传统的基于Trigger的模式。
查看示例
显示与导出相同负载的旧版v1客户端事件。
TriggerEvent('Agency:Notify:Send', {
title = 'Old Notify',
text = 'Legacy v1 entry point still works',
type = 'info'
})Agency:Notify:LoadSettings应用 server 上每位玩家保存的 UI 设置(位置、颜色、缩放、样式)。
查看示例
在出生时加载每个玩家保存的notify UI设置。
AddEventHandler('playerSpawned', function()
TriggerEvent('Agency:Notify:LoadSettings')
end)Agency:Notify:SaveSettings验证并保存玩家的 notify 设置(位置、强调色、缩放、样式)。
查看示例
将玩家的notify位置、强调色和缩放比例持久化到数据库。
TriggerServerEvent('Agency:Notify:SaveSettings', {
position = 'top-right',
accent = '#ff8800',
scale = 1.1,
style = 'modern'
})15Agency-Seatbelt
具有弹出物理、3D音效、多乘员支持和HUD集成的安全带。
将状态接入您自己的HUD,或在警察追击/抢劫逃跑开始时强制启用。force-enable/disable导出非常适合RP场景。
客户端导出
enableSeatbelt()强制系上安全带(例如用于警察逮捕时)。
查看示例
为本地玩家系上安全带,带HUD和声音反馈。
RegisterNetEvent('vehicle:autoBuckle', function()
if IsPedInAnyVehicle(PlayerPedId(), false) then
exports['Agency-Seatbelt']:enableSeatbelt()
end
end)disableSeatbelt()强制解开安全带(过场动画、RP场景)。
查看示例
玩家离开车辆时解开本地玩家的安全带。
RegisterNetEvent('vehicle:onExit', function()
exports['Agency-Seatbelt']:disableSeatbelt()
end)toggleSeatbelt()切换安全带(默认按键绑定的功能)。
查看示例
按键时切换本地玩家的安全带状态。
RegisterKeyMapping('+seatbelt', 'Toggle seatbelt', 'keyboard', 'B')
RegisterCommand('+seatbelt', function()
exports['Agency-Seatbelt']:toggleSeatbelt()
end)isSeatbeltOn()如果玩家当前系着安全带则返回true。
查看示例
系上安全带时禁用下车控制。
if exports['Agency-Seatbelt']:isSeatbeltOn() then
DisableControlAction(0, 75, true)
end16Agency-Elevator
具有Liquid Glass UI和配置器的逼真电梯系统。
非常适合公寓/住宅脚本、警察总部、医院或任何多层室内场景。使用配置器以可视化方式放置电梯,无需触碰配置文件。
事件
Agency-Elevator:server:requestTravel经服务器验证的楼层间移动请求。
查看示例
请求服务器验证访问权限然后前往电梯的3楼。
TriggerServerEvent('Agency-Elevator:server:requestTravel', 'lspd-tower-1', 3)Agency-Elevator:server:travelComplete确认 client 到达并推送'已到达楼层'通知。
查看示例
告诉服务器玩家已到达3楼以推送到达通知。
TriggerServerEvent('Agency-Elevator:server:travelComplete', 'lspd-tower-1', 3)Agency-Elevator:server:requestElevators将从数据库加载的电梯列表同步到请求的 client。
查看示例
在客户端初始化时从服务器请求完整的电梯列表。
AddEventHandler('onClientResourceStart', function(res)
if res == GetCurrentResourceName() then
TriggerServerEvent('Agency-Elevator:server:requestElevators')
end
end)Agency-Elevator:server:saveElevator对电梯(id/label/floors)进行权限检查后 upsert 到 MySQL。
查看示例
管理员upsert一个带单个Lobby楼层条目的电梯。
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从数据库生成/加载已保存的电梯。
查看示例
将单个电梯的数据加载到配置器NUI中进行编辑。
TriggerServerEvent('Agency-Elevator:server:loadElevator', 'lspd-tower-1')Agency-Elevator:server:saveSettings将 UI 设置(位置/缩放/强调色)持久化到 MySQL 并重新同步所有 client。
查看示例
保存电梯UI位置、强调色和缩放,并重新同步所有客户端。
TriggerServerEvent('Agency-Elevator:server:saveSettings', {
position = 'top-right',
accent = '#22c55e',
scale = 1.0
})Agency-Elevator:client:startTravel为玩家启动电梯运行的过场动画。
查看示例
播放淡入淡出和动画,然后将ped传送到车库的2楼。
TriggerEvent('Agency-Elevator:client:startTravel', 'parking-garage', 2)Agency-Elevator:client:applySettings将 UI 设置(强调色/缩放/位置)推送到 NUI。
查看示例
在本地客户端应用电梯NUI的强调色、缩放和位置。
TriggerEvent('Agency-Elevator:client:applySettings', {
accent = '#0ea5e9',
scale = 0.9,
position = 'bottom-left'
})Agency-Elevator:client:openConfigurator打开游戏内电梯配置器(仅限管理员)。
查看示例
打开带有当前电梯列表的管理员配置器NUI。
TriggerEvent('Agency-Elevator:client:openConfigurator')Agency-Elevator:client:refreshConfigurator在保存/删除后刷新打开的配置器而不关闭它。
查看示例
保存后刷新打开的配置器NUI而不关闭它。
AddEventHandler('Agency-Elevator:server:elevatorSaved', function()
TriggerEvent('Agency-Elevator:client:refreshConfigurator')
end)17Agency-Housing
Database driven housing system for FiveM with auto-detection for ESX, QBCore and QBox. Houses are created in-game through a liquid-glass creator UI instead of a config file: place the entrance where you stand, mark the property border from the air, pick one of 18 shells or record a custom interior. Buy and sell with configurable refunds and a per-player limit, hand keys to other players, furnish the whole plot with up to 60 props, and lock real MLO doors. Property borders run on PolyZone, everything persists in MySQL.
客户端导出
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.
服务端导出
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.
事件
agency-housing:client:enteredZoneFires with (houseId, house) when the player steps onto a property, so a job or robbery script does not have to poll.
agency-housing:client:leftZoneFires with (houseId, house) when the player leaves a property.
看完本页仍未解决?接下来由我们的支持团队接手。