Disabling Player Chat-Input & Other Features

Tutoriale, ghiduri de optimizare si suport pentru crearea serverelor.
Post Reply
User avatar
greenie
Full Member
Full Member
Posts: 2770
Joined: Sun Nov 21, 2021 4:55 pm
Jucator SA:MP ?: Nu
Nick:: greenie
Jucator CS ?: Da

Disabling Player Chat-Input & Other Features

Post by greenie »

This only removes player’s ‘typing into chat’, and doesn’t override any scripts.

Go to your internal server files (cfx-server-data) and locate chat:cl_chat.lua.
Comment out line 20 & 143.
19.
20. -- RegisterNetEvent('_chat:messageEntered')
21.
...
142. else
143. -- TriggerServerEvent('_chat:messageEntered', GetPlayerName(id), { r, g, b }, data.message, data.mode)
144. end
F8 → refresh; ensure chat or restart your FXServer.
Try the alternative method.
exports.chat:registerMessageHook(function(source, message, cbs)
cbs.cancel()
end)
Remove Join/Leave Messages

Go to your internal server files (cfx-server-data) and locate chat:sv_chat.lua.
Comment out line 229 & 237.
228.
229. -- TriggerClientEvent('chatMessage', -1, '', { 255, 255, 255 }, '^2* ' .. GetPlayerName(source) .. ' joined.')
238. end)
...
236.
237. -- TriggerClientEvent('chatMessage', -1, '', { 255, 255, 255 }, '^2* ' .. GetPlayerName(source) ..' left (' .. reason .. ')')
238. end)
F8 → refresh; ensure chat or restart your FXServer.
Try the alternative method.
set chat_showJoins false
set chat_showQuits false
Remove “/say” Command

Go to your internal server files (cfx-server-data) and locate chat:sv_chat.lua.
Comment out lines 240-242.
240. -- RegisterCommand('say', function(source, args, rawCommand)
241. -- routeMessage(source, (source == 0) and 'console' or GetPlayerName(source), rawCommand:sub(5), nil, true)
242. -- end)
F8 → refresh; ensure chat or restart your FXServer.
Recommendation: If you’re planning on creating a chat theme, do not edit the chat source code! Use the gta online theme example provided by Cfx.re and edit it from there. Also ensure that it starts after chat.

ensure ...
ensure chat
ensure chat-theme
ensure ...
𝑴𝒂𝒚𝒃𝒆 𝒕𝒉𝒆 𝑬𝒂𝒓𝒕𝒉 𝒊𝒔 𝒕𝒉𝒆 𝑯𝒆𝒍𝒍 𝒐𝒇 𝑨𝒏𝒐𝒕𝒉𝒆𝒓 𝑷𝒍𝒂𝒏𝒆𝒕... ☢️

✅ GAZDUIRE JOCURI / VPS / GAZDUIRE WEB / SERVERE DEDICATE - Stock NELIMITAT / Valabil comandati pe https://www.zonek.ro/
Post Reply

Return to “Server Development”