Es format
From EventScripts Community Encyclopedia
|
OverviewSyntax: 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: {{{x}}} DescriptionFormats a string according to the format-string and stores it into the variable command. Parameters
Exampleses_xsetinfo myvar 0 es_xsetinfo param1 "is" es_xsetinfo param2 "string" es_xsetinfo param3 "results from placing" es_xsetinfo param4 "the format-string." es_format myvar "This %1 the %2 that %3 the tokens into %4" server_var(param1) server_var(param2) server_var(param3) server_var(param4) es_msg server_var(myvar) //will display: This is the string that results from placing the tokens into the format-string.
Notes
es_xsetinfo var1 "ro" es_xsetinfo var2 "fl" es_xsetinfo format 0 es_format format "%1%2" server_var(var1) server_var(var2) es_msg server_var(format) // Will display: rofl
es_xsetinfo string "hello" es_xsetinfo word1 "world" es_format string "%1 %2" server_var(string) server_var(word1) es_msg server_var(string) // Will display: "Hello World"
See also
External linkses_xformat
|
