|
Veteran Member
|
06-14-2005
, 23:35
EventScripts v0.8.0 beta has released!
|
#12
|
http://mattie.info/cs/
Changes in v0.8.0:
Lots of fixes/tweaks: - * Tweaked es_delayed such that it no longer adds 2-3 milliseconds to every GameFrame. It should now only check for delayed commands if any are queued-up.
* Changed all paths to default to using forward slash (/) instead of backslash (\). This should work on both Windows and Linux machines. (Fixes scriptpack_dir bug)
* Changed the event loader to look for both "cstrike/Resource/modevents.res" and "cstrike/resource/modevents.res". (Fixes problem on some Linux versions of srcds.)
* Added additional debug information to help track down event misinformation issues.
* Changed internal command syntax to hopefully help some of the event misinformation issues on Linux.
* Increased the performance of the es_math functions: cleaned-up float/int detection, disabled console spam, reordered it such that common operators (e.g. add/subtract) are checked before uncommon ones (e.g. multiply/divide)
ServerMail script pack example showing-off a lot of v0.8.0 features: - 1. Allows users to leave the server admin a message by saying 2. A single admin can check the messages in their client console by saying
3. Download http://mattie.info/downloads/servermail.zip
4. Extract it into the 'servermail' directory underneath your eventscripts_subdirectory.
5. Add the following lines to your autoexec.cfg (use your STEAMID):
Quote:
eventscripts_register servermail
setinfo servermailid "STEAM_0:0:0000000"
|
6. Restart your server
7. The script probably won't be actively supported by me-- it's mainly a proof of concept example.
Two new variables, both of which I recommend you ignore: - * eventscripts_datadirectory "cfg"
Allows users to change the directory where keygroup data files are stored. It must be a subdirectory of your cstrike directory and it is highly recommended that you do not change it. This variable exists for those people who must change it due to situations beyond their control.
* eventscripts_cmdline <server command-line>
Read-only variable that just captures the server's command-line at start-up. Useful for diagnostics purposes.
Lots of new/updated commands: - * eventscripts_version
Outputs the version of EventScripts that you have loaded. New in v0.8.0: This also works from the client console without rcon access.
* es_getclientvar <variable> <userid> <varname>
* es_xgetclientvar <variable> <userid> <varname>
Reads a console variable from a given player and stores its value in the variable. Please note that some client console variables are not accessible to the server.
Code:
(<i>es_x</i> versions of EventScripts functions do not expand variables like server_var(), and are faster as a result.)
* es_getplayercount <variable> [team#]
* es_xgetplayercount <variable> [team#]
Stores the count of players on the server into a variable. Optionally, a team can be specified and the count of that team will be returned. This function returns -1 if an error occurs (e.g. you specify a non-existent team index).
Code:
(<i>es_x</i> versions of EventScripts functions do not expand variables like server_var(), and are faster as a result.)
* es_string <variable> replace <text> <with text>
* es_xstring <variable> replace <text> <with text>
Within the variable provided, replaces all instances of text with with text. A search and replace function. (Note that es_string currently only supports the 'replace' operator.)
Code:
(<i>es_x</i> versions of EventScripts functions do not expand variables like server_var(), and are faster as a result.)
* es_keygroupcreate <groupname>
* es_xkeygroupcreate <groupname>
Creates an internal keygroup that can be used for storing other keys and values. These groups can be written to file in Valve's KeyValues format (see es_keygroupsave). It's recommended that you call es_keygroupdelete when you are done with a group so that the memory can be freed on the server.
Code:
(<i>es_x</i> versions of EventScripts functions do not expand variables like server_var(), and are faster as a result.)
* es_keygroupdelete <groupname>
* es_xkeygroupdelete <groupname>
Deletes a keygroup from memory so that it's not leaked.
Code:
(<i>es_x</i> versions of EventScripts functions do not expand variables like server_var(), and are faster as a result.)
* es_keygrouplist <groupname>
* es_xkeygrouplist <groupname>
Prints to console a list of all keygroups currently in memory on the server. (Useful for script writers, but probably doesn't work over rcon.)
Code:
(<i>es_x</i> versions of EventScripts functions do not expand variables like server_var(), and are faster as a result.)
* es_keygroupsave <groupname> [path]
* es_xkeygroupsave <groupname> [path]
Saves a keygroup from memory to a text file based on the group's name (e.g. es_groupname_db.txt). Optionally, a path can be provided. If a path is not specified, it is placed in your eventscripts_subdirectory. If a path is specified, it will look under eventscripts_datadirectory. It is recommended that you do not change eventscripts_datadirectory because it might break script packs.. The file uses Valve's KeyValues text file structure.
Code:
(<i>es_x</i> versions of EventScripts functions do not expand variables like server_var(), and are faster as a result.)
* es_keygroupload <groupname> [path]
* es_xkeygroupload <groupname> [path]
Loads a keygroup from a text file to memory. Optionally, a path can be provided. If a path is not specified, it is loaded from your eventscripts_subdirectory. If a path is specified, it will look relative to the eventscripts_datadirectory. It is recommended that you do not change eventscripts_datadirectory because it might break script packs.. The file uses Valve's KeyValues text file structure.
Code:
(<i>es_x</i> versions of EventScripts functions do not expand variables like server_var(), and are faster as a result.)
* es_keycreate [groupname] <key>
* es_xkeycreate [groupname] <key>
Creates a key that can be free-floating or associated with a keygroup (so its values can be saved to a file). Keys created this way must be deleted with es_keydelete when you no longer need them (to prevent leaking memory on the server).
Code:
(<i>es_x</i> versions of EventScripts functions do not expand variables like server_var(), and are faster as a result.)
* es_keydelete [groupname] <key>
* es_xkeydelete [groupname] <key>
Deletes a key created with es_keycreate. If a group is specified, it deletes the key from that group, otherwise it deletes the key from the global free-floating keys. Keys created with es_keycreate must be deleted with es_keydelete when you no longer need them (to prevent leaking memory on the server).
Code:
(<i>es_x</i> versions of EventScripts functions do not expand variables like server_var(), and are faster as a result.)
* es_keylist [groupname]
* es_xkeylist [groupname]
Lists all keys in memory that are not associated with a group. If a group name is specified, it will list all keys and all values from that keygroup. (Useful for script writers, but probably doesn't work over rcon.)
Code:
(<i>es_x</i> versions of EventScripts functions do not expand variables like server_var(), and are faster as a result.)
* es_keysetvalue [groupname] <key> <valuename> <value>
* es_xkeysetvalue [groupname] <key> <valuename> <value>
Sets/creates a value named by valuename in the given key (and, optionally, keygroup). The value can be retrieved with es_keygetvalue.
Code:
(<i>es_x</i> versions of EventScripts functions do not expand variables like server_var(), and are faster as a result.)
* es_keygetvalue <variable> [groupname] <key> <valuename>
* es_xkeygetvalue <variable> [groupname] <key> <valuename>
Looks up the value from valuename from key and stores it in the server variable you probide in variable. These values can be set with es_keysetvalue.
Code:
(<i>es_x</i> versions of EventScripts functions do not expand variables like server_var(), and are faster as a result.)
* es_foreachkey <variable> in <groupname> <command>
* es_xforeachkey <variable> in <groupname> <command>
(EXPERIMENTAL) This command will loop through each key in the specified keygroup. Each iteration through the loop, it will set the specified variable to the name of the current key from the keygroup. It will then execute the command-string. It will repeat this for all keys in the keygroup. Note: Please be careful using complex commands with es_foreachkey; the server might dramatically slow down and/or stop accepting commands until the command queue is addressed.
Code:
(<i>es_x</i> versions of EventScripts functions do not expand variables like server_var(), and are faster as a result.)
Whew. I'll update the full documentation with step-by-step usage instructions when I can. I just wanted to be sure you guys had access to play with this before I went to bed tonight.
Enjoy!
-Mattie
|
|
|
|