Es setinfo

From EventScripts Community Encyclopedia
--> Note: This command has been deprecated as of EventScripts v1.5. It is recommended that you use es_set instead which behaves the same way, with some added bonuses. The legacy es_setinfo command will continue to exist for backwards compatibility.


Overview

Syntax: es_setinfo <variable-name> <value>

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_xsetinfo

Description

Allows you to create server variables that are essential for doing calculations. It can also set the value of existing variables.

Parameters

  • variable-name - the name of the variable to create and/or set
  • value - the value the variable should become


Examples

// creates a server variable and initializes it to "hello"
es_setinfo myvar "hello"
// creates a variable that initializes using the value of 'sv_gravity'
es_setinfo myvar server_var(sv_gravity)
// creates a variable and the adds to it
es_setinfo myvar 0
es_math myvar + 3
es_msg myvar now equals server_var(myvar)


Notes

  • Valve provides a command called setinfo that this command was initially based upon.
  • Used in almost every block load of a script for pre-setting and creating variables.


See also


blog comments powered by Disqus