Chat Commands

[release]Chat Commands

Browsing the Requests section and seeing many requests related to chat commands, I made this. This is (as far as I know) the only public chat command solution that includes proper quote parsing (similar to Source console).
Distributed as an easy to use Lua module and can be used exactly like concommands.

http://www.garrysmod.org/img/?t=dll&id=96795

Example:
[lua]require( “chatcommand” )

local function PrintToChat( ply, cmd, args )
ply:ChatPrint( table.concat( args, ", " ) )
end

chatcommand.Add( “chatprint”, PrintToChat )
concommand.Add( “chatprint”, PrintToChat )[/lua]

Notes:
[ul]
[li]Server-side only.
[/li][li]Prefixes are / for private (doesn’t print anything) and ! for public. These can be changed with chatcommand.PrefixPrivate and PrefixPublic.
[/li][li]By default this doesn’t block any other types of chat commands, but you can change that with chatcommand.Blocking.
[/li][li]You can also change the settings by editing the Lua script.
[/li][/ul]

Installation:
[ul]
[li]Extract to garrysmod/
[/li][/ul]

Credits:
[ul]
[li]Lexi for pattern to parse quotes
[/li][/ul]
[/release]

Useful if you need it :slight_smile:

Really useful, will probably use in something.

Very useful.

Why not add concommand.Add in the Add function?

Useful anyhow.

To make it optional. Not everyone wants a concommand too.

Another great release, Polly. You just saved me a LOT of time.

Made something like this already, just didn’t release it.

Nevertheless, useful’d. :3:

I read this, chatcommand.Add, and my idea was basically ruined.

This looks good though :smiley:

That’s probably one of the dumbest comments I have ever read.

ERROR! Module ‘chatcommand’ not found!

why do i get this error?

Did you install the module?

Yes, i’m pretty sure the module is installed correctly.

Nope, not if you’re getting that error.

lua/includes/modules

I checked, the file is located in that directory.

I’m telling you, if you’re getting that error it isn’t there.

You can get that error if it is there too. If the module cat be loaded because your on the wrong OS , or it’s 64 bit etc. Maybe he doesn’t have the runtimes for the dll.

Check before posting, it’s a Lua module.

You have a valid point. When I think module, I think dll / so. Heh…

Am i supposed to run require( “chatcommand” ) serverside? If yes, how do i do that?