Concommand Helpers

Server-side compliment of the shared commands.lua

Summary
Concommand HelpersServer-side compliment of the shared commands.lua
Tables
sayCmdsThis table holds our say commands.
Functions
sayCmdCheckSay callback which will check to see if there’s a say command being used.
addSayCommandJust like ULib’s <concommand()> except that the callback is called when the command is said in chat instead of typed in the console.
removeSayCommandRemoves a say command.

Tables

sayCmds

This table holds our say commands.

Functions

sayCmdCheck

local function sayCmdCheck(ply,
strText,
bTeam)

Say callback which will check to see if there’s a say command being used.  DO NOT CALL DIRECTLY

Parameters

plyThe player.
strTextThe text.
bTeamTeam say.

Revisions

v2.10Made case-insensitive

addSayCommand

function ULib.addSayCommand(say_cmd,
fn_call,
access,
hide_say,
nospace)

Just like ULib’s <concommand()> except that the callback is called when the command is said in chat instead of typed in the console.

Parameters

say_cmdA command string for says.  IE: “!kick”, then when someone says “!kick”, it’ll call the callback.
fn_callThe function to call when the command’s called.
accessThe access string to associate access with this say command.  (IE: “ulx kick”).  Remember to call <ULib.ucl.registerAccess()> if the access string isn’t being used in a command.
hide_say(Optional, defaults to false) If true, will hide the chat message.  Use this if you don’t want other people to see the command.
nospace(Optional, defaults to false) If true, a space won’t be required after the command “IE: !slapbob” vs “!slap bob”.

Revisions

v2.10Added nospace parameter, made case insensitive
v2.40Removed the command help parameter, now accepts nil as access (for always allowed)

removeSayCommand

function ULib.removeSayCommand(say_cmd)

Removes a say command.

Parameters

say_cmdThe command string for says to remove.
local function sayCmdCheck(ply,
strText,
bTeam)
Say callback which will check to see if there’s a say command being used.
function ULib.addSayCommand(say_cmd,
fn_call,
access,
hide_say,
nospace)
Just like ULib’s concommand() except that the callback is called when the command is said in chat instead of typed in the console.
function ULib.removeSayCommand(say_cmd)
Removes a say command.
Close