Agency Docs
QBESXStandalone

Agency-Chat 导出 & API

为您的 FiveM 服务器打造的 Agency 设计风格聊天框,外观与 Agency Notify 和 Agency Progressbar 保持一致。Agency Chat 仅需一步即可替换默认 cfx.

v1.2.0付费5 页面

01客户端导出

导出说明
exports.chat:addMessage(message)Adds a message to the own chat, same table as chat:addMessage (args, color, template). Optional agency = { tag, tone } gives it the Agency tag look.
exports.chat:addSuggestion(name, help, params)Adds a command suggestion with help text and parameters, same as chat:addSuggestion.
exports.chat:isOpen()true while the chat input is open.

02服务端导出

导出说明
exports.chat:addMessage(target, message)Sends a message to one player (-1 for everyone), same table as chat:addMessage.
exports.chat:registerMessageHook(function(source, outMessage, hookRef) end)Sees and changes every typed message before it goes out, like the default chat. hookRef.cancel() stops it.
exports.chat:registerMode({ name, displayName, color, seObject, cb })Adds a chat mode players switch to with Tab, like the default chat.

03事件

名称端说明
chat:addMessage客户端Default chat event, works unchanged. TriggerClientEvent('chat:addMessage', source, { args = { 'SYSTEM', 'Hello' } }).
chatMessage客户端Old default chat event (author, color, text), works unchanged.
chat:addSuggestion客户端Default event for one command suggestion. chat:addSuggestions and chat:removeSuggestion work as well.
chat:addTemplate客户端Default event for message templates, works unchanged.
chat:addMode / chat:removeMode客户端Default events for chat modes, work unchanged.
chat:clear客户端Clears the chat of this player.

看完本页仍未解决?接下来由我们的支持团队接手。