<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wolfwiki.anime.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MSch</id>
	<title>WolfWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wolfwiki.anime.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MSch"/>
	<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php/Special:Contributions/MSch"/>
	<updated>2026-11-08T12:57:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Configstring&amp;diff=2489</id>
		<title>Configstring</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Configstring&amp;diff=2489"/>
		<updated>2006-08-28T19:53:30Z</updated>

		<summary type="html">&lt;p&gt;MSch: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
Configstrings can be accessed with [[Lua_Mod_API#configstrings|et.trap_GetConfigstring and et.trap_SetConfigstring]] and the [[Lua_Mod_API#string_utility_functions|String utility functions]]&lt;br /&gt;
&lt;br /&gt;
==User Configstring==&lt;br /&gt;
A user Configstring gets written in the log file with a line starting with &#039;&#039;UserInfoChanged&#039;&#039; which mustn&#039;t be mistaken for one with &#039;&#039;Userinfo&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
To access a user&#039;s Configstring you can&#039;t just use et.trap_GetConfigstring(slotNumber) but must use et.trap_GetConfigstring(et.CS_PLAYERS + slotNumber)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;key;name;description&amp;quot; widths=&amp;quot;40;220;450&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
n;Nick;&lt;br /&gt;
t;Team;1=Axis, 2=Allies, 3=Spectators&lt;br /&gt;
c;Class;0=Soldier, 1=Medic, 2=Engineer, 3=FieldOps, 4=CovertOps&lt;br /&gt;
r;Rank;&lt;br /&gt;
m;Medals;&lt;br /&gt;
s;Skills;&lt;br /&gt;
dn;Disguised name;&lt;br /&gt;
dr;Disguised rank;&lt;br /&gt;
w;Weapon&lt;br /&gt;
lw;Latched weapon;Weapon on next spawn&lt;br /&gt;
sw;Latched secondary weapon;Secondary weapon on next spawn&lt;br /&gt;
p;Privilege level;0=Peon, referee (vote), referee (password), semiadmin, rconauth - etpro only&lt;br /&gt;
ss;Stat Saver; Stats restored by stat saver;etpro only&lt;br /&gt;
sc;Shoutcaster;etpro only&lt;br /&gt;
tv;ETTV slave;etpro only&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
et.CS_PLAYERS = 689 for those of you that don&#039;t use etconst.lua&lt;br /&gt;
&lt;br /&gt;
Source:  http://bani.anime.net/banimod/forums/viewtopic.php?t=5412&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:Lua]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>MSch</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Configstring&amp;diff=2488</id>
		<title>Configstring</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Configstring&amp;diff=2488"/>
		<updated>2006-08-28T19:51:20Z</updated>

		<summary type="html">&lt;p&gt;MSch: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
Configstrings can be accessed with [[Lua_Mod_API#configstrings|et.trap_GetConfigstring and et.trap_SetConfigstring]] and the [[Lua_Mod_API#string_utility_functions|String utility functions]]&lt;br /&gt;
&lt;br /&gt;
==User Configstring==&lt;br /&gt;
A user Configstring gets written in the log file with a line starting with &#039;&#039;UserInfoChanged&#039;&#039; which mustn&#039;t be mistaken for one with &#039;&#039;Userinfo&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
To access a user&#039;s Configstring you can&#039;t just use et.trap_GetConfigstring(slotNumber) but must use et.trap_GetConfigstring(et.CS_PLAYERS + slotNumber)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;key;name;description&amp;quot; widths=&amp;quot;40;220;450&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
n;Nick;&lt;br /&gt;
t;Team;1=Axis, 2=Allies, 3=Spectators&lt;br /&gt;
c;Class;0=Soldier, 1=Medic, 2=Engineer, 3=FieldOps, 4=CovertOps&lt;br /&gt;
r;Rank;&lt;br /&gt;
m;Medals;&lt;br /&gt;
s;Skills;&lt;br /&gt;
dn;Disguised name;&lt;br /&gt;
dr;Disguised rank;&lt;br /&gt;
w;Weapon&lt;br /&gt;
lw;Latched weapon;Weapon on next spawn&lt;br /&gt;
sw;Latched secondary weapon;Secondary weapon on next spawn&lt;br /&gt;
p;Privilege level;0=Peon, referee (vote), referee (password), semiadmin, rconauth - etpro only&lt;br /&gt;
ss;Stat Saver; Stats restored by stat saver;etpro only&lt;br /&gt;
sc;Shoutcaster;etpro only&lt;br /&gt;
tv;ETTV slave;etpro only&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
et.CS_PLAYERS = 689 for those of you that don&#039;t use etconst.lua&lt;br /&gt;
Source:  http://bani.anime.net/banimod/forums/viewtopic.php?t=5412&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:Lua]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>MSch</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Configstring&amp;diff=2487</id>
		<title>Configstring</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Configstring&amp;diff=2487"/>
		<updated>2006-08-28T19:46:43Z</updated>

		<summary type="html">&lt;p&gt;MSch: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
Configstrings can be accessed with [[Lua_Mod_API#configstrings|et.trap_GetConfigstring and et.trap_SetConfigstring]] and the [[Lua_Mod_API#string_utility_functions|String utility functions]]&lt;br /&gt;
&lt;br /&gt;
==User Configstring==&lt;br /&gt;
A user Configstring gets written in the log file with a line starting with &#039;&#039;UserInfoChanged&#039;&#039; which mustn&#039;t be mistaken for one with &#039;&#039;Userinfo&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
To access a user&#039;s Configstring you can&#039;t just use et.trap_GetConfigstring(slotNumber) but must use et.trap_GetConfigstring(et.CS_PLAYERS&amp;lt;ref&amp;gt;689 for those of you that don&#039;t use etconst.lua&amp;lt;/ref&amp;gt; + slotNumber)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;key;name;description&amp;quot; widths=&amp;quot;40;220;450&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
n;Nick;&lt;br /&gt;
t;Team;1=Axis, 2=Allies, 3=Spectators&lt;br /&gt;
c;Class;0=Soldier, 1=Medic, 2=Engineer, 3=FieldOps, 4=CovertOps&lt;br /&gt;
r;Rank;&lt;br /&gt;
m;Medals;&lt;br /&gt;
s;Skills;&lt;br /&gt;
dn;Disguised name;&lt;br /&gt;
dr;Disguised rank;&lt;br /&gt;
w;Weapon&lt;br /&gt;
lw;Latched weapon;Weapon on next spawn&lt;br /&gt;
sw;Latched secondary weapon;Secondary weapon on next spawn&lt;br /&gt;
p;Privilege level;0=Peon, referee (vote), referee (password), semiadmin, rconauth - etpro only&lt;br /&gt;
ss;Stat Saver; Stats restored by stat saver;etpro only&lt;br /&gt;
sc;Shoutcaster;etpro only&lt;br /&gt;
tv;ETTV slave;etpro only&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
Source:  http://bani.anime.net/banimod/forums/viewtopic.php?t=5412&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:Lua]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>MSch</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Userinfo&amp;diff=2486</id>
		<title>Userinfo</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Userinfo&amp;diff=2486"/>
		<updated>2006-08-28T19:40:51Z</updated>

		<summary type="html">&lt;p&gt;MSch: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Userinfo string mustn&#039;t be mistaken for [[Configstring]]!&lt;br /&gt;
&lt;br /&gt;
In the logfile lines starting with &#039;&#039;ClientUserinfoChanged&#039;&#039; are [[Configstring]] while lines starting with &#039;&#039;Userinfo&#039;&#039; are actual Userinfo strings.&lt;/div&gt;</summary>
		<author><name>MSch</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Configstring&amp;diff=2485</id>
		<title>Configstring</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Configstring&amp;diff=2485"/>
		<updated>2006-08-28T19:38:27Z</updated>

		<summary type="html">&lt;p&gt;MSch: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
==Configstring Fields==&lt;br /&gt;
Fields used in the Configstring string. Can be accessed with [[Lua_Mod_API#configstrings|et.trap_GetConfigstring and et.trap_SetConfigstring]] and the [[Lua_Mod_API#string_utility_functions|String utility functions]]&lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;key;name;description&amp;quot; widths=&amp;quot;40;220;450&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
n;Nick;&lt;br /&gt;
t;Team;1=Axis, 2=Allies, 3=Spectators&lt;br /&gt;
c;Class;0=Soldier, 1=Medic, 2=Engineer, 3=FieldOps, 4=CovertOps&lt;br /&gt;
r;Rank;&lt;br /&gt;
m;Medals;&lt;br /&gt;
s;Skills;&lt;br /&gt;
dn;Disguised name;&lt;br /&gt;
dr;Disguised rank;&lt;br /&gt;
w;Weapon&lt;br /&gt;
lw;Latched weapon;Weapon on next spawn&lt;br /&gt;
sw;Latched secondary weapon;Secondary weapon on next spawn&lt;br /&gt;
p;Privilege level;0=Peon, referee (vote), referee (password), semiadmin, rconauth - etpro only&lt;br /&gt;
ss;Stat Saver; Stats restored by stat saver;etpro only&lt;br /&gt;
sc;Shoutcaster;etpro only&lt;br /&gt;
tv;ETTV slave;etpro only&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
Source:  http://bani.anime.net/banimod/forums/viewtopic.php?t=5412&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:Lua]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>MSch</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Userinfo&amp;diff=2484</id>
		<title>Userinfo</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Userinfo&amp;diff=2484"/>
		<updated>2006-08-28T19:36:59Z</updated>

		<summary type="html">&lt;p&gt;MSch: Userinfo moved to Configstring&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#redirect [[Configstring]]&lt;/div&gt;</summary>
		<author><name>MSch</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Configstring&amp;diff=2483</id>
		<title>Configstring</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Configstring&amp;diff=2483"/>
		<updated>2006-08-28T19:36:59Z</updated>

		<summary type="html">&lt;p&gt;MSch: Userinfo moved to Configstring&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
==Userinfo Fields==&lt;br /&gt;
Fields used in the Userinfo string. Can be accessed with [[Lua_Mod_API#userinfo|et.trap_GetUserinfo and et.trap_SetUserinfo]] and the [[Lua_Mod_API#string_utility_functions|String utility functions]]&lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;key;name;description&amp;quot; widths=&amp;quot;40;220;450&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
n;Nick;&lt;br /&gt;
t;Team;1=Axis, 2=Allies, 3=Spectators&lt;br /&gt;
c;Class;0=Soldier, 1=Medic, 2=Engineer, 3=FieldOps, 4=CovertOps&lt;br /&gt;
r;Rank;&lt;br /&gt;
m;Medals;&lt;br /&gt;
s;Skills;&lt;br /&gt;
dn;Disguised name;&lt;br /&gt;
dr;Disguised rank;&lt;br /&gt;
w;Weapon&lt;br /&gt;
lw;Latched weapon;Weapon on next spawn&lt;br /&gt;
sw;Latched secondary weapon;Secondary weapon on next spawn&lt;br /&gt;
p;Privilege level;0=Peon, referee (vote), referee (password), semiadmin, rconauth - etpro only&lt;br /&gt;
ss;Stat Saver; Stats restored by stat saver;etpro only&lt;br /&gt;
sc;Shoutcaster;etpro only&lt;br /&gt;
tv;ETTV slave;etpro only&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
Source:  http://bani.anime.net/banimod/forums/viewtopic.php?t=5412&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:Lua]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>MSch</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=User:MSch&amp;diff=2482</id>
		<title>User:MSch</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=User:MSch&amp;diff=2482"/>
		<updated>2006-08-28T19:30:46Z</updated>

		<summary type="html">&lt;p&gt;MSch: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi, I&#039;m Martin. You can contact me as MSch on Quakenet, Freenode and some other networks.&lt;/div&gt;</summary>
		<author><name>MSch</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Configstring&amp;diff=2481</id>
		<title>Configstring</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Configstring&amp;diff=2481"/>
		<updated>2006-08-28T19:26:06Z</updated>

		<summary type="html">&lt;p&gt;MSch: Initial writeup; completely sourced from the forum&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
==Userinfo Fields==&lt;br /&gt;
Fields used in the Userinfo string. Can be accessed with [[Lua_Mod_API#userinfo|et.trap_GetUserinfo and et.trap_SetUserinfo]] and the [[Lua_Mod_API#string_utility_functions|String utility functions]]&lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;key;name;description&amp;quot; widths=&amp;quot;40;220;450&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
n;Nick;&lt;br /&gt;
t;Team;1=Axis, 2=Allies, 3=Spectators&lt;br /&gt;
c;Class;0=Soldier, 1=Medic, 2=Engineer, 3=FieldOps, 4=CovertOps&lt;br /&gt;
r;Rank;&lt;br /&gt;
m;Medals;&lt;br /&gt;
s;Skills;&lt;br /&gt;
dn;Disguised name;&lt;br /&gt;
dr;Disguised rank;&lt;br /&gt;
w;Weapon&lt;br /&gt;
lw;Latched weapon;Weapon on next spawn&lt;br /&gt;
sw;Latched secondary weapon;Secondary weapon on next spawn&lt;br /&gt;
p;Privilege level;0=Peon, referee (vote), referee (password), semiadmin, rconauth - etpro only&lt;br /&gt;
ss;Stat Saver; Stats restored by stat saver;etpro only&lt;br /&gt;
sc;Shoutcaster;etpro only&lt;br /&gt;
tv;ETTV slave;etpro only&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
Source:  http://bani.anime.net/banimod/forums/viewtopic.php?t=5412&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:Lua]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>MSch</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Mod_API&amp;diff=2480</id>
		<title>Lua Mod API</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Lua_Mod_API&amp;diff=2480"/>
		<updated>2006-08-28T19:13:41Z</updated>

		<summary type="html">&lt;p&gt;MSch: Created Links for Userinfo, page will follow shortly&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
[[ETPro]] now supports server-side mods via the [http://www.lua.org/ Lua] scripting language. For more information about Lua, visit the [http://www.lua.org/manual/5.0/ Reference manual], the online edition of the book [http://www.lua.org/pil/ Programming in Lua] or the [http://lua-users.org/wiki/ lua-users wiki].&lt;br /&gt;
&lt;br /&gt;
ETPro has an embedded Lua 5.0.2 interpreter, and if present will load user-defined scripts from the ETPro directory.  It also provides an &amp;quot;et&amp;quot; library of function calls for Lua that allow access to the server engine, and provides callbacks so a server side mod may trigger on specific server events.&lt;br /&gt;
&lt;br /&gt;
The following standard Lua libraries are initialized by default and available to ETPro Lua scripts:&lt;br /&gt;
[http://www.lua.org/manual/5.0/manual.html#5.1 basic], [http://www.lua.org/manual/5.0/manual.html#5.4 table], [http://www.lua.org/manual/5.0/manual.html#5.6 i/o], [http://www.lua.org/manual/5.0/manual.html#5.3 string], [http://www.lua.org/manual/5.0/manual.html#5.5 math].&lt;br /&gt;
&lt;br /&gt;
A list of ETPro mods can be found [[:Category:ETPro:Mods|here]].&lt;br /&gt;
&lt;br /&gt;
A tutorial about ETPro Lua scripting can be found [[Lua Tutorials|here]].&lt;br /&gt;
&lt;br /&gt;
API requests can be discussed at the [[Talk:Lua_Mod_API|Lua Mod API talk page]].&lt;br /&gt;
&lt;br /&gt;
==client commands==&lt;br /&gt;
===lua_status===&lt;br /&gt;
:lists all currently loaded lua modules.&lt;br /&gt;
:&#039;&#039;lua mods cannot override this client command.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==server commands==&lt;br /&gt;
===lua_status===&lt;br /&gt;
:lists all currently loaded lua modules.&lt;br /&gt;
&lt;br /&gt;
==cvars==&lt;br /&gt;
===lua_modules===&lt;br /&gt;
:(default &amp;quot;&amp;quot;, disabled)&lt;br /&gt;
:space separated list of lua modules for ETPro to load. modules will be run in the order listed.&lt;br /&gt;
&lt;br /&gt;
===lua_allowedmodules===&lt;br /&gt;
:(default &amp;quot;&amp;quot;, disabled)&lt;br /&gt;
:if set, only lua modules with the matching sha1 signatures listed in this cvar will be allowed to load.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
:changing either cvar will cause all currently loaded modules to :quit and be unloaded until the next map_restart.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==et library calls==&lt;br /&gt;
&lt;br /&gt;
===modules===&lt;br /&gt;
et.RegisterModname( &#039;&#039;&#039;modname&#039;&#039;&#039; )&lt;br /&gt;
:Registers a descriptive string &#039;&#039;&#039;modname&#039;&#039;&#039; for this mod.&lt;br /&gt;
&#039;&#039;&#039;vmnumber&#039;&#039;&#039; = et.FindSelf()&lt;br /&gt;
:Returns a number indicating the VM slot the current mod is loaded into.&lt;br /&gt;
&#039;&#039;&#039;modname&#039;&#039;&#039;, &#039;&#039;&#039;signature&#039;&#039;&#039; = et.FindMod( &#039;&#039;&#039;vmnumber&#039;&#039;&#039; )&lt;br /&gt;
:Returns the &#039;&#039;&#039;modname&#039;&#039;&#039; and sha1 &#039;&#039;&#039;signature&#039;&#039;&#039; for the mod loaded in the VM slot &#039;&#039;&#039;vmnumber&#039;&#039;&#039;. Returns nil, nil if the VM slot is invalid.&lt;br /&gt;
&#039;&#039;&#039;success&#039;&#039;&#039; = et.IPCSend( &#039;&#039;&#039;vmnumber&#039;&#039;&#039;, &#039;&#039;&#039;message&#039;&#039;&#039; )&lt;br /&gt;
:Sends the string &#039;&#039;&#039;message&#039;&#039;&#039; to the mod in the VM slot indicated by &#039;&#039;&#039;vmnumber&#039;&#039;&#039;. The mod receiving &#039;&#039;&#039;message&#039;&#039;&#039; must have an &#039;&#039;et_IPCReceive()&#039;&#039; callback. If the message is successfully sent, &#039;&#039;&#039;success&#039;&#039;&#039; will be 1. On failure it will be 0.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===printing===&lt;br /&gt;
et.G_Print( &#039;&#039;&#039;text&#039;&#039;&#039; )&lt;br /&gt;
:Prints the string &#039;&#039;&#039;text&#039;&#039;&#039; to the server console.&lt;br /&gt;
et.G_LogPrint( &#039;&#039;&#039;text&#039;&#039;&#039; )&lt;br /&gt;
:Prints the string &#039;&#039;&#039;text&#039;&#039;&#039; to the server console and writes it to the server log.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===argument handling===&lt;br /&gt;
These functions are to be used within the [[#commands|command callback functions]].&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;args&#039;&#039;&#039; = et.ConcatArgs( &#039;&#039;&#039;index&#039;&#039;&#039; )&lt;br /&gt;
:Returns all arguments beginning from &#039;&#039;&#039;index&#039;&#039;&#039; concatenated into a single string &#039;&#039;&#039;args&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;argcount&#039;&#039;&#039; = et.trap_Argc()&lt;br /&gt;
:Returns a number indicating the number of command line arguments in the command buffer.&lt;br /&gt;
&#039;&#039;&#039;arg&#039;&#039;&#039; = et.trap_Argv( &#039;&#039;&#039;argnum&#039;&#039;&#039; )&lt;br /&gt;
:Returns the contents of the command line argument &#039;&#039;&#039;argnum&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===cvars===&lt;br /&gt;
&#039;&#039;&#039;cvarvalue&#039;&#039;&#039; = et.trap_Cvar_Get( &#039;&#039;&#039;cvarname&#039;&#039;&#039; )&lt;br /&gt;
:Returns the value of the cvar &#039;&#039;&#039;cvarname&#039;&#039;&#039; as a string. If there is no cvar named &#039;&#039;&#039;cvarname&#039;&#039;&#039;, returns a zero length string. &lt;br /&gt;
et.trap_Cvar_Set( &#039;&#039;&#039;cvarname&#039;&#039;&#039;, &#039;&#039;&#039;cvarvalue&#039;&#039;&#039; )&lt;br /&gt;
:Sets the cvar &#039;&#039;&#039;cvarname&#039;&#039;&#039; to &#039;&#039;&#039;cvarvalue&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===configstrings===&lt;br /&gt;
&#039;&#039;&#039;configstringvalue&#039;&#039;&#039; = et.trap_GetConfigstring( &#039;&#039;&#039;index&#039;&#039;&#039; )&lt;br /&gt;
:Returns the string &#039;&#039;&#039;configstringvalue&#039;&#039;&#039; containing the contents of the configstring &#039;&#039;&#039;index&#039;&#039;&#039;&lt;br /&gt;
et.trap_SetConfigstring( &#039;&#039;&#039;index&#039;&#039;&#039;, &#039;&#039;&#039;configstringvalue&#039;&#039;&#039; )&lt;br /&gt;
:Sets the configstring &#039;&#039;&#039;index&#039;&#039;&#039; to the string &#039;&#039;&#039;configstringvalue&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===server===&lt;br /&gt;
et.trap_SendConsoleCommand( &#039;&#039;&#039;when&#039;&#039;&#039;, &#039;&#039;&#039;command&#039;&#039;&#039; )&lt;br /&gt;
:Sends the command &#039;&#039;&#039;command&#039;&#039;&#039; to the server console, to be executed &#039;&#039;&#039;when&#039;&#039;&#039; (see et.EXEC_* constants)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===clients===&lt;br /&gt;
et.trap_DropClient( &#039;&#039;&#039;clientnum&#039;&#039;&#039;, &#039;&#039;&#039;reason&#039;&#039;&#039;, &#039;&#039;&#039;ban_time&#039;&#039;&#039; )&lt;br /&gt;
:Disconnects &#039;&#039;&#039;clientnum&#039;&#039;&#039; from the server, with descriptive string &#039;&#039;&#039;reason&#039;&#039;&#039; reported to clients. &#039;&#039;&#039;ban_time&#039;&#039;&#039; is the time in seconds to ban the client from the server. &#039;&#039;&#039;ban_time&#039;&#039;&#039; is optional and may be entirely omitted, in which case the ban time defaults to the cvar &#039;&#039;b_defaultbantime&#039;&#039;&lt;br /&gt;
et.trap_SendServerCommand( &#039;&#039;&#039;clientnum&#039;&#039;&#039;, &#039;&#039;&#039;[[SendServerCommand|command]]&#039;&#039;&#039; )&lt;br /&gt;
:Sends the command &#039;&#039;&#039;[[SendServerCommand|command]]&#039;&#039;&#039; to the client &#039;&#039;&#039;clientnum&#039;&#039;&#039;. If &#039;&#039;&#039;clientnum&#039;&#039;&#039; is -1, the &#039;&#039;&#039;[[SendServerCommand|command]]&#039;&#039;&#039; is broadcast to all connected clients.&lt;br /&gt;
et.G_Say( &#039;&#039;&#039;clientNum&#039;&#039;&#039;, &#039;&#039;&#039;mode&#039;&#039;&#039;, &#039;&#039;&#039;text&#039;&#039;&#039; )&lt;br /&gt;
:Sends a chat command on behalf of client &#039;&#039;&#039;clientNum&#039;&#039;&#039; with the mode &#039;&#039;&#039;mode&#039;&#039;&#039; (see et.SAY_* constants) and chat text &#039;&#039;&#039;text&#039;&#039;&#039;.&lt;br /&gt;
et.ClientUserinfoChanged( &#039;&#039;&#039;clientNum&#039;&#039;&#039; )&lt;br /&gt;
:Loads the new [[Userinfo]] of &#039;&#039;&#039;clientNum&#039;&#039;&#039; and stores it in the configstring and client variables&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===userinfo===&lt;br /&gt;
&#039;&#039;&#039;userinfo&#039;&#039;&#039; = et.trap_GetUserinfo( &#039;&#039;&#039;clientnum&#039;&#039;&#039; )&lt;br /&gt;
:Returns the contents of the [[Userinfo]] string for the client &#039;&#039;&#039;clientnum&#039;&#039;&#039;&lt;br /&gt;
et.trap_SetUserinfo( &#039;&#039;&#039;clientnum&#039;&#039;&#039;, &#039;&#039;&#039;userinfo&#039;&#039;&#039; )&lt;br /&gt;
:Sets the [[Userinfo]] string for the client &#039;&#039;&#039;clientnum&#039;&#039;&#039; to &#039;&#039;&#039;userinfo&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===string utility functions===&lt;br /&gt;
&#039;&#039;&#039;infostring&#039;&#039;&#039; = et.Info_RemoveKey( &#039;&#039;&#039;infostring&#039;&#039;&#039;, &#039;&#039;&#039;key&#039;&#039;&#039; )&lt;br /&gt;
:Removes key &#039;&#039;&#039;key&#039;&#039;&#039; from infostring &#039;&#039;&#039;infostring&#039;&#039;&#039; and returns the modified infostring.&lt;br /&gt;
&#039;&#039;&#039;infostring&#039;&#039;&#039; = et.Info_SetValueForKey( &#039;&#039;&#039;infostring&#039;&#039;&#039;, &#039;&#039;&#039;key&#039;&#039;&#039;, &#039;&#039;&#039;value&#039;&#039;&#039; )&lt;br /&gt;
:Sets the key &#039;&#039;&#039;key&#039;&#039;&#039; in the infostring &#039;&#039;&#039;infostring&#039;&#039;&#039; to &#039;&#039;&#039;value&#039;&#039;&#039; and returns the modified infostring. If &#039;&#039;&#039;value&#039;&#039;&#039; is an empty string, &#039;&#039;&#039;key&#039;&#039;&#039; is removed from the string. &lt;br /&gt;
&#039;&#039;&#039;keyvalue&#039;&#039;&#039; = et.Info_ValueForKey( &#039;&#039;&#039;infostring&#039;&#039;&#039;, &#039;&#039;&#039;key&#039;&#039;&#039; )&lt;br /&gt;
:Returns the value of the key &#039;&#039;&#039;key&#039;&#039;&#039; in the infostring &#039;&#039;&#039;infostring&#039;&#039;&#039;. If &#039;&#039;&#039;key&#039;&#039;&#039; is not present in the string, an empty string is returned.&lt;br /&gt;
&#039;&#039;&#039;cleanstring&#039;&#039;&#039; = et.Q_CleanStr( &#039;&#039;&#039;string&#039;&#039;&#039; )&lt;br /&gt;
:Returns &#039;&#039;&#039;string&#039;&#039;&#039; stripped of all color codes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ET filesystem===&lt;br /&gt;
&#039;&#039;&#039;fd&#039;&#039;&#039;, &#039;&#039;&#039;len&#039;&#039;&#039; = et.trap_FS_FOpenFile( &#039;&#039;&#039;filename&#039;&#039;&#039;, &#039;&#039;&#039;mode&#039;&#039;&#039; )&lt;br /&gt;
:Attempts to open the file &#039;&#039;&#039;filename&#039;&#039;&#039; with the access mode &#039;&#039;&#039;mode&#039;&#039;&#039; (see et.FS_ constants). Returns the filedescriptor &#039;&#039;&#039;fd&#039;&#039;&#039; and file length &#039;&#039;&#039;len&#039;&#039;&#039;. On error, &#039;&#039;&#039;len&#039;&#039;&#039; returns -1.&lt;br /&gt;
&#039;&#039;&#039;filedata&#039;&#039;&#039; = et.trap_FS_Read( fd, count )&lt;br /&gt;
:Reads &#039;&#039;&#039;count&#039;&#039;&#039; bytes from filedescriptor &#039;&#039;&#039;fd&#039;&#039;&#039;.&lt;br /&gt;
&#039;&#039;&#039;count&#039;&#039;&#039; = et.trap_FS_Write( &#039;&#039;&#039;filedata&#039;&#039;&#039;, &#039;&#039;&#039;count&#039;&#039;&#039;, &#039;&#039;&#039;fd&#039;&#039;&#039; )&lt;br /&gt;
:Attempts to write &#039;&#039;&#039;count&#039;&#039;&#039; bytes of &#039;&#039;&#039;filedata&#039;&#039;&#039; to filedescriptor &#039;&#039;&#039;fd&#039;&#039;&#039;. Returns number of bytes successfully written.&lt;br /&gt;
et.trap_FS_Rename( &#039;&#039;&#039;oldname&#039;&#039;&#039;, &#039;&#039;&#039;newname&#039;&#039;&#039; )&lt;br /&gt;
:Renames file &#039;&#039;&#039;oldname&#039;&#039;&#039; to &#039;&#039;&#039;newname&#039;&#039;&#039;.&lt;br /&gt;
et.trap_FS_FCloseFile( &#039;&#039;&#039;fd&#039;&#039;&#039; )&lt;br /&gt;
:Closes filedescriptor &#039;&#039;&#039;fd&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===indexes===&lt;br /&gt;
&#039;&#039;&#039;soundindex&#039;&#039;&#039; = et.G_SoundIndex( &#039;&#039;&#039;filename&#039;&#039;&#039; )&lt;br /&gt;
:Returns an index to the soundfile indicated by &#039;&#039;&#039;filename&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;modelindex&#039;&#039;&#039; = et.G_ModelIndex( &#039;&#039;&#039;filename&#039;&#039;&#039; )&lt;br /&gt;
:Returns an index to the model indicated by &#039;&#039;&#039;filename&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===sound===&lt;br /&gt;
et.G_globalSound( &#039;&#039;&#039;sound&#039;&#039;&#039; )&lt;br /&gt;
:Plays the global sound indicated by the filename &#039;&#039;&#039;sound&#039;&#039;&#039;.&lt;br /&gt;
et.G_Sound( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;soundindex&#039;&#039;&#039; )&lt;br /&gt;
:Plays the sound &#039;&#039;&#039;soundindex&#039;&#039;&#039; at the location of entity &#039;&#039;&#039;entnum&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===miscellaneous===&lt;br /&gt;
&#039;&#039;&#039;milliseconds&#039;&#039;&#039; = et.trap_Milliseconds()&lt;br /&gt;
:Returns a number indicating the current server time in milliseconds.&lt;br /&gt;
et.G_Damage( &#039;&#039;&#039;target&#039;&#039;&#039;, &#039;&#039;&#039;inflictor&#039;&#039;&#039;, &#039;&#039;&#039;attacker&#039;&#039;&#039;, &#039;&#039;&#039;damage&#039;&#039;&#039;, &#039;&#039;&#039;[[etdamage|dflags]]&#039;&#039;&#039;, &#039;&#039;&#039;[[etdamage|mod]]&#039;&#039;&#039; )&lt;br /&gt;
:Does &#039;&#039;&#039;damage&#039;&#039;&#039; amount of damage on &#039;&#039;&#039;target&#039;&#039;&#039; inflicted by &#039;&#039;&#039;inflictor&#039;&#039;&#039; and cased by &#039;&#039;&#039;attacker&#039;&#039;&#039;&lt;br /&gt;
:&#039;&#039;&#039;target&#039;&#039;&#039;, &#039;&#039;&#039;inflictor&#039;&#039;&#039;, &#039;&#039;&#039;attacker&#039;&#039;&#039; are entity numbers&lt;br /&gt;
:&#039;&#039;&#039;[[etdamage|dflags]]&#039;&#039;&#039; is a [[Bitmask-cvar|bitflag]] number to decide how the damage is inflickted, see &#039;&#039;&#039;[[etdamage|dflags]]&#039;&#039;&#039; [[etdamage|flaglist]]&lt;br /&gt;
:&#039;&#039;&#039;[[etdamage|mod]]&#039;&#039;&#039; is a number from 0 up to 64 o set the type of damage, see &#039;&#039;&#039;[[etdamage|mod]]&#039;&#039;&#039; [[etdamage|list]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===entities===&lt;br /&gt;
&#039;&#039;&#039;entnum&#039;&#039;&#039; = et.G_Spawn()&lt;br /&gt;
:Spawns a new entity and returns the new entity number.&lt;br /&gt;
&#039;&#039;&#039;entnum&#039;&#039;&#039; = et.G_TempEntity( &#039;&#039;&#039;origin&#039;&#039;&#039;, &#039;&#039;&#039;event&#039;&#039;&#039; )&lt;br /&gt;
:Spawns a new TempEntity of event type &#039;&#039;&#039;event&#039;&#039;&#039; and places it at &#039;&#039;&#039;origin&#039;&#039;&#039; in the world.&lt;br /&gt;
:&#039;&#039;&#039;Warning:&#039;&#039;&#039; up to and including ETPro 3.2.4 the signature of the method is broken and expects four instead of two parameters. To successfully call it, you need to prepend the parameter list with two dummy parameters like et.G_TempEntity( 0, 0, origin, event ). Use this method with care, because in future ETPro versions it will probably be corrected to the one stated above and might break your script.&lt;br /&gt;
et.G_FreeEntity( &#039;&#039;&#039;entnum&#039;&#039;&#039; )&lt;br /&gt;
:Frees the entity &#039;&#039;&#039;entnum&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;spawnval&#039;&#039;&#039; = et.G_GetSpawnVar( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;key&#039;&#039;&#039; )&lt;br /&gt;
:Returns the value of spawnvar &#039;&#039;&#039;key&#039;&#039;&#039; for entity &#039;&#039;&#039;entnum&#039;&#039;&#039;&lt;br /&gt;
et.G_SetSpawnVar( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;key&#039;&#039;&#039;, &#039;&#039;&#039;value&#039;&#039;&#039; )&lt;br /&gt;
:Sets the spawnvar &#039;&#039;&#039;key&#039;&#039;&#039; to &#039;&#039;&#039;value&#039;&#039;&#039; for entity &#039;&#039;&#039;entnum&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;integer entnum&#039;&#039;&#039; = et.G_SpawnGEntityFromSpawnVars( string spawnvar, string spawnvalue, ... )&lt;br /&gt;
:This function can only be called inside the &#039;&#039;&#039;et_InitGame&#039;&#039;&#039; callback&lt;br /&gt;
et.trap_LinkEntity( &#039;&#039;&#039;entnum&#039;&#039;&#039; )&lt;br /&gt;
:Links the entity &#039;&#039;&#039;entnum&#039;&#039;&#039;&lt;br /&gt;
et.trap_UnlinkEntity( &#039;&#039;&#039;entnum&#039;&#039;&#039; )&lt;br /&gt;
:Unlinks the entity &#039;&#039;&#039;entnum&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;(variable)&#039;&#039;&#039; = et.gentity_get ( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039; &#039;&#039;,arrayindex&#039;&#039; )&lt;br /&gt;
:Gets the value of &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039; from entity &#039;&#039;&#039;entnum&#039;&#039;&#039; out of the g_entity struct. For NULL entities or clients, &#039;&#039;nil&#039;&#039; is returned.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;arrayindex&#039;&#039; is used to specify which element of an array entity field to get. It is required when accessing array type fields. Entity field array indexes start at 0.&lt;br /&gt;
et.gentity_set( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039;, &#039;&#039;arrayindex,&#039;&#039; &#039;&#039;&#039;(value)&#039;&#039;&#039; )&lt;br /&gt;
:Sets the value of &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039; from entity &#039;&#039;&#039;entnum&#039;&#039;&#039; in the g_entity struct to &#039;&#039;&#039;(value)&#039;&#039;&#039;&lt;br /&gt;
:&#039;&#039;arrayindex&#039;&#039; is used to specify which element of an array entity field to set.&lt;br /&gt;
et.G_AddEvent( &#039;&#039;&#039;ent&#039;&#039;&#039;, &#039;&#039;&#039;event&#039;&#039;&#039;, &#039;&#039;&#039;eventparm&#039;&#039;&#039;&#039; )&lt;br /&gt;
:Adds event &#039;&#039;&#039;event&#039;&#039;&#039; whit eventparameter &#039;&#039;&#039;eventparm&#039;&#039;&#039;&#039; to entity &#039;&#039;&#039;ent&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==callbacks==&lt;br /&gt;
&lt;br /&gt;
===qagame execution===&lt;br /&gt;
et_InitGame( &#039;&#039;&#039;levelTime&#039;&#039;&#039;, &#039;&#039;&#039;randomSeed&#039;&#039;&#039;, &#039;&#039;&#039;restart&#039;&#039;&#039; )&lt;br /&gt;
:Called when qagame initializes. &#039;&#039;&#039;levelTime&#039;&#039;&#039; is the current level time in milliseconds. &#039;&#039;&#039;randomSeed&#039;&#039;&#039; is a number that can be used to seed random number generators. &#039;&#039;&#039;restart&#039;&#039;&#039; indicates if et_InitGame() is being called due to a map restart (1) or not (0).&lt;br /&gt;
et_ShutdownGame( &#039;&#039;&#039;restart&#039;&#039;&#039; )&lt;br /&gt;
:Called when qagame shuts down. &#039;&#039;&#039;restart&#039;&#039;&#039; indicates if the shutdown is being called due to a map_restart (1) or not (0).&lt;br /&gt;
et_RunFrame( &#039;&#039;&#039;levelTime&#039;&#039;&#039; )&lt;br /&gt;
:Called when qagame runs a server frame. &#039;&#039;&#039;levelTime&#039;&#039;&#039; is the current level time in milliseconds.&lt;br /&gt;
et_Quit()&lt;br /&gt;
:Called when ETPro unloads the mod. The mod should close all open filedescriptors and perform all cleanup.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===client management===&lt;br /&gt;
&#039;&#039;&#039;rejectreason&#039;&#039;&#039; = et_ClientConnect( &#039;&#039;&#039;clientNum&#039;&#039;&#039;, &#039;&#039;&#039;firstTime&#039;&#039;&#039;, &#039;&#039;&#039;isBot&#039;&#039;&#039; )&lt;br /&gt;
:Called when a client attempts to connect to the server. &#039;&#039;&#039;clientNum&#039;&#039;&#039; is the client slot id, &#039;&#039;&#039;firstTime&#039;&#039;&#039; indicates if this is a new connection (1) or a reconnection (0). &#039;&#039;&#039;isBot&#039;&#039;&#039; indicates if the client is a bot (1) or not (0). If the mod accepts the connection, it should return nil. Otherwise, the mod should return a string describing the reason the client connection was rejected.&lt;br /&gt;
et_ClientDisconnect( &#039;&#039;&#039;clientNum&#039;&#039;&#039; )&lt;br /&gt;
:Called when a client disconnects. &#039;&#039;&#039;clientNum&#039;&#039;&#039; is the client slot id.&lt;br /&gt;
et_ClientBegin( &#039;&#039;&#039;clientNum&#039;&#039;&#039; )&lt;br /&gt;
:Called when a client begins (becomes active, and enters the gameworld). &#039;&#039;&#039;clientNum&#039;&#039;&#039; is the client slot id.&lt;br /&gt;
et_ClientUserinfoChanged( &#039;&#039;&#039;clientNum&#039;&#039;&#039; )&lt;br /&gt;
:Called when a client&#039;s [[Userinfo]] string has changed. &#039;&#039;&#039;clientNum&#039;&#039;&#039; is the client slot id.&lt;br /&gt;
et_ClientSpawn( &#039;&#039;&#039;clientNum&#039;&#039;&#039;, &#039;&#039;&#039;revived&#039;&#039;&#039; )&lt;br /&gt;
:Called when a client is spawned. &#039;&#039;&#039;clientNum&#039;&#039;&#039; is the client slot id. &#039;&#039;&#039;revived&#039;&#039;&#039; is 1 if the client was spawned by beeying revived.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===commands===&lt;br /&gt;
&#039;&#039;&#039;intercepted&#039;&#039;&#039; = et_ClientCommand( &#039;&#039;&#039;clientNum&#039;&#039;&#039;, &#039;&#039;&#039;command&#039;&#039;&#039; )&lt;br /&gt;
:Called when a command is received from a client. &#039;&#039;&#039;clientNum&#039;&#039;&#039; is the client slot id. &#039;&#039;&#039;command&#039;&#039;&#039; is the command. The mod should return 1 if the command was intercepted by the mod, and 0 if the command was ignored by the mod and should be passed through to the server (and other mods in the chain).&lt;br /&gt;
:The actual command can be accessed through the [[#argument_handling|argument handling]] functions, as seen in the [[ETPro:Lua Sample Code]].&lt;br /&gt;
&#039;&#039;&#039;intercepted&#039;&#039;&#039; = et_ConsoleCommand()&lt;br /&gt;
:Called when a command is entered on the server console. The mod should return 1 if the command was intercepted by the mod, and 0 if the command was ignored by the mod and should be passed through to the server (and other mods in the chain).&lt;br /&gt;
:The actual command can be accessed through the [[#argument_handling|argument handling]] functions, as seen in the [[ETPro:Lua Sample Code]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===xp===&lt;br /&gt;
et_UpgradeSkill( &#039;&#039;&#039;cno&#039;&#039;&#039;, &#039;&#039;&#039;skill&#039;&#039;&#039; )&lt;br /&gt;
:Called when client on slot &#039;&#039;&#039;cno&#039;&#039;&#039; gets an upgrade on skill &#039;&#039;&#039;skill&#039;&#039;&#039;. Return -1 to override (abort) the qagame function, anything else to &amp;quot;passthrough&amp;quot;. Callback may modify skills (or do anything else it wants) during passthrough. &lt;br /&gt;
et_SetPlayerSkill( &#039;&#039;&#039;cno&#039;&#039;&#039;, &#039;&#039;&#039;skill&#039;&#039;&#039; )&lt;br /&gt;
:Called when clients (on slot &#039;&#039;&#039;cno&#039;&#039;&#039;) skill level &#039;&#039;&#039;skill&#039;&#039;&#039; is set. Return -1 to override (abort) the qagame function, anything else to &amp;quot;passthrough&amp;quot;. Callback may modify skills (or do anything else it wants) during passthrough.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===miscellaneous===&lt;br /&gt;
et_IPCReceive( &#039;&#039;&#039;vmnumber&#039;&#039;&#039;, &#039;&#039;&#039;message&#039;&#039;&#039; )&lt;br /&gt;
:Called when another mod sends an et.IPCSend() message to this mod. &#039;&#039;&#039;vmnumber&#039;&#039;&#039; is the VM slot number of the sender, and &#039;&#039;&#039;message&#039;&#039;&#039; is the message.&lt;br /&gt;
et_Print( &#039;&#039;&#039;text&#039;&#039;&#039; )&lt;br /&gt;
:Called whenever the server or qagame prints a string to the console.&lt;br /&gt;
et_Obituary( &#039;&#039;&#039;victim&#039;&#039;&#039;, &#039;&#039;&#039;killer&#039;&#039;&#039;, &#039;&#039;&#039;meansOfDeath&#039;&#039;&#039; )&lt;br /&gt;
:Called whenever a player is killed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==predefined constants==&lt;br /&gt;
et.EXEC_NOW&amp;lt;br&amp;gt;&lt;br /&gt;
et.EXEC_INSERT&amp;lt;br&amp;gt;&lt;br /&gt;
et.EXEC_APPEND&amp;lt;br&amp;gt;&lt;br /&gt;
et.FS_READ&amp;lt;br&amp;gt;&lt;br /&gt;
et.FS_WRITE&amp;lt;br&amp;gt;&lt;br /&gt;
et.FS_APPEND&amp;lt;br&amp;gt;&lt;br /&gt;
et.FS_APPEND_SYNC&amp;lt;br&amp;gt;&lt;br /&gt;
et.SAY_ALL&amp;lt;br&amp;gt;&lt;br /&gt;
et.SAY_TEAM&amp;lt;br&amp;gt;&lt;br /&gt;
et.SAY_BUDDY&amp;lt;br&amp;gt;&lt;br /&gt;
et.SAY_TEAMNL&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
et.HOSTARCH&lt;br /&gt;
:set to WIN32 or UNIX depending on the host architecture qagame is running on.&lt;br /&gt;
LUA_PATH&lt;br /&gt;
:set to fs_homepath/fs_game/?.lua in order to ease use of the [http://www.lua.org/pil/8.1.html require] function.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==configs==&lt;br /&gt;
If a config is loaded, all modules are shutdown and reloaded. If a &#039;&#039;certified&#039;&#039; config is loaded, all modules are shutdown and reloaded, and additionally the following functions are disabled: &#039;&#039;&#039;require()&#039;&#039;&#039;, &#039;&#039;&#039;loadfile()&#039;&#039;&#039;, &#039;&#039;&#039;loadlib()&#039;&#039;&#039;, &#039;&#039;&#039;loadstring()&#039;&#039;&#039;, &#039;&#039;&#039;dofile()&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==caveats==&lt;br /&gt;
Like qagame, lua modules are unloaded and reloaded on map_restart and map changes. This means that all global variables and other information is lost. Mods may choose to store persistent data in cvars or external files.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
&lt;br /&gt;
Q: OMG I hate the libary prefix et.* on everything!!11!1oneone&amp;lt;br&amp;gt;&lt;br /&gt;
A: table.foreach(et, function (func, value) _G[func] = value; end)&lt;br /&gt;
&lt;br /&gt;
Q: How do a reload my lua file without restarting the whole server?&amp;lt;br&amp;gt;&lt;br /&gt;
A: Change maps, use map_restart or reset_match&lt;br /&gt;
&lt;br /&gt;
Q: Can I see some sample code?&amp;lt;br&amp;gt;&lt;br /&gt;
A: [[ETPro:Lua Sample Code|Lua sample code]]&lt;br /&gt;
&lt;br /&gt;
Q: Is there a list of [[ETPro]] mods?&amp;lt;br&amp;gt;&lt;br /&gt;
A: Yes, [[:Category:ETPro:Mods|here]].&lt;br /&gt;
&lt;br /&gt;
Q: OMG my mod doesn&#039;t work!&amp;lt;br&amp;gt;&lt;br /&gt;
A: Make sure you added your mod&#039;s filename to the lua_modules cvar (e.g. set lua_modules mymod.lua).&lt;br /&gt;
&lt;br /&gt;
Q: OMG why has et_ClientSay been removed?&amp;lt;br&amp;gt;&lt;br /&gt;
A: Thats a secret but, to keep the function as it was, just add the following code to your et_ClientCommand() function&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;	-- et_ClientSay had to be removed in order to intercept all commands &lt;br /&gt;
	-- so here&#039;s a wrapper for that&lt;br /&gt;
		arg0 = et.trap_Argv(0) -- get the main command&lt;br /&gt;
		&lt;br /&gt;
		if arg0 == &amp;quot;say&amp;quot; then&lt;br /&gt;
			return et_ClientSay( clientNum, et.SAY_ALL, et.ConcatArgs(1))&lt;br /&gt;
		elseif arg0 == &amp;quot;say_team&amp;quot; then&lt;br /&gt;
			return et_ClientSay( clientNum, et.SAY_TEAM, et.ConcatArgs(1))&lt;br /&gt;
		elseif arg0 == &amp;quot;say_buddy&amp;quot; then&lt;br /&gt;
			return et_ClientSay( clientNum, et.SAY_BUDDY, et.ConcatArgs(1))&lt;br /&gt;
		elseif arg0 == &amp;quot;say_teamnl&amp;quot; then&lt;br /&gt;
			return et_ClientSay( clientNum, et.SAY_TEAMNL, et.ConcatArgs(1))&lt;br /&gt;
		end&lt;br /&gt;
	-- et_ClientSay wrapper end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua]]&lt;/div&gt;</summary>
		<author><name>MSch</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Mod_API&amp;diff=2448</id>
		<title>Lua Mod API</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Lua_Mod_API&amp;diff=2448"/>
		<updated>2006-07-26T02:12:38Z</updated>

		<summary type="html">&lt;p&gt;MSch: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
[[ETPro]] now supports server-side mods via the [http://www.lua.org/ Lua] scripting language. For more information about Lua, visit the [http://www.lua.org/manual/5.0/ Reference manual], the online edition of the book [http://www.lua.org/pil/ Programming in Lua] or the [http://lua-users.org/wiki/ lua-users wiki].&lt;br /&gt;
&lt;br /&gt;
ETPro has an embedded Lua 5.0.2 interpreter, and if present will load user-defined scripts from the ETPro directory.  It also provides an &amp;quot;et&amp;quot; library of function calls for Lua that allow access to the server engine, and provides callbacks so a server side mod may trigger on specific server events.&lt;br /&gt;
&lt;br /&gt;
The following standard Lua libraries are initialized by default and available to ETPro Lua scripts:&lt;br /&gt;
[http://www.lua.org/manual/5.0/manual.html#5.1 basic], [http://www.lua.org/manual/5.0/manual.html#5.4 table], [http://www.lua.org/manual/5.0/manual.html#5.6 i/o], [http://www.lua.org/manual/5.0/manual.html#5.3 string], [http://www.lua.org/manual/5.0/manual.html#5.5 math].&lt;br /&gt;
&lt;br /&gt;
A list of ETPro mods can be found [[:Category:ETPro:Mods|here]].&lt;br /&gt;
&lt;br /&gt;
A tutorial about ETPro Lua scripting can be found [[Lua Tutorials|here]].&lt;br /&gt;
&lt;br /&gt;
API requests can be discussed at the [[Talk:Lua_Mod_API|Lua Mod API talk page]].&lt;br /&gt;
&lt;br /&gt;
==client commands==&lt;br /&gt;
===lua_status===&lt;br /&gt;
:lists all currently loaded lua modules.&lt;br /&gt;
:&#039;&#039;lua mods cannot override this client command.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==server commands==&lt;br /&gt;
===lua_status===&lt;br /&gt;
:lists all currently loaded lua modules.&lt;br /&gt;
&lt;br /&gt;
==cvars==&lt;br /&gt;
===lua_modules===&lt;br /&gt;
:(default &amp;quot;&amp;quot;, disabled)&lt;br /&gt;
:space separated list of lua modules for ETPro to load. modules will be run in the order listed.&lt;br /&gt;
&lt;br /&gt;
===lua_allowedmodules===&lt;br /&gt;
:(default &amp;quot;&amp;quot;, disabled)&lt;br /&gt;
:if set, only lua modules with the matching sha1 signatures listed in this cvar will be allowed to load.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
:changing either cvar will cause all currently loaded modules to :quit and be unloaded until the next map_restart.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==et library calls==&lt;br /&gt;
&lt;br /&gt;
===modules===&lt;br /&gt;
et.RegisterModname( &#039;&#039;&#039;modname&#039;&#039;&#039; )&lt;br /&gt;
:Registers a descriptive string &#039;&#039;&#039;modname&#039;&#039;&#039; for this mod.&lt;br /&gt;
&#039;&#039;&#039;vmnumber&#039;&#039;&#039; = et.FindSelf()&lt;br /&gt;
:Returns a number indicating the VM slot the current mod is loaded into.&lt;br /&gt;
&#039;&#039;&#039;modname&#039;&#039;&#039;, &#039;&#039;&#039;signature&#039;&#039;&#039; = et.FindMod( &#039;&#039;&#039;vmnumber&#039;&#039;&#039; )&lt;br /&gt;
:Returns the &#039;&#039;&#039;modname&#039;&#039;&#039; and sha1 &#039;&#039;&#039;signature&#039;&#039;&#039; for the mod loaded in the VM slot &#039;&#039;&#039;vmnumber&#039;&#039;&#039;. Returns nil, nil if the VM slot is invalid.&lt;br /&gt;
&#039;&#039;&#039;success&#039;&#039;&#039; = et.IPCSend( &#039;&#039;&#039;vmnumber&#039;&#039;&#039;, &#039;&#039;&#039;message&#039;&#039;&#039; )&lt;br /&gt;
:Sends the string &#039;&#039;&#039;message&#039;&#039;&#039; to the mod in the VM slot indicated by &#039;&#039;&#039;vmnumber&#039;&#039;&#039;. The mod receiving &#039;&#039;&#039;message&#039;&#039;&#039; must have an &#039;&#039;et_IPCReceive()&#039;&#039; callback. If the message is successfully sent, &#039;&#039;&#039;success&#039;&#039;&#039; will be 1. On failure it will be 0.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===printing===&lt;br /&gt;
et.G_Print( &#039;&#039;&#039;text&#039;&#039;&#039; )&lt;br /&gt;
:Prints the string &#039;&#039;&#039;text&#039;&#039;&#039; to the server console.&lt;br /&gt;
et.G_LogPrint( &#039;&#039;&#039;text&#039;&#039;&#039; )&lt;br /&gt;
:Prints the string &#039;&#039;&#039;text&#039;&#039;&#039; to the server console and writes it to the server log.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===argument handling===&lt;br /&gt;
These functions are to be used within the [[#commands|command callback functions]].&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;args&#039;&#039;&#039; = et.ConcatArgs( &#039;&#039;&#039;index&#039;&#039;&#039; )&lt;br /&gt;
:Returns all arguments beginning from &#039;&#039;&#039;index&#039;&#039;&#039; concatenated into a single string &#039;&#039;&#039;args&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;argcount&#039;&#039;&#039; = et.trap_Argc()&lt;br /&gt;
:Returns a number indicating the number of command line arguments in the command buffer.&lt;br /&gt;
&#039;&#039;&#039;arg&#039;&#039;&#039; = et.trap_Argv( &#039;&#039;&#039;argnum&#039;&#039;&#039; )&lt;br /&gt;
:Returns the contents of the command line argument &#039;&#039;&#039;argnum&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===cvars===&lt;br /&gt;
&#039;&#039;&#039;cvarvalue&#039;&#039;&#039; = et.trap_Cvar_Get( &#039;&#039;&#039;cvarname&#039;&#039;&#039; )&lt;br /&gt;
:Returns the value of the cvar &#039;&#039;&#039;cvarname&#039;&#039;&#039; as a string. If there is no cvar named &#039;&#039;&#039;cvarname&#039;&#039;&#039;, returns a zero length string. &lt;br /&gt;
et.trap_Cvar_Set( &#039;&#039;&#039;cvarname&#039;&#039;&#039;, &#039;&#039;&#039;cvarvalue&#039;&#039;&#039; )&lt;br /&gt;
:Sets the cvar &#039;&#039;&#039;cvarname&#039;&#039;&#039; to &#039;&#039;&#039;cvarvalue&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===configstrings===&lt;br /&gt;
&#039;&#039;&#039;configstringvalue&#039;&#039;&#039; = et.trap_GetConfigstring( &#039;&#039;&#039;index&#039;&#039;&#039; )&lt;br /&gt;
:Returns the string &#039;&#039;&#039;configstringvalue&#039;&#039;&#039; containing the contents of the configstring &#039;&#039;&#039;index&#039;&#039;&#039;&lt;br /&gt;
et.trap_SetConfigstring( &#039;&#039;&#039;index&#039;&#039;&#039;, &#039;&#039;&#039;configstringvalue&#039;&#039;&#039; )&lt;br /&gt;
:Sets the configstring &#039;&#039;&#039;index&#039;&#039;&#039; to the string &#039;&#039;&#039;configstringvalue&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===server===&lt;br /&gt;
et.trap_SendConsoleCommand( &#039;&#039;&#039;when&#039;&#039;&#039;, &#039;&#039;&#039;command&#039;&#039;&#039; )&lt;br /&gt;
:Sends the command &#039;&#039;&#039;command&#039;&#039;&#039; to the server console, to be executed &#039;&#039;&#039;when&#039;&#039;&#039; (see et.EXEC_* constants)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===clients===&lt;br /&gt;
et.trap_DropClient( &#039;&#039;&#039;clientnum&#039;&#039;&#039;, &#039;&#039;&#039;reason&#039;&#039;&#039;, &#039;&#039;&#039;ban_time&#039;&#039;&#039; )&lt;br /&gt;
:Disconnects &#039;&#039;&#039;clientnum&#039;&#039;&#039; from the server, with descriptive string &#039;&#039;&#039;reason&#039;&#039;&#039; reported to clients. &#039;&#039;&#039;ban_time&#039;&#039;&#039; is the time in seconds to ban the client from the server. &#039;&#039;&#039;ban_time&#039;&#039;&#039; is optional and may be entirely omitted, in which case the ban time defaults to the cvar &#039;&#039;b_defaultbantime&#039;&#039;&lt;br /&gt;
et.trap_SendServerCommand( &#039;&#039;&#039;clientnum&#039;&#039;&#039;, &#039;&#039;&#039;[[SendServerCommand|command]]&#039;&#039;&#039; )&lt;br /&gt;
:Sends the command &#039;&#039;&#039;[[SendServerCommand|command]]&#039;&#039;&#039; to the client &#039;&#039;&#039;clientnum&#039;&#039;&#039;. If &#039;&#039;&#039;clientnum&#039;&#039;&#039; is -1, the &#039;&#039;&#039;[[SendServerCommand|command]]&#039;&#039;&#039; is broadcast to all connected clients.&lt;br /&gt;
et.G_Say( &#039;&#039;&#039;clientNum&#039;&#039;&#039;, &#039;&#039;&#039;mode&#039;&#039;&#039;, &#039;&#039;&#039;text&#039;&#039;&#039; )&lt;br /&gt;
:Sends a chat command on behalf of client &#039;&#039;&#039;clientNum&#039;&#039;&#039; with the mode &#039;&#039;&#039;mode&#039;&#039;&#039; (see et.SAY_* constants) and chat text &#039;&#039;&#039;text&#039;&#039;&#039;.&lt;br /&gt;
et.ClientUserinfoChanged( &#039;&#039;&#039;clientNum&#039;&#039;&#039; )&lt;br /&gt;
:Loads the new Userinfo of &#039;&#039;&#039;clientNum&#039;&#039;&#039; and stores it in the configstring and client variables&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===userinfo===&lt;br /&gt;
&#039;&#039;&#039;userinfo&#039;&#039;&#039; = et.trap_GetUserinfo( &#039;&#039;&#039;clientnum&#039;&#039;&#039; )&lt;br /&gt;
:Returns the contents of the userinfo string for the client &#039;&#039;&#039;clientnum&#039;&#039;&#039;&lt;br /&gt;
et.trap_SetUserinfo( &#039;&#039;&#039;clientnum&#039;&#039;&#039;, &#039;&#039;&#039;userinfo&#039;&#039;&#039; )&lt;br /&gt;
:Sets the userinfo string for the client &#039;&#039;&#039;clientnum&#039;&#039;&#039; to &#039;&#039;&#039;userinfo&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===string utility functions===&lt;br /&gt;
&#039;&#039;&#039;infostring&#039;&#039;&#039; = et.Info_RemoveKey( &#039;&#039;&#039;infostring&#039;&#039;&#039;, &#039;&#039;&#039;key&#039;&#039;&#039; )&lt;br /&gt;
:Removes key &#039;&#039;&#039;key&#039;&#039;&#039; from infostring &#039;&#039;&#039;infostring&#039;&#039;&#039; and returns the modified infostring.&lt;br /&gt;
&#039;&#039;&#039;infostring&#039;&#039;&#039; = et.Info_SetValueForKey( &#039;&#039;&#039;infostring&#039;&#039;&#039;, &#039;&#039;&#039;key&#039;&#039;&#039;, &#039;&#039;&#039;value&#039;&#039;&#039; )&lt;br /&gt;
:Sets the key &#039;&#039;&#039;key&#039;&#039;&#039; in the infostring &#039;&#039;&#039;infostring&#039;&#039;&#039; to &#039;&#039;&#039;value&#039;&#039;&#039; and returns the modified infostring. If &#039;&#039;&#039;value&#039;&#039;&#039; is an empty string, &#039;&#039;&#039;key&#039;&#039;&#039; is removed from the string. &lt;br /&gt;
&#039;&#039;&#039;keyvalue&#039;&#039;&#039; = et.Info_ValueForKey( &#039;&#039;&#039;infostring&#039;&#039;&#039;, &#039;&#039;&#039;key&#039;&#039;&#039; )&lt;br /&gt;
:Returns the value of the key &#039;&#039;&#039;key&#039;&#039;&#039; in the infostring &#039;&#039;&#039;infostring&#039;&#039;&#039;. If &#039;&#039;&#039;key&#039;&#039;&#039; is not present in the string, an empty string is returned.&lt;br /&gt;
&#039;&#039;&#039;cleanstring&#039;&#039;&#039; = et.Q_CleanStr( &#039;&#039;&#039;string&#039;&#039;&#039; )&lt;br /&gt;
:Returns &#039;&#039;&#039;string&#039;&#039;&#039; stripped of all color codes&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ET filesystem===&lt;br /&gt;
&#039;&#039;&#039;fd&#039;&#039;&#039;, &#039;&#039;&#039;len&#039;&#039;&#039; = et.trap_FS_FOpenFile( &#039;&#039;&#039;filename&#039;&#039;&#039;, &#039;&#039;&#039;mode&#039;&#039;&#039; )&lt;br /&gt;
:Attempts to open the file &#039;&#039;&#039;filename&#039;&#039;&#039; with the access mode &#039;&#039;&#039;mode&#039;&#039;&#039; (see et.FS_ constants). Returns the filedescriptor &#039;&#039;&#039;fd&#039;&#039;&#039; and file length &#039;&#039;&#039;len&#039;&#039;&#039;. On error, &#039;&#039;&#039;len&#039;&#039;&#039; returns -1.&lt;br /&gt;
&#039;&#039;&#039;filedata&#039;&#039;&#039; = et.trap_FS_Read( fd, count )&lt;br /&gt;
:Reads &#039;&#039;&#039;count&#039;&#039;&#039; bytes from filedescriptor &#039;&#039;&#039;fd&#039;&#039;&#039;.&lt;br /&gt;
&#039;&#039;&#039;count&#039;&#039;&#039; = et.trap_FS_Write( &#039;&#039;&#039;filedata&#039;&#039;&#039;, &#039;&#039;&#039;count&#039;&#039;&#039;, &#039;&#039;&#039;fd&#039;&#039;&#039; )&lt;br /&gt;
:Attempts to write &#039;&#039;&#039;count&#039;&#039;&#039; bytes of &#039;&#039;&#039;filedata&#039;&#039;&#039; to filedescriptor &#039;&#039;&#039;fd&#039;&#039;&#039;. Returns number of bytes successfully written.&lt;br /&gt;
et.trap_FS_Rename( &#039;&#039;&#039;oldname&#039;&#039;&#039;, &#039;&#039;&#039;newname&#039;&#039;&#039; )&lt;br /&gt;
:Renames file &#039;&#039;&#039;oldname&#039;&#039;&#039; to &#039;&#039;&#039;newname&#039;&#039;&#039;.&lt;br /&gt;
et.trap_FS_FCloseFile( &#039;&#039;&#039;fd&#039;&#039;&#039; )&lt;br /&gt;
:Closes filedescriptor &#039;&#039;&#039;fd&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===indexes===&lt;br /&gt;
&#039;&#039;&#039;soundindex&#039;&#039;&#039; = et.G_SoundIndex( &#039;&#039;&#039;filename&#039;&#039;&#039; )&lt;br /&gt;
:Returns an index to the soundfile indicated by &#039;&#039;&#039;filename&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;modelindex&#039;&#039;&#039; = et.G_ModelIndex( &#039;&#039;&#039;filename&#039;&#039;&#039; )&lt;br /&gt;
:Returns an index to the model indicated by &#039;&#039;&#039;filename&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===sound===&lt;br /&gt;
et.G_globalSound( &#039;&#039;&#039;sound&#039;&#039;&#039; )&lt;br /&gt;
:Plays the global sound indicated by the filename &#039;&#039;&#039;sound&#039;&#039;&#039;.&lt;br /&gt;
et.G_Sound( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;soundindex&#039;&#039;&#039; )&lt;br /&gt;
:Plays the sound &#039;&#039;&#039;soundindex&#039;&#039;&#039; at the location of entity &#039;&#039;&#039;entnum&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===miscellaneous===&lt;br /&gt;
&#039;&#039;&#039;milliseconds&#039;&#039;&#039; = et.trap_Milliseconds()&lt;br /&gt;
:Returns a number indicating the current server time in milliseconds.&lt;br /&gt;
et.G_Damage( &#039;&#039;&#039;target&#039;&#039;&#039;, &#039;&#039;&#039;inflictor&#039;&#039;&#039;, &#039;&#039;&#039;attacker&#039;&#039;&#039;, &#039;&#039;&#039;damage&#039;&#039;&#039;, &#039;&#039;&#039;[[etdamage|dflags]]&#039;&#039;&#039;, &#039;&#039;&#039;[[etdamage|mod]]&#039;&#039;&#039; )&lt;br /&gt;
:Does &#039;&#039;&#039;damage&#039;&#039;&#039; amount of damage on &#039;&#039;&#039;target&#039;&#039;&#039; inflicted by &#039;&#039;&#039;inflictor&#039;&#039;&#039; and cased by &#039;&#039;&#039;attacker&#039;&#039;&#039;&lt;br /&gt;
:&#039;&#039;&#039;target&#039;&#039;&#039;, &#039;&#039;&#039;inflictor&#039;&#039;&#039;, &#039;&#039;&#039;attacker&#039;&#039;&#039; are entity numbers&lt;br /&gt;
:&#039;&#039;&#039;[[etdamage|dflags]]&#039;&#039;&#039; is a [[Bitmask-cvar|bitflag]] number to decide how the damage is inflickted, see &#039;&#039;&#039;[[etdamage|dflags]]&#039;&#039;&#039; [[etdamage|flaglist]]&lt;br /&gt;
:&#039;&#039;&#039;[[etdamage|mod]]&#039;&#039;&#039; is a number from 0 up to 64 o set the type of damage, see &#039;&#039;&#039;[[etdamage|mod]]&#039;&#039;&#039; [[etdamage|list]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===entities===&lt;br /&gt;
&#039;&#039;&#039;entnum&#039;&#039;&#039; = et.G_Spawn()&lt;br /&gt;
:Spawns a new entity and returns the new entity number.&lt;br /&gt;
&#039;&#039;&#039;entnum&#039;&#039;&#039; = et.G_TempEntity( &#039;&#039;&#039;origin&#039;&#039;&#039;, &#039;&#039;&#039;event&#039;&#039;&#039; )&lt;br /&gt;
:Spawns a new TempEntity of event type &#039;&#039;&#039;event&#039;&#039;&#039; and places it at &#039;&#039;&#039;origin&#039;&#039;&#039; in the world.&lt;br /&gt;
:&#039;&#039;&#039;Warning:&#039;&#039;&#039; up to and including ETPro 3.2.4 the signature of the method is broken and expects four instead of two parameters. To successfully call it, you need to prepend the parameter list with two dummy parameters like et.G_TempEntity( 0, 0, origin, event ). Use this method with care, because in future ETPro versions it will probably be corrected to the one stated above and might break your script.&lt;br /&gt;
et.G_FreeEntity( &#039;&#039;&#039;entnum&#039;&#039;&#039; )&lt;br /&gt;
:Frees the entity &#039;&#039;&#039;entnum&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;spawnval&#039;&#039;&#039; = et.G_GetSpawnVar( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;key&#039;&#039;&#039; )&lt;br /&gt;
:Returns the value of spawnvar &#039;&#039;&#039;key&#039;&#039;&#039; for entity &#039;&#039;&#039;entnum&#039;&#039;&#039;&lt;br /&gt;
et.G_SetSpawnVar( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;key&#039;&#039;&#039;, &#039;&#039;&#039;value&#039;&#039;&#039; )&lt;br /&gt;
:Sets the spawnvar &#039;&#039;&#039;key&#039;&#039;&#039; to &#039;&#039;&#039;value&#039;&#039;&#039; for entity &#039;&#039;&#039;entnum&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;integer entnum&#039;&#039;&#039; = et.G_SpawnGEntityFromSpawnVars( string spawnvar, string spawnvalue, ... )&lt;br /&gt;
:This function can only be called inside the &#039;&#039;&#039;et_InitGame&#039;&#039;&#039; callback&lt;br /&gt;
et.trap_LinkEntity( &#039;&#039;&#039;entnum&#039;&#039;&#039; )&lt;br /&gt;
:Links the entity &#039;&#039;&#039;entnum&#039;&#039;&#039;&lt;br /&gt;
et.trap_UnlinkEntity( &#039;&#039;&#039;entnum&#039;&#039;&#039; )&lt;br /&gt;
:Unlinks the entity &#039;&#039;&#039;entnum&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;(variable)&#039;&#039;&#039; = et.gentity_get ( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039; &#039;&#039;,arrayindex&#039;&#039; )&lt;br /&gt;
:Gets the value of &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039; from entity &#039;&#039;&#039;entnum&#039;&#039;&#039; out of the g_entity struct. For NULL entities or clients, &#039;&#039;nil&#039;&#039; is returned.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;arrayindex&#039;&#039; is used to specify which element of an array entity field to get. It is required when accessing array type fields. Entity field array indexes start at 0.&lt;br /&gt;
et.gentity_set( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039;, &#039;&#039;arrayindex,&#039;&#039; &#039;&#039;&#039;(value)&#039;&#039;&#039; )&lt;br /&gt;
:Sets the value of &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039; from entity &#039;&#039;&#039;entnum&#039;&#039;&#039; in the g_entity struct to &#039;&#039;&#039;(value)&#039;&#039;&#039;&lt;br /&gt;
:&#039;&#039;arrayindex&#039;&#039; is used to specify which element of an array entity field to set.&lt;br /&gt;
et.G_AddEvent( &#039;&#039;&#039;ent&#039;&#039;&#039;, &#039;&#039;&#039;event&#039;&#039;&#039;, &#039;&#039;&#039;eventparm&#039;&#039;&#039;&#039; )&lt;br /&gt;
:Adds event &#039;&#039;&#039;event&#039;&#039;&#039; whit eventparameter &#039;&#039;&#039;eventparm&#039;&#039;&#039;&#039; to entity &#039;&#039;&#039;ent&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==callbacks==&lt;br /&gt;
&lt;br /&gt;
===qagame execution===&lt;br /&gt;
et_InitGame( &#039;&#039;&#039;levelTime&#039;&#039;&#039;, &#039;&#039;&#039;randomSeed&#039;&#039;&#039;, &#039;&#039;&#039;restart&#039;&#039;&#039; )&lt;br /&gt;
:Called when qagame initializes. &#039;&#039;&#039;levelTime&#039;&#039;&#039; is the current level time in milliseconds. &#039;&#039;&#039;randomSeed&#039;&#039;&#039; is a number that can be used to seed random number generators. &#039;&#039;&#039;restart&#039;&#039;&#039; indicates if et_InitGame() is being called due to a map restart (1) or not (0).&lt;br /&gt;
et_ShutdownGame( &#039;&#039;&#039;restart&#039;&#039;&#039; )&lt;br /&gt;
:Called when qagame shuts down. &#039;&#039;&#039;restart&#039;&#039;&#039; indicates if the shutdown is being called due to a map_restart (1) or not (0).&lt;br /&gt;
et_RunFrame( &#039;&#039;&#039;levelTime&#039;&#039;&#039; )&lt;br /&gt;
:Called when qagame runs a server frame. &#039;&#039;&#039;levelTime&#039;&#039;&#039; is the current level time in milliseconds.&lt;br /&gt;
et_Quit()&lt;br /&gt;
:Called when ETPro unloads the mod. The mod should close all open filedescriptors and perform all cleanup.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===client management===&lt;br /&gt;
&#039;&#039;&#039;rejectreason&#039;&#039;&#039; = et_ClientConnect( &#039;&#039;&#039;clientNum&#039;&#039;&#039;, &#039;&#039;&#039;firstTime&#039;&#039;&#039;, &#039;&#039;&#039;isBot&#039;&#039;&#039; )&lt;br /&gt;
:Called when a client attempts to connect to the server. &#039;&#039;&#039;clientNum&#039;&#039;&#039; is the client slot id, &#039;&#039;&#039;firstTime&#039;&#039;&#039; indicates if this is a new connection (1) or a reconnection (0). &#039;&#039;&#039;isBot&#039;&#039;&#039; indicates if the client is a bot (1) or not (0). If the mod accepts the connection, it should return nil. Otherwise, the mod should return a string describing the reason the client connection was rejected.&lt;br /&gt;
et_ClientDisconnect( &#039;&#039;&#039;clientNum&#039;&#039;&#039; )&lt;br /&gt;
:Called when a client disconnects. &#039;&#039;&#039;clientNum&#039;&#039;&#039; is the client slot id.&lt;br /&gt;
et_ClientBegin( &#039;&#039;&#039;clientNum&#039;&#039;&#039; )&lt;br /&gt;
:Called when a client begins (becomes active, and enters the gameworld). &#039;&#039;&#039;clientNum&#039;&#039;&#039; is the client slot id.&lt;br /&gt;
et_ClientUserinfoChanged( &#039;&#039;&#039;clientNum&#039;&#039;&#039; )&lt;br /&gt;
:Called when a client&#039;s Userinfo string has changed. &#039;&#039;&#039;clientNum&#039;&#039;&#039; is the client slot id.&lt;br /&gt;
et_ClientSpawn( &#039;&#039;&#039;clientNum&#039;&#039;&#039;, &#039;&#039;&#039;revived&#039;&#039;&#039; )&lt;br /&gt;
:Called when a client is spawned. &#039;&#039;&#039;clientNum&#039;&#039;&#039; is the client slot id. &#039;&#039;&#039;revived&#039;&#039;&#039; is 1 if the client was spawned by beeying revived.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===commands===&lt;br /&gt;
&#039;&#039;&#039;intercepted&#039;&#039;&#039; = et_ClientCommand( &#039;&#039;&#039;clientNum&#039;&#039;&#039;, &#039;&#039;&#039;command&#039;&#039;&#039; )&lt;br /&gt;
:Called when a command is received from a client. &#039;&#039;&#039;clientNum&#039;&#039;&#039; is the client slot id. &#039;&#039;&#039;command&#039;&#039;&#039; is the command. The mod should return 1 if the command was intercepted by the mod, and 0 if the command was ignored by the mod and should be passed through to the server (and other mods in the chain).&lt;br /&gt;
:The actual command can be accessed through the [[#argument_handling|argument handling]] functions, as seen in the [[ETPro:Lua Sample Code]].&lt;br /&gt;
&#039;&#039;&#039;intercepted&#039;&#039;&#039; = et_ConsoleCommand()&lt;br /&gt;
:Called when a command is entered on the server console. The mod should return 1 if the command was intercepted by the mod, and 0 if the command was ignored by the mod and should be passed through to the server (and other mods in the chain).&lt;br /&gt;
:The actual command can be accessed through the [[#argument_handling|argument handling]] functions, as seen in the [[ETPro:Lua Sample Code]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===xp===&lt;br /&gt;
et_UpgradeSkill( &#039;&#039;&#039;cno&#039;&#039;&#039;, &#039;&#039;&#039;skill&#039;&#039;&#039; )&lt;br /&gt;
:Called when client on slot &#039;&#039;&#039;cno&#039;&#039;&#039; gets a skill upgrade on skill &#039;&#039;&#039;skill&#039;&#039;&#039;, return -1 to override (abort) the qagame function, anything else to &amp;quot;passthrough&amp;quot; callback may modify skills (or do anything else it wants) during passthrough. &lt;br /&gt;
et_UpgradeSkill( &#039;&#039;&#039;cno&#039;&#039;&#039;, &#039;&#039;&#039;skill&#039;&#039;&#039; )&lt;br /&gt;
:Called when client &#039;&#039;&#039;cno&#039;&#039;&#039; his skill level of &#039;&#039;&#039;skill&#039;&#039;&#039; is set, return -1 to override (abort) the qagame function, anything else to &amp;quot;passthrough&amp;quot; callback may modify skills (or do anything else it wants) during passthrough.&lt;br /&gt;
&lt;br /&gt;
===miscellaneous===&lt;br /&gt;
et_IPCReceive( &#039;&#039;&#039;vmnumber&#039;&#039;&#039;, &#039;&#039;&#039;message&#039;&#039;&#039; )&lt;br /&gt;
:Called when another mod sends an et.IPCSend() message to this mod. &#039;&#039;&#039;vmnumber&#039;&#039;&#039; is the VM slot number of the sender, and &#039;&#039;&#039;message&#039;&#039;&#039; is the message.&lt;br /&gt;
et_Print( &#039;&#039;&#039;text&#039;&#039;&#039; )&lt;br /&gt;
:Called whenever the server or qagame prints a string to the console.&lt;br /&gt;
et_Obituary( &#039;&#039;&#039;victim&#039;&#039;&#039;, &#039;&#039;&#039;killer&#039;&#039;&#039;, &#039;&#039;&#039;meansOfDeath&#039;&#039;&#039; )&lt;br /&gt;
:Called whenever a player is killed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==predefined constants==&lt;br /&gt;
et.EXEC_NOW&amp;lt;br&amp;gt;&lt;br /&gt;
et.EXEC_INSERT&amp;lt;br&amp;gt;&lt;br /&gt;
et.EXEC_APPEND&amp;lt;br&amp;gt;&lt;br /&gt;
et.FS_READ&amp;lt;br&amp;gt;&lt;br /&gt;
et.FS_WRITE&amp;lt;br&amp;gt;&lt;br /&gt;
et.FS_APPEND&amp;lt;br&amp;gt;&lt;br /&gt;
et.FS_APPEND_SYNC&amp;lt;br&amp;gt;&lt;br /&gt;
et.SAY_ALL&amp;lt;br&amp;gt;&lt;br /&gt;
et.SAY_TEAM&amp;lt;br&amp;gt;&lt;br /&gt;
et.SAY_BUDDY&amp;lt;br&amp;gt;&lt;br /&gt;
et.SAY_TEAMNL&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
et.HOSTARCH&lt;br /&gt;
:set to WIN32 or UNIX depending on the host architecture qagame is running on.&lt;br /&gt;
LUA_PATH&lt;br /&gt;
:set to fs_homepath/fs_game/?.lua in order to ease use of the [http://www.lua.org/pil/8.1.html require] function.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==configs==&lt;br /&gt;
If a config is loaded, all modules are shutdown and reloaded. If a &#039;&#039;certified&#039;&#039; config is loaded, all modules are shutdown and reloaded, and additionally the following functions are disabled: &#039;&#039;&#039;require()&#039;&#039;&#039;, &#039;&#039;&#039;loadfile()&#039;&#039;&#039;, &#039;&#039;&#039;loadlib()&#039;&#039;&#039;, &#039;&#039;&#039;loadstring()&#039;&#039;&#039;, &#039;&#039;&#039;dofile()&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==caveats==&lt;br /&gt;
Like qagame, lua modules are unloaded and reloaded on map_restart and map changes. This means that all global variables and other information is lost. Mods may choose to store persistent data in cvars or external files.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
&lt;br /&gt;
Q: OMG I hate the libary prefix et.* on everything!!11!1oneone&amp;lt;br&amp;gt;&lt;br /&gt;
A: table.foreach(et, function (func, value) _G[func] = value; end)&lt;br /&gt;
&lt;br /&gt;
Q: How do a reload my lua file without restarting the whole server?&amp;lt;br&amp;gt;&lt;br /&gt;
A: Change maps, use map_restart or reset_match&lt;br /&gt;
&lt;br /&gt;
Q: Can I see some sample code?&amp;lt;br&amp;gt;&lt;br /&gt;
A: [[ETPro:Lua Sample Code|Lua sample code]]&lt;br /&gt;
&lt;br /&gt;
Q: Is there a list of [[ETPro]] mods?&amp;lt;br&amp;gt;&lt;br /&gt;
A: Yes, [[:Category:ETPro:Mods|here]].&lt;br /&gt;
&lt;br /&gt;
Q: OMG my mod doesn&#039;t work!&amp;lt;br&amp;gt;&lt;br /&gt;
A: Make sure you added your mod&#039;s filename to the lua_modules cvar (e.g. set lua_modules mymod.lua).&lt;br /&gt;
&lt;br /&gt;
Q: OMG why has et_ClientSay been removed?&amp;lt;br&amp;gt;&lt;br /&gt;
A: Thats a secret but, to keep the function as it was, just add the following code to your et_ClientCommand() function&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;	-- et_ClientSay had to be removed in order to intercept all commands &lt;br /&gt;
	-- so here&#039;s a wrapper for that&lt;br /&gt;
		arg0 = et.trap_Argv(0) -- get the main command&lt;br /&gt;
		&lt;br /&gt;
		if arg0 == &amp;quot;say&amp;quot; then&lt;br /&gt;
			return et_ClientSay( clientNum, et.SAY_ALL, et.ConcatArgs(1))&lt;br /&gt;
		elseif arg0 == &amp;quot;say_team&amp;quot; then&lt;br /&gt;
			return et_ClientSay( clientNum, et.SAY_TEAM, et.ConcatArgs(1))&lt;br /&gt;
		elseif arg0 == &amp;quot;say_buddy&amp;quot; then&lt;br /&gt;
			return et_ClientSay( clientNum, et.SAY_BUDDY, et.ConcatArgs(1))&lt;br /&gt;
		elseif arg0 == &amp;quot;say_teamnl&amp;quot; then&lt;br /&gt;
			return et_ClientSay( clientNum, et.SAY_TEAMNL, et.ConcatArgs(1))&lt;br /&gt;
		end&lt;br /&gt;
	-- et_ClientSay wrapper end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua]]&lt;/div&gt;</summary>
		<author><name>MSch</name></author>
	</entry>
</feed>