Remove "player joined" from chat

Hey! I’m looking for a script/where you can disable the popup from where a player joins or leaves your server.

I’m also searching for how to disable the chat completely, and only making it possible for the players to write for an example - /discord and the discord link will show up or putting in a /buttons for showing where the emote menu is or the job menu is.

I’m bored in Law :confused:

So in the server Lua for your chat, remove the lines where it says that someone has joined.

Now Ima try something, I’m in class so Im gonna make this real quick, if It doesn’t work ill have another look when I actually have a spare 5 Minutes xD


AddEventHandler("chatMessage", function(source, name, message)
	if message == "/discord" then
		TriggerClientEvent("chatMessage", source, "Discord", {255, 255, 255}, "(Discord Link)")
	end
end)

Not too sure what you mean by this:

But I assume a sort of help command sorta thing? I’m just going of what I think you mean, but, I’m an idiot so I’m probably wrong! Anyway:

AddEventHandler("chatMessage", function(source, name, message)
	if message == "/buttons" then
		TriggerClientEvent("chatMessage", source, "Buttons/Help", {255, 255, 255}, "Put info here?!")
	end
end)
1 Like

I fixed the “player joins” thing but the /discord wont work

Okay hang on lemme try this :confused:

AddEventHandler("chatMessage", function(source)
	if message == "/discord" then
		TriggerClientEvent("chatMessage", source, "Discord", {255, 255, 255}, "(Discord Link)")
	end
end)

Try that

“No such Command”

I can send you my code so you can edit it.

RegisterServerEvent('chat:init')
RegisterServerEvent('chat:addTemplate')
RegisterServerEvent('chat:addMessage')
RegisterServerEvent('chat:addSuggestion')
RegisterServerEvent('chat:removeSuggestion')
RegisterServerEvent('_chat:messageEntered')
RegisterServerEvent('chat:clear')
RegisterServerEvent('__cfx_internal:commandFallback')

AddEventHandler("chatMessage", function(source)
	if message == "/discord" then
		TriggerClientEvent("chatMessage", source, "Discord", {255, 0, 0}, "(https://discord.gg/Qjfds7x")
	end
end)


    TriggerEvent('chatMessage', source, author, message)

    if not WasEventCanceled() then
        TriggerClientEvent('chatMessage', -1, author,  { 255, 255, 255 }, message)
    end

    print(author .. ': ' .. message)
end)

AddEventHandler('__cfx_internal:commandFallback', function(command)
    local name = GetPlayerName(source)

    TriggerEvent('chatMessage', source, name, '/' .. command)

    if not WasEventCanceled() then
        TriggerClientEvent('chatMessage', -1, name, { 255, 255, 255 }, '/' .. command) 
    end

    CancelEvent()
end)



RegisterCommand('say', function(source, args, rawCommand)
    TriggerClientEvent('chatMessage', -1, (source == 0) and 'console' or GetPlayerName(source), { 255, 255, 255 }, rawCommand:sub(5))
end)

You don’t add it in chat! Add it into another resource.

Which resource? in the system - chat?

Make a new one buddy

AddEventHandler('chatMessage', function(source, n, msg)
	local Message = string.lower(msg)
	if (Message == '/discord') then --Discord thing
		TriggerClientEvent("chatMessage", source, "Discord", {255, 0, 0}, "(https://discord.gg/Qjfds7x")
	elseif (Message == '/buttons') then --Buttons thing
		--PUT_YOUR_CODE_IN_HERE
	end
	CancelEvent()
end)

can this be changed so it doesnt say “joined” it says something else i ask because i tried and when i used chat it made my player freeze not sure if i did something wrong

Yes you can change. In the TriggerClientEvent, in the end it says “joined or left” just change it to whatever you want :slight_smile:

1 Like

how can I change it not removed, I want to change it to SERVER: Name has entered the city.

Anyone know how to change the green “*playername joined.” when everyone joins to something more like (red) SERVER: playername/character name has entered the city."

If you use lambda just turn it off in the menu settings