FAXES
1
Created by: FAXES
Hello, guys, I’m back with another script. This is a very simple script but I hope it can help you out
. This script deletes any misspelled or unknown commands from displaying in chat like:
to displaying nothing. All commands will still work if executed, this is to remove the /help’s when there’s a full server or something similar.
This was kind of requested here
Download:
If you have any issues or comments please put them below 
12 Likes
I would recommend using RegisterCommand(‘cmd’, function() for commands, it fixes all these issues.
3 Likes
FAXES
3
Yes totally agree, but its also good for servers that don’t have a /help but people always spam /help when it does not exist…
1 Like
@FAXES I believe this release performs it’s function and purpose perfectly.
+1
2 Likes
You can just edit the chat script. But I guess this script would be convienent for NOOBS.
2 Likes
Havoc
7
AddEventHandler('chatMessage', function(Source, Name, Msg)
args = stringsplit(Msg, " ")
CancelEvent()
if string.find(args[1], "/") then
local cmd = args[1]
table.remove(args, 1)
end
end)
wtf am I reading? Why split the string? Why cancel the event without checking if it starts with a “/” (wouldn’'t this stop all messages)? Why are you storing the first argument in a variable which is never used? Why are you removing the first argument?
2 Likes
Yuke
8
thank you for the wonderful script FAXES props to you for helping me and my community out
1 Like
I was about to write the same, this script seems to be pure nonsense…
It will cancel every message
FAXES
11
It only removes commands. Not everything
1 Like
@FAXES
It does cancel out everything. I tried it on my server, but people could no longer use the chat, unless using an actual working command (/ooc, /me, /say etc.).
1 Like
FAXES
13
Thanks for the report I’ll have a look into it…
1 Like
Great!
Since you are looking into it anyways, could you also add a little error message when someone types an unknown/mis-spelled command? Something like: “Unknown command. Are you sure you typed the command correctly?”.
Maybe an extra challenge, for you, or someone else, maybe have a feature/resource which would ‘disable capitalization on commands’. So let’s say a player types /RESPAWN instead of /respawn, and that the command will still work. (sorry if there is already a resource out there for this, couldn’t find it.)
FAXES
15
Well for the capitalisation you can do that in a script already by using the RegisterCommand function. To memory this will send the command as a lowercase it this is used for each command.
For the error message I’ll look into that.
2 Likes
Appreciate the quick fix @FAXES 
Totally forgot about the RegisterCommand function, thanks 
1 Like
Just when I thought it was working the way it should, it doesn’t unfortunately.
When I use the Chat Roles plugin by JayJay ([Release] Chat Roles [UPDATED 5/30/18] [Tutorial Released]) your resource will duplicate the messages.
Here a screenshot:

FAXES
19
I think the roles resource has the hide commands within it.
2 Likes
If anyone is having this issue, using the police script rank titles, I removed these lines
else
TriggerClientEvent('chatMessage', -1, Name, { 255, 255, 255 }, Msg)
end
Line 8, 9 and 10 sv_cmd.lua
Works for me on my server.