Texthandler

From EventScripts Community Encyclopedia
--> Note: This command has been deprecated. It will be replaced by a new command name that provides the same functionality in a coming version. Please use at your own risk.


Contents

Overview

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

Description

Handles custom string resources and colour management.

by Wonder


Note: It doesn't expand server variables. Prefix the command with es to expand variables (es texthandler).

Parameters

  • command - To create a new string resource:
texthandler create <resource>

To delete a string resource:

texthandler delete <resource>

To create a new string inside a resource:

texthandler set <resource> <string> <value>

To get a string from inside a resource:

texthandler get <var> <resource> <string>

<userComments></userComments>

Examples

block load 
{ 
 // Create a new string resource for our mod.
 texthandler create testtexts_loaded
 
 // Create a string to hold the loaded text in english.
 texthandler set testtexts_loaded english "#lightgreen[#greenModHere#lightgreen]#green has been loaded!"
 
 // ... in french.
 texthandler set testtexts_loaded french "#lightgreen[#greenModHere#lightgreen]#green a ete charge!"
 
 // ... in german.
 texthandler set testtexts_loaded german "#lightgreen[#greenModHere#lightgreen]#green ist geladen worden!"
 
 // ... in spanish.
 texthandler set testtexts_loaded spanish "#lightgreen[#greenModHere#lightgreen]#green se ha cargado!" 
 
 es_xsetinfo text 0 
 
 // Lets get the loaded text in english.
 es texthandler get text testtexts_loaded english
 
 // (In Counter-Strike: Source) text == #lightgreen[#greenModHere#lightgreen]#green has been loaded!
 // (Not in Counter-Strike: Source) text == [ModHere] has been loaded!
 
 // Lets print the text.
 es_msg #multi server_var(text)
}

Notes

  • texthandler will strip colour tokens when the game is not Counter-Strike: Source.

See Also

blog comments powered by Disqus