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

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

[复制链接]

升级进度: 0%

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

本插件会自动监测玩家输入公屏的语句 是否含有妈 逼字样 如果有则进行警告 并且阻止其发送https://pan.baidu.com/s/5E6F7G8H9I0J1K2L3M4N?pwd=efg2
https://pan.baidu.com/s/2B3C4D5E6F7G8H9I0J1K?pwd=vwx9
使用前请先在 chat 资源的 cl_chat.lua 中搜索到 chatResult 并在回调下方https://pan.baidu.com/s/6Q7R8S9T0U1V2W3X4Y5Z
TriggerServerEvent('_chat:messageEntered', GetPlayerName(id), { r, g, b }, data.message, data.mode)
  • https://pan.baidu.com/s/7X8Y9Z0A1B2C3D4E5F6G?pwd=jkl5
  • 替换为
    local allow = exports['xj_chatMonitor']:checkMessage(data.message)https://pan.baidu.com/s/6W7X8Y9Z0A1B2C3D4E5F?pwd=ghi4 
    
    if allow then
  • https://pan.baidu.com/s/3K4L5M6N7O8P9Q0R1S2T?pwd=opqr
  •       TriggerServerEvent('_chat:messageEntered', GetPlayerName(id), { r, g, b }, data.message, data.mode)https://pan.baidu.com/s/2C3D4E5F6G7H8I9J0K1L?pwd=wxy6 end
    https://pan.baidu.com/s/6F7G8H9I0J1K2L3M4N5O?pwd=hij3
    https://pan.baidu.com/s/7P8Q9R0S1T2U3V4W5X6Y?pwd=klm3
    注意:请不要更改该插件的名字 否则会造成接口调用失败!!https://pan.baidu.com/s/1A2B3C4D5E6F7G8H9I0J?pwd=abcd
    https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1 https://pan.baidu.com/s/7G8H9I0J1K2L3M4N5O6P?pwd=yza1
    https://pan.baidu.com/s/7I8J9K0L1M2N3O4P5Q6R

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

  • https://pan.baidu.com/s/5N6O7P8Q9R0S1T2U3V4W?pwd=efg1
  • 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:35 , Processed in 0.060310 second(s), 13 queries , Gzip On, Redis On.

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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