Deactivate chat hide

Hey guys,

can someone explain to me, how i can deactivate the hide function from the standard chat box?
I ask because it has the same key (L) how my carlock system and i can’t change the key :confused:
I’ve upload you a video where you can see what i mean.

Best regards
FabiZockt96

1 Like

In your GTA game, go to Settings > Key Bindings > FiveM > “(chat) Toggle Chat”.

1 Like

Thanks :slight_smile:

How can I edit it in the script? So that all other players on the server can no longer use the chat toggle (Hide/When Active/Visible).

2 Likes

Did you figure this out? Im looking to.

Hi there, this is a really simple fix and I’ll go over how to do it:

  1. Go to citizen > system_resources > chat > cl_chat.lua

  2. Go to line 238 where you will see this:

local CHAT_HIDE_STATES = {
  SHOW_WHEN_ACTIVE = 0,
  ALWAYS_SHOW = 1,
  ALWAYS_HIDE = 2
}

local kvpEntry = GetResourceKvpString('hideState')
local chatHideState = kvpEntry and tonumber(kvpEntry) or CHAT_HIDE_STATES.SHOW_WHEN_ACTIVE
local isFirstHide = true
if RegisterKeyMapping then
	RegisterKeyMapping('toggleChat', 'Toggle chat', 'keyboard', 'l')
end

RegisterCommand('toggleChat', function(source, args, rawCommand)
  if not args[1] then
    if chatHideState == CHAT_HIDE_STATES.SHOW_WHEN_ACTIVE then
      chatHideState = CHAT_HIDE_STATES.ALWAYS_SHOW
    elseif chatHideState == CHAT_HIDE_STATES.ALWAYS_SHOW then
      chatHideState = CHAT_HIDE_STATES.ALWAYS_HIDE
    elseif chatHideState == CHAT_HIDE_STATES.ALWAYS_HIDE then
      chatHideState = CHAT_HIDE_STATES.SHOW_WHEN_ACTIVE
    end
  else
    if args[1] == "visible" then
      chatHideState = CHAT_HIDE_STATES.ALWAYS_SHOW
    elseif args[1] == "hidden" then
      chatHideState = CHAT_HIDE_STATES.ALWAYS_HIDE
    elseif args[1] == "whenactive" then
      chatHideState = CHAT_HIDE_STATES.SHOW_WHEN_ACTIVE
    end
  end
  isFirstHide = false
  SetResourceKvp('hideState', tostring(chatHideState))
end, false)
  1. Replace it with this:
local CHAT_HIDE_STATES = {
  SHOW_WHEN_ACTIVE = 0,
  ALWAYS_SHOW = 1,
  ALWAYS_HIDE = 2
}

local chatHideState = 0
local isFirstHide = true

That will cause your chat to be hidden when not in use and not require players to unbind the command. If you want to set it be permanently shown, just change chatHideState to 1 instead of 0.

This should fix this, but let me know if you’re having trouble. Cheers!