If you take that out then regular text will not work. The chat roles resource already has a hide commands feature and also does exactly what this script does.
I was only using titles with the police script and it was causing dupe texts, removed that line no dupe text and commands are blocked, so, if it works it works!
ALSO, edited my original post to be more clear on that
i dont know if its my server being bugged but it is not allowing me to type in server chat unless im using a command like /me or /ooc @FAXES
Yes, normal text did not enter. I fixed this bug in 1.1. try updating it to 1.1
fixed it ((20 chars))
cant erase that last end and it works fine thanks
This resource is not working. It shows all Commands to any user
If installed correctly it will work
it dont work and i almost sure i have install it correctly
It works. Reinstall it make sure there’s no conflicts
I have reinstalled it several times - this is the sv_cmd https://gyazo.com/d7a1337aecb31f8fde544d88f2de6f7f - and this is the resource https://gyazo.com/3a9cca1027cac3ea55fdfce22ce90577
You might have a conflict.
@FAXES How do i make it so only commands can go in, i only want people using commands no non command chat
Take out the chat relay / event.
chatInputActive = false
SetNuiFocus(false)
if not data.canceled then
local id = PlayerId()
--deprecated
local r, g, b = 0, 0x99, 255
if data.message:sub(1, 1) == '/' then
ExecuteCommand(data.message:sub(2))
else
TriggerServerEvent('_chat:messageEntered', GetPlayerName(id), { r, g, b }, data.message)
end
end
cb('ok')
end)
RegisterNUICallback('loaded', function(data, cb)
TriggerServerEvent('chat:init');
cb('ok')
end)
Citizen.CreateThread(function()
SetTextChatEnabled(false)
SetNuiFocus(false)
while true do
Wait(0)
if not chatInputActive then
if IsControlPressed(0, 245) --[[ INPUT_MP_TEXT_CHAT_ALL ]] then
chatInputActive = true
chatInputActivating = true
SendNUIMessage({
type = 'ON_OPEN'
})
end
end
if chatInputActivating then
if not IsControlPressed(0, 245) then
SetNuiFocus(true)
chatInputActivating = false
end
end
end
end)
What part should i remove?
That is the chat resource, don’t edit that. Unless you know what your doing.
Do something like:
AddEventHandler('chatMessage', function(Source, Name, Msg)
args = stringsplit(Msg, " ")
CancelEvent()
if string.find(args[1], "/") then
local cmd = args[1]
table.remove(args, 1)
else
-- Do nothing
end
end)
In my script. That might do it untested, report back!
A quick question: Do you know how to hide commands, like if i do “/ao” It will come up underneath it sort of, auto completing the word so it will say “/aop” underneath.So having passwords on commands is totally useless
Like this:
Those are chat suggestions forund in the chat resource
Would you be able to help me get rid of the suggestions?