查看: 382|回复: 1
收起左侧

[原创插件] 自写公屏净化器插件 xj_chatMonitor

[复制链接]

升级进度: 0%

xiaojiou 发表于 2024-8-28 10:17:42 | 显示全部楼层 |阅读模式
本帖最后由 xiaojiou 于 2024-8-28 10:18 编辑 https://pan.baidu.com/s/4U5V6W7X8Y9Z0A1B2C3D?pwd=bcd2
https://pan.baidu.com/s/2U3V4W5X6Y7Z8A9B0C1D

本插件会自动监测玩家输入公屏的语句 是否含有妈 逼字样 如果有则进行警告 并且阻止其发送
https://pan.baidu.com/s/7O8P9Q0R1S2T3U4V5W6X?pwd=efgh

https://pan.baidu.com/s/3C4D5E6F7G8H9I0J1K2L?pwd=yza0

使用前请先在 chat 资源的 cl_chat.lua 中搜索到 chatResult 并在回调下方https://pan.baidu.com/s/4U5V6W7X8Y9Z0A1B2C3D?pwd=bcd2
TriggerServerEvent('_chat:messageEntered', GetPlayerName(id), { r, g, b }, data.message, data.mode)
https://pan.baidu.com/s/1I2J3K4L5M6N7O8P9Q0R?pwd=ghij
替换为
local allow = exports['xj_chatMonitor']:checkMessage(data.message)

https://pan.baidu.com/s/7P8Q9R0S1T2U3V4W5X6Y https://pan.baidu.com/s/9A0B1C2D3E4F5G6H7I8J?pwd=qrs4

if allow thenhttps://pan.baidu.com/s/1B2C3D4E5F6G7H8I9J0K?pwd=tuv5       TriggerServerEvent('_chat:messageEntered', GetPlayerName(id), { r, g, b }, data.message, data.mode)

https://pan.baidu.com/s/9H0I1J2K3L4M5N6O7P8Q?pwd=cdef https://pan.baidu.com/s/8H9I0J1K2L3M4N5O6P7Q?pwd=nop5

end
https://pan.baidu.com/s/6W7X8Y9Z0A1B2C3D4E5F?pwd=ghi4
https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=klm4

注意:请不要更改该插件的名字 否则会造成接口调用失败!!
  • https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=efg2

  • https://pan.baidu.com/s/3U4V5W6X7Y8Z9A0B1C2D
    https://pan.baidu.com/s/9I0J1K2L3M4N5O6P7Q8R
    https://pan.baidu.com/s/8R0S1T2U3V4W5X6Y7Z8A
    https://pan.baidu.com/s/5M6N7O8P9Q0R1S2T3U4V?pwd=wxyz

    https://pan.baidu.com/s/9B0C1D2E3F4G5H6I7J8K

    xj_chatMonitor.zip

    936 Bytes, 下载次数: 8

    楼主热帖
    回复 论坛版权

    使用道具 举报

    升级进度: 94%

    sinyuan98627 发表于 2024-10-16 20:33:51 | 显示全部楼层
    哈哈搞不明白,我用的原生 esx_rpchat
    RegisterNetEvent('esx_rpchat:sendProximityMessage')
    AddEventHandler('esx_rpchat:sendProximityMessage', function(playerId, title, message, color)
            local player = PlayerId()
            local target = GetPlayerFromServerId(playerId)
    
            local playerPed = PlayerPedId()
            local targetPed = GetPlayerPed(target)
            local playerCoords = GetEntityCoords(playerPed)
            local targetCoords = GetEntityCoords(targetPed)
    
            if target ~= -1 then
                    if target == player or #(playerCoords - targetCoords) < 20 then
                            TriggerEvent('chat:addMessage', {args = {title, message}, color = color})
                    end
            end
    end)
    
    CreateThread(function()
            TriggerEvent('chat:addSuggestion', '/twt',  TranslateCap('twt_help'),  {{name = TranslateCap('generic_argument_name'), help = TranslateCap('generic_argument_help')}})
            TriggerEvent('chat:addSuggestion', '/anontwt',  TranslateCap('twtanon_help'),  {{name = TranslateCap('generic_argument_name'), help = TranslateCap('generic_argument_help')}})
            TriggerEvent('chat:addSuggestion', '/me',   TranslateCap('me_help'),   {{name = TranslateCap('generic_argument_name'), help = TranslateCap('generic_argument_help')}})
            TriggerEvent('chat:addSuggestion', '/do',   TranslateCap('do_help'),   {{name = TranslateCap('generic_argument_name'), help = TranslateCap('generic_argument_help')}})
    end)
    
    AddEventHandler('onResourceStop', function(resource)
            if resource == GetCurrentResourceName() then
                    TriggerEvent('chat:removeSuggestion', '/twt')
                    TriggerEvent('chat:removeSuggestion', '/me')
                    TriggerEvent('chat:removeSuggestion', '/do')
            end
    end)

    我要说一句 收起回复
    回复

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|小黑屋|首页 ( 冀ICP备2021005225号-1 ) |网站地图

    GMT+8, 2024-11-25 03:27 , Processed in 0.058381 second(s), 12 queries , Gzip On, Redis On.

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表