Es regsaycmd

From EventScripts Community Encyclopedia


Overview

Syntax: es_regsaycmd <command> <script>/<block> "<description>"

Note: Command parameters are described inside the < and > characters. Optional parameters are contained within [ and ] characters.

Variation of this command that doesn't expand variables: es_xregsaycmd

Description

Registers a say command that will initiate the specified block of code upon use, passing its parameters. The command will not be displayed via say/say_team

Parameters

  • command - Name of the say command you want to create on the server-side console.
  • script - Name of the script that you want to initiate the block inside of.
  • block - Name of the block that you want to initiate.
  • description - A short description of what the command does.


Examples

block load
{
   es_regsaycmd test script/test "test command"
}
 
block test
{
   es_msg This command was run!
}

This will initiate the block test whenever the command test is run. So if I were to say:

test arg1 arg2 arg3

It would then message "This command was run!"


Notes

  • Once a command is registered, es_regsaycmd could fail on a subsequent attempt. Overwriting is currently not supported. You can use es_exists to test for existence (to avoid an error message in the console trying to reregister).


See also

blog comments powered by Disqus