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_cmd | A command string for says. IE: “!kick”, then when someone says “!kick”, it’ll call the callback. |
fn_call | The function to call when the command’s called. |
access | The 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.10 | Added nospace parameter, made case insensitive |
v2.40 | Removed the command help parameter, now accepts nil as access (for always allowed) |