<?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=%3DFF%3Dim2good4u</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=%3DFF%3Dim2good4u"/>
	<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php/Special:Contributions/%3DFF%3Dim2good4u"/>
	<updated>2026-11-08T12:37:22Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2494</id>
		<title>Lua Tutorials</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2494"/>
		<updated>2006-08-29T16:35:12Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: command dumpuserid part 2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
This page is here to help you understand [[ETPro]] [http://www.lua.org/ Lua] functions.&lt;br /&gt;
&lt;br /&gt;
Before you start on this tutorial I assume you know basic [http://www.lua.org/ Lua] scripting.  If not then I suggest you take a look at 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;
You can also take a look at code made by someone else, a list of [[ETPro]] mods that can be found [[:Category:ETPro:Mods|here]], or our [[ETPro:Lua Sample Code|Lua Sample Code]].&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
===Loading a Script===&lt;br /&gt;
:Scripts are loaded by their file name out of the /etpro sub directory of your Enemy Territory installation, so don&#039;t forget to save them in the right folder.&amp;lt;br&amp;gt;&lt;br /&gt;
:if you want to load HelloWorld.lua you would have to set the server cvar &#039;&#039;&#039;lua_modules&#039;&#039;&#039; to &#039;&#039;&amp;quot;HelloWorld.lua&amp;quot;&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
:If you want to load more mods you can add them to the same variables separated by a space like &#039;&#039;&amp;quot;HelloWorld.lua lol.lua pingpong.lua&amp;quot;&#039;&#039;&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you modify this cvar all currently loaded [http://www.lua.org/ lua] modules will be unloaded.&lt;br /&gt;
&lt;br /&gt;
:After editing your script you save it and then reload it in [[ETPro]] to make your chances take effect, this can simply be done by &#039;&#039;&#039;reset_match&#039;&#039;&#039; server command.&lt;br /&gt;
&lt;br /&gt;
===Development Environment===&lt;br /&gt;
:While scripting you will see your code gets hard to read, its much easier to read with syntax highlighting. This can be done by scripting inside an [http://www.lua.org/ lua] development environment.&lt;br /&gt;
&lt;br /&gt;
:These can be found under the &#039;&#039;Development Environments&#039;&#039; heading at  [http://lua-users.org/wiki/LuaAddons this page].&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Lines written in &#039;&#039;&#039;Bold&#039;&#039;&#039; are the actual lines we are going to write in our scripts.&lt;br /&gt;
===Hello World===&lt;br /&gt;
:Here we will show a simple hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloWorld.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. Therefore we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039;. That function is called once every round at the beginning. It&#039;s a good function to do some initial settings. We do not have to worry about those parameters (levelTime,randomSeed,restart) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) -- called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console.&lt;br /&gt;
&lt;br /&gt;
:3. At line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello World!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end out function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloWorld.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello World!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the server console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Spam===&lt;br /&gt;
:Here we will show a simple Spammy hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloSpam.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] many times to make it spammy. Therefore we will use &#039;&#039;et_RunFrame(levelTime)&#039;&#039;. That function is called every server frame. It is a good function for stuff you need to constantly check but you should not put to much code in here. We do not have to worry about those parameter (levelTime) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_RunFrame(levelTime) --called every serverframe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so, now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;; that function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console&lt;br /&gt;
&lt;br /&gt;
:3. Now at line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello Spam!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end our function at line &#039;&#039;1&#039;&#039; with a simple at line &#039;&#039;3&#039;&#039; &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_RunFrame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloSpam.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_RunFrame(levelTime) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--called every serverframe&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello Spam!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_RunFrame()&amp;lt;/font&amp;gt;&lt;br /&gt;
::Now save and load your script and you will see Hello Spam!!! in the server console.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Client===&lt;br /&gt;
:Here we will show a simple hello world example for the client console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloClient.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need a [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. To do this we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039; as shown in the &#039;&#039;Hello World&#039;&#039; example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) --called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we need a function to print a message to the client his console. We will use et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;message\n\&amp;quot;&amp;quot;)&#039;&#039; to achieve this. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the client&#039;s console.&lt;br /&gt;
::The first parameter is the client slot to send to. When this is -1 ETPro will send the message to all clients. The 2nd parameter looks confusing and like the original author&#039;s spelling, it is. First you have the main command witch is &amp;quot;print  ..&amp;quot;. Then, at the place of the dots, comes the data to send with the print. In our case this is &amp;quot;message\n&amp;quot;&amp;quot;.&lt;br /&gt;
::The \n will send a newline command to the console so the next message written to the console is on the next line. The \&amp;quot; are just quotes but since they are already inside a string you need to prefix them with a \ (commonly known as an escape character).&lt;br /&gt;
&lt;br /&gt;
:3. So just write this at line &#039;&#039;2&#039;&#039; &#039;&#039;&#039;    et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Last we need to end our function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloClient.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.trap_SendServerCommand(-&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;,&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the client&#039;s console at the begin of a round.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Server Command lol===&lt;br /&gt;
:Here we will show how to make a new server command that will simply print &#039;&#039;hihi&#039;&#039;.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need to create a new file for the script.  Create a new file and name it &#039;&#039;ServerCmdLol.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::To start we need an ETPro Lua function that will be called automatically by ETPro when a certain server command has been entered.&lt;br /&gt;
::To do this we will use et_ConsoleCommand()&#039;&#039;.&lt;br /&gt;
::It is called for every server command but not for engine commands like &#039;&#039;say&#039;&#039;,&#039;&#039;broadcast&#039;&#039;,&#039;&#039;echo&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_ConsoleCommand()--called when someone types a command in conosle or uses sa todo a server command&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now the first thing we need to know is what command was entered.&lt;br /&gt;
::Commands that are entered will be split up by spaces, so &#039;&#039;cmd1 hello all&#039;&#039; will be split up into &amp;quot;cmd1&amp;quot;, &amp;quot;hello&amp;quot; and &amp;quot;all&amp;quot;.&lt;br /&gt;
::The only exception is that &#039;&#039;cmd2 &amp;quot;hello all&amp;quot;&#039;&#039; will be split up in &amp;quot;cmd2&amp;quot; and &amp;quot;hello all&amp;quot; because, &amp;quot;hello all&amp;quot; is entered as one string by enclosing them in quotes.&lt;br /&gt;
::To get a part of the command you should use et.trap_Argv(&#039;&#039;partnumber&#039;&#039;)&lt;br /&gt;
::&#039;&#039;partnumber&#039;&#039; 0 is the actual command and, &#039;&#039;partnumber&#039;&#039; 1 is the first parameter of the command&lt;br /&gt;
:: so in our example above we would get:&lt;br /&gt;
:::et.trap_Argv(0) = &amp;quot;cmd1&amp;quot;&lt;br /&gt;
:::et.trap_Argv(1) = &amp;quot;hello&amp;quot;&lt;br /&gt;
:::et.trap_Argv(2) = &amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:3. At line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;	local cmd = et.trap_Argv(0) --load out the first parameter of the test typed in console (the command itself)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::The commands are sent the same way they were entered, so if you enter &#039;&#039;cMd3&#039;&#039; you will get &#039;&#039;cMd3&#039;&#039;.&lt;br /&gt;
::To detect all variations, we will convert the string to lowercase using a normal Lua function.&lt;br /&gt;
&lt;br /&gt;
:4. To make it lower case we will write &#039;&#039;&#039;	cmd = string.lower(cmd) --convert it to lowercase so it is easier to match in our if statements&#039;&#039;&#039; at line &#039;&#039;3&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we can use a simple &#039;&#039;if&#039;&#039; statement to check if the command is &#039;&#039;lol&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:5. At line &#039;&#039;4&#039;&#039; write &#039;&#039;&#039;	if cmd == &amp;quot;lol&amp;quot; then --run our code if the command was &amp;quot;lol&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::If thats true then the script should print &amp;quot;hihi&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:6. To do this, at line &#039;&#039;5&#039;&#039; write &#039;&#039;&#039;        et.G_Print(&amp;quot;hihi\n&amp;quot;) --print out &amp;quot;hihi&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now that we have handled the command in our [[ETPro]] [http://www.lua.org/ Lua] script, we do not need to send it to the normal ETPro code since that will return &amp;quot;Unknown Command&amp;quot; anyway.&lt;br /&gt;
::We can let ETPro ignore the command by returning 1 out of our function.&lt;br /&gt;
&lt;br /&gt;
:7. So at line &#039;&#039;6&#039;&#039; we will write &#039;&#039;&#039;        return 1 --return 1 to make ETPro ignore the command so you wont get an &#039;invalid command&#039; warning&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Thats all we need to do for this command so we can start closing our function&lt;br /&gt;
&lt;br /&gt;
:8. At line &#039;&#039;7&#039;&#039; we end our if statement of line &#039;&#039;4&#039;&#039; so we will write &#039;&#039;&#039;	end                       	--close the if at line 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we get to the code that gets executed when the command was not &#039;&#039;lol&#039;&#039;.&lt;br /&gt;
::We got nothing todo here so we will return 0 to make [[ETPro]] handle it.&lt;br /&gt;
&lt;br /&gt;
:9. To make ETPro handle all other commands, write &#039;&#039;&#039;	return 0 --if the command wasnt &#039;lol&#039; then we will get here and return 0 to make ETPro handle it&#039;&#039;&#039; at line &#039;&#039;8&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we are almost done just end our function.&lt;br /&gt;
&lt;br /&gt;
:10. So at line &#039;&#039;9&#039;&#039; we will write &#039;&#039;&#039;end --close function et_ConsoleCommand() at line 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/ServerCmdLol.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ConsoleCommand() &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--called when someone types a cokmmand in conosle or uses sa todo a server command&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;local&amp;lt;/font&amp;gt; cmd = et.trap_Argv(&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--load out the first parameter of the test typed in console (the command itself)&amp;lt;/font&amp;gt;&lt;br /&gt;
     cmd = string.lower(cmd) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--convert it to lower case so its easyer to match in our if statements&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; cmd == &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;lol&amp;quot;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--run our code if the command was &#039;lol&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
         et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;hihi\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--print out &#039;hihi&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--return 1 to make etpro ignore the command so u wont get an &#039;invalid command&#039; warning&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close the if at line 7&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--if the command wasnt &#039;lol&#039; then we will get here and return 0 to make etpro handle it&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- close et_ConsoleCommand()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will be able to use &#039;&#039;lol&#039;&#039; as a server command.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Server Command Dumpuserid===&lt;br /&gt;
:Here we will show how to make a new server command that will simply preform a the dumpuser cmd on the name of the client slot we enter.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need to create a new file for the script.  Create a new file and name it &#039;&#039;ServerCmdDumpuserid.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::To start we need an ETPro Lua function that will be called automatically by ETPro when a certain server command has been entered.&lt;br /&gt;
::To do this we will use et_ConsoleCommand()&#039;&#039;.&lt;br /&gt;
::It is called for every server command but not for engine commands like &#039;&#039;say&#039;&#039;,&#039;&#039;broadcast&#039;&#039;,&#039;&#039;echo&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_ConsoleCommand() --called when someone types a command in conosle or uses sa todo a server command&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now the first thing we need to know is what command was entered.&lt;br /&gt;
::Commands that are entered will be split up by spaces, so &#039;&#039;cmd1 hello all&#039;&#039; will be split up into &amp;quot;cmd1&amp;quot;, &amp;quot;hello&amp;quot; and &amp;quot;all&amp;quot;.&lt;br /&gt;
::The only exception is that &#039;&#039;cmd2 &amp;quot;hello all&amp;quot;&#039;&#039; will be split up in &amp;quot;cmd2&amp;quot; and &amp;quot;hello all&amp;quot; because, &amp;quot;hello all&amp;quot; is entered as one string by enclosing them in quotes.&lt;br /&gt;
::To get a part of the command you should use et.trap_Argv(&#039;&#039;partnumber&#039;&#039;)&lt;br /&gt;
::&#039;&#039;partnumber&#039;&#039; 0 is the actual command and, &#039;&#039;partnumber&#039;&#039; 1 is the first parameter of the command&lt;br /&gt;
:: so in our example above we would get:&lt;br /&gt;
:::et.trap_Argv(0) = &amp;quot;cmd1&amp;quot;&lt;br /&gt;
:::et.trap_Argv(1) = &amp;quot;hello&amp;quot;&lt;br /&gt;
:::et.trap_Argv(2) = &amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:3. At line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;	local cmd = et.trap_Argv(0) --load out the first parameter of the test typed in console (the command itself)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::The commands are sent the same way they were entered, so if you enter &#039;&#039;cMd3&#039;&#039; you will get &#039;&#039;cMd3&#039;&#039;.&lt;br /&gt;
::To detect all variations, we will convert the string to lowercase using a normal Lua function.&lt;br /&gt;
&lt;br /&gt;
:4. To make it lower case we will write &#039;&#039;&#039;	cmd = string.lower(cmd) --convert it to lowercase so it is easier to match in our if statements&#039;&#039;&#039; at line &#039;&#039;3&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we can use a simple &#039;&#039;if&#039;&#039; statement to check if the command is &#039;&#039;dumpuserid&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:5. At line &#039;&#039;4&#039;&#039; write &#039;&#039;&#039;	if cmd == &amp;quot;dumpuserid&amp;quot; then --run our code if the command was &amp;quot;dumpuserid&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::If thats true then we need to know witch client id to dump the userinfo from, therefor we just load in the 2nd comand parameter whit et.trap_Argv(1).&lt;br /&gt;
&lt;br /&gt;
:6. To do this, at line &#039;&#039;5&#039;&#039; write &#039;&#039;&#039;        local id = et.trap_Argv(1) --load out the first parameter the command (the userid to dump)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::now we got the 2nd parameter as string, the first thing we do now is check if it isnt an empty string (&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
:7. So at line &#039;&#039;6&#039;&#039; write &#039;&#039;&#039;     	if id ~= &amp;quot;&amp;quot; then --check if parameter1 isnt empty&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::if its not an empty string then we wil contiune but if it is we will print back an error. We will get to the error later at line &#039;&#039;17&#039;&#039;. Now we will go on whit the next step. We will convert our string to a number this way, we not only get it as a number but, we can also get a nil if it can be coverted so, we can see if the 2nd parameter of the command is a real number and not a word.&lt;br /&gt;
&lt;br /&gt;
:8. so at line &#039;&#039;7&#039;&#039; write &#039;&#039;&#039;    		local idnumber = tonumber(id) --get a number out of the string&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we will check if its a real number and not a nil. Todo this we can simpely check if its &#039;true&#039; since only &#039;nil&#039; and &#039;false&#039; are &#039;false&#039; in lua. If its &#039;false&#039; we will print back an error but we will handle that at line &#039;&#039;15&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:9. Todo this we will write at line &#039;&#039;8&#039;&#039; &#039;&#039;&#039;    		if idnumber then --check if its not a nil&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we go on assuming we got a normal client slot id so we will try to parse his name. there are 3 ways to parse a name but i use the most simpel one. the other ways are to get it out of a configstring or userinfo. but we will use the  et.gentity_get() on the &#039;pers.netname&#039;&lt;br /&gt;
&lt;br /&gt;
:10. So at line &#039;&#039;9&#039;&#039; we write &#039;&#039;&#039;        		local idnickname = et.gentity_get(id,&amp;quot;pers.netname&amp;quot;) --get the player name for player slot &amp;quot;id&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if the person entered a wrong number where there is no client connected then we get an enpty string so first we now check if our string is not empty. if its empty we will print an error but we handle that at line &#039;&#039;13&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:11. At line &#039;&#039;10&#039;&#039; write &#039;&#039;&#039;        		if idnickname ~= &amp;quot;&amp;quot; then --check if the username isnt empty&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we go on. We got a username so wut we can do next is make a server command whit it&lt;br /&gt;
&lt;br /&gt;
:12. At line &#039;&#039;11&#039;&#039; write &#039;&#039;&#039;        			local servercommand = &amp;quot;dumpuser &amp;quot;.. idnickname --create the command to send back to the server&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Oke now its ready to send to the server as a command this is done by et.trap_SendConsoleCommand()&lt;br /&gt;
&lt;br /&gt;
:13. So at line &#039;&#039;12&#039;&#039; write &#039;&#039;&#039;            		et.trap_SendConsoleCommand(et.EXEC_APPEND,servercommand) --send our command to the server tobe executed&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we are done all that left now is to close the stuff up and add the error messages for when one of our if statements return false. first we add the error message for the ifstatement of line &#039;&#039;10&#039;&#039;. we make an else whit a et.G_Print()&lt;br /&gt;
&lt;br /&gt;
:14. at line &#039;&#039;13&#039;&#039; write &#039;&#039;&#039;            	else et.G_Print(&amp;quot;Player &amp;quot;.. id ..&amp;quot; is not on the server\n&amp;quot;) --warning message if the used a wrong slot number&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now Close the if at line &#039;&#039;10&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:15. at line &#039;&#039;14&#039;&#039; write &#039;&#039;&#039;            	end --close the if at line 10&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now the error message for the if at line &#039;&#039;8&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:16. at line &#039;&#039;15&#039;&#039; write &#039;&#039;&#039; 			else et.G_Print(&amp;quot;invalid player slot, useage: dumpuserid &amp;lt;player slot&amp;gt;\n&amp;quot;) --print out a warning that they have to enter player slot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now Close the if at line &#039;&#039;8&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:17. at line &#039;&#039;16&#039;&#039; write &#039;&#039;&#039;            end --close the if at line 12&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now the error message for the if at line &#039;&#039;6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:18. at line &#039;&#039;17&#039;&#039; write &#039;&#039;&#039;		else et.G_Print(&amp;quot;invalid player slot, useage: dumpuserid &amp;lt;player slot&amp;gt;\n&amp;quot;) --print out a warning that they have to enter player slot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Close the if at line &#039;&#039;18&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:19. at line &#039;&#039;18&#039;&#039; write  &#039;&#039;18&#039;&#039; write &#039;&#039;&#039;		end --close the if at line 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::If u look carefulle u will see that all the thing we did so far are all whitin the first if statement that checks if the command is &amp;quot;dumpuserid&amp;quot;. We are about to close that if statement but first we got to make sure this command does not get handled by the server since, we already handled and the server would just say &amp;quot;Uknown Command dumpuserid&amp;quot; anyway. in order to stop it from going to the server its command list we will return 1&lt;br /&gt;
&lt;br /&gt;
:20. So at line &#039;&#039;19&#039;&#039; u write &#039;&#039;&#039;	    return 1 --return 1 to make etpro ignore the command so u wont get an &#039;invalid command&#039; warning&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we can close the if at line &#039;4&#039;&lt;br /&gt;
&lt;br /&gt;
:21. At line &#039;&#039;20&#039;&#039; write &#039;&#039;&#039;	end --close the if at line 8&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::For all other commands we want the server to decide wut todo whit it not our script there we will return 0 to just let the server handle it&lt;br /&gt;
&lt;br /&gt;
:22. At line &#039;&#039;21&#039;&#039; write &#039;&#039;&#039;	return 0 --if the command wasnt &#039;dumpuserid&#039; then we will get here and return 0 to make etpro handle it&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now all that left is to close the function&lt;br /&gt;
&lt;br /&gt;
:23. At the line &#039;&#039;22&#039;&#039; write &#039;&#039;&#039;end --close function et_ConsoleCommand() at line 5&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/ServerCmdDumpuserid.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ConsoleCommand()&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--called when someone types a command in conosle or uses sa todo a server command&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;local&amp;lt;/font&amp;gt; cmd = et.trap_Argv(&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--load out the first parameter of the test typed in console (the command itself)&amp;lt;/font&amp;gt;&lt;br /&gt;
     cmd = string.lower(cmd) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--convert it to lower case so its easyer to match in our if statements&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; cmd == &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;dumpuserid&amp;quot;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--run our code if the command was &#039;dumpuserid&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;local&amp;lt;/font&amp;gt; id = et.trap_Argv(&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--load out the first parameter the command (the userid to dump)&amp;lt;/font&amp;gt;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; id ~= &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;&amp;quot;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--check if parameter1 isnt empty&amp;lt;/font&amp;gt;&lt;br /&gt;
             &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;local&amp;lt;/font&amp;gt; idnumber = tonumber(id) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--get a number out of the string&amp;lt;/font&amp;gt;&lt;br /&gt;
             &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; idnumber &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--check if its not a nil&amp;lt;/font&amp;gt;&lt;br /&gt;
                 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;local&amp;lt;/font&amp;gt; idnickname = et.gentity_get(id,&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;pers.netname&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--get the player name for player slot &amp;quot;id&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
                 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; idnickname ~= &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;&amp;quot;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--check if the username isnt empty&amp;lt;/font&amp;gt;&lt;br /&gt;
                     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;local&amp;lt;/font&amp;gt; servercommand = &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;dumpuser &amp;quot;&amp;lt;/font&amp;gt;.. idnickname &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--create the command to send back to the server&amp;lt;/font&amp;gt;&lt;br /&gt;
                     et.trap_SendConsoleCommand(et.EXEC_APPEND,servercommand) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--send our command to the server tobe executed&amp;lt;/font&amp;gt;&lt;br /&gt;
                 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;else&amp;lt;/font&amp;gt; et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Player &amp;quot;&amp;lt;/font&amp;gt;.. id ..&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot; is not on the server\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--warning message if the used a wrong slot number&amp;lt;/font&amp;gt;             &lt;br /&gt;
                 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close the if at line 14&amp;lt;/font&amp;gt;&lt;br /&gt;
             &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;else&amp;lt;/font&amp;gt; et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;invalid player slot, useage: dumpuserid &amp;lt;player slot&amp;gt;\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--print out a warning that they have to enter player slot&amp;lt;/font&amp;gt;&lt;br /&gt;
             &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close the if at line 12&amp;lt;/font&amp;gt;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;else&amp;lt;/font&amp;gt; et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;invalid player slot, useage: dumpuserid &amp;lt;player slot&amp;gt;\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--print out a warning that they have to enter player slot&amp;lt;/font&amp;gt;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close the if at line 10&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--return 1 to make etpro ignore the command so u wont get an &#039;invalid command&#039; warning&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close the if at line 8&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--if the command wasnt &#039;dumpuserid&#039; then we will get here and return 0 to make etpro handle it&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close function et_ConsoleCommand() at line 5&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will be able to use &#039;&#039;dumpuserid&#039;&#039; as a server command.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2493</id>
		<title>Lua Tutorials</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2493"/>
		<updated>2006-08-29T08:35:23Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: command dumpuserid part 1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
This page is here to help you understand [[ETPro]] [http://www.lua.org/ Lua] functions.&lt;br /&gt;
&lt;br /&gt;
Before you start on this tutorial I assume you know basic [http://www.lua.org/ Lua] scripting.  If not then I suggest you take a look at 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;
You can also take a look at code made by someone else, a list of [[ETPro]] mods that can be found [[:Category:ETPro:Mods|here]], or our [[ETPro:Lua Sample Code|Lua Sample Code]].&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
===Loading a Script===&lt;br /&gt;
:Scripts are loaded by their file name out of the /etpro sub directory of your Enemy Territory installation, so don&#039;t forget to save them in the right folder.&amp;lt;br&amp;gt;&lt;br /&gt;
:if you want to load HelloWorld.lua you would have to set the server cvar &#039;&#039;&#039;lua_modules&#039;&#039;&#039; to &#039;&#039;&amp;quot;HelloWorld.lua&amp;quot;&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
:If you want to load more mods you can add them to the same variables separated by a space like &#039;&#039;&amp;quot;HelloWorld.lua lol.lua pingpong.lua&amp;quot;&#039;&#039;&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you modify this cvar all currently loaded [http://www.lua.org/ lua] modules will be unloaded.&lt;br /&gt;
&lt;br /&gt;
:After editing your script you save it and then reload it in [[ETPro]] to make your chances take effect, this can simply be done by &#039;&#039;&#039;reset_match&#039;&#039;&#039; server command.&lt;br /&gt;
&lt;br /&gt;
===Development Environment===&lt;br /&gt;
:While scripting you will see your code gets hard to read, its much easier to read with syntax highlighting. This can be done by scripting inside an [http://www.lua.org/ lua] development environment.&lt;br /&gt;
&lt;br /&gt;
:These can be found under the &#039;&#039;Development Environments&#039;&#039; heading at  [http://lua-users.org/wiki/LuaAddons this page].&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Lines written in &#039;&#039;&#039;Bold&#039;&#039;&#039; are the actual lines we are going to write in our scripts.&lt;br /&gt;
===Hello World===&lt;br /&gt;
:Here we will show a simple hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloWorld.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. Therefore we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039;. That function is called once every round at the beginning. It&#039;s a good function to do some initial settings. We do not have to worry about those parameters (levelTime,randomSeed,restart) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) -- called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console.&lt;br /&gt;
&lt;br /&gt;
:3. At line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello World!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end out function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloWorld.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello World!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the server console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Spam===&lt;br /&gt;
:Here we will show a simple Spammy hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloSpam.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] many times to make it spammy. Therefore we will use &#039;&#039;et_RunFrame(levelTime)&#039;&#039;. That function is called every server frame. It is a good function for stuff you need to constantly check but you should not put to much code in here. We do not have to worry about those parameter (levelTime) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_RunFrame(levelTime) --called every serverframe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so, now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;; that function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console&lt;br /&gt;
&lt;br /&gt;
:3. Now at line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello Spam!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end our function at line &#039;&#039;1&#039;&#039; with a simple at line &#039;&#039;3&#039;&#039; &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_RunFrame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloSpam.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_RunFrame(levelTime) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--called every serverframe&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello Spam!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_RunFrame()&amp;lt;/font&amp;gt;&lt;br /&gt;
::Now save and load your script and you will see Hello Spam!!! in the server console.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Client===&lt;br /&gt;
:Here we will show a simple hello world example for the client console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloClient.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need a [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. To do this we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039; as shown in the &#039;&#039;Hello World&#039;&#039; example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) --called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we need a function to print a message to the client his console. We will use et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;message\n\&amp;quot;&amp;quot;)&#039;&#039; to achieve this. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the client&#039;s console.&lt;br /&gt;
::The first parameter is the client slot to send to. When this is -1 ETPro will send the message to all clients. The 2nd parameter looks confusing and like the original author&#039;s spelling, it is. First you have the main command witch is &amp;quot;print  ..&amp;quot;. Then, at the place of the dots, comes the data to send with the print. In our case this is &amp;quot;message\n&amp;quot;&amp;quot;.&lt;br /&gt;
::The \n will send a newline command to the console so the next message written to the console is on the next line. The \&amp;quot; are just quotes but since they are already inside a string you need to prefix them with a \ (commonly known as an escape character).&lt;br /&gt;
&lt;br /&gt;
:3. So just write this at line &#039;&#039;2&#039;&#039; &#039;&#039;&#039;    et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Last we need to end our function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloClient.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.trap_SendServerCommand(-&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;,&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the client&#039;s console at the begin of a round.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Server Command lol===&lt;br /&gt;
:Here we will show how to make a new server command that will simply print &#039;&#039;hihi&#039;&#039;.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need to create a new file for the script.  Create a new file and name it &#039;&#039;ServerCmdLol.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::To start we need an ETPro Lua function that will be called automatically by ETPro when a certain server command has been entered.&lt;br /&gt;
::To do this we will use et_ConsoleCommand()&#039;&#039;.&lt;br /&gt;
::It is called for every server command but not for engine commands like &#039;&#039;say&#039;&#039;,&#039;&#039;broadcast&#039;&#039;,&#039;&#039;echo&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_ConsoleCommand()--called when someone types a command in conosle or uses sa todo a server command&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now the first thing we need to know is what command was entered.&lt;br /&gt;
::Commands that are entered will be split up by spaces, so &#039;&#039;cmd1 hello all&#039;&#039; will be split up into &amp;quot;cmd1&amp;quot;, &amp;quot;hello&amp;quot; and &amp;quot;all&amp;quot;.&lt;br /&gt;
::The only exception is that &#039;&#039;cmd2 &amp;quot;hello all&amp;quot;&#039;&#039; will be split up in &amp;quot;cmd2&amp;quot; and &amp;quot;hello all&amp;quot; because, &amp;quot;hello all&amp;quot; is entered as one string by enclosing them in quotes.&lt;br /&gt;
::To get a part of the command you should use et.trap_Argv(&#039;&#039;partnumber&#039;&#039;)&lt;br /&gt;
::&#039;&#039;partnumber&#039;&#039; 0 is the actual command and, &#039;&#039;partnumber&#039;&#039; 1 is the first parameter of the command&lt;br /&gt;
:: so in our example above we would get:&lt;br /&gt;
:::et.trap_Argv(0) = &amp;quot;cmd1&amp;quot;&lt;br /&gt;
:::et.trap_Argv(1) = &amp;quot;hello&amp;quot;&lt;br /&gt;
:::et.trap_Argv(2) = &amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:3. At line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;	local cmd = et.trap_Argv(0) --load out the first parameter of the test typed in console (the command itself)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::The commands are sent the same way they were entered, so if you enter &#039;&#039;cMd3&#039;&#039; you will get &#039;&#039;cMd3&#039;&#039;.&lt;br /&gt;
::To detect all variations, we will convert the string to lowercase using a normal Lua function.&lt;br /&gt;
&lt;br /&gt;
:4. To make it lower case we will write &#039;&#039;&#039;	cmd = string.lower(cmd) --convert it to lowercase so it is easier to match in our if statements&#039;&#039;&#039; at line &#039;&#039;3&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we can use a simple &#039;&#039;if&#039;&#039; statement to check if the command is &#039;&#039;lol&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:5. At line &#039;&#039;4&#039;&#039; write &#039;&#039;&#039;	if cmd == &amp;quot;lol&amp;quot; then --run our code if the command was &amp;quot;lol&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::If thats true then the script should print &amp;quot;hihi&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:6. To do this, at line &#039;&#039;5&#039;&#039; write &#039;&#039;&#039;        et.G_Print(&amp;quot;hihi\n&amp;quot;) --print out &amp;quot;hihi&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now that we have handled the command in our [[ETPro]] [http://www.lua.org/ Lua] script, we do not need to send it to the normal ETPro code since that will return &amp;quot;Unknown Command&amp;quot; anyway.&lt;br /&gt;
::We can let ETPro ignore the command by returning 1 out of our function.&lt;br /&gt;
&lt;br /&gt;
:7. So at line &#039;&#039;6&#039;&#039; we will write &#039;&#039;&#039;        return 1 --return 1 to make ETPro ignore the command so you wont get an &#039;invalid command&#039; warning&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Thats all we need to do for this command so we can start closing our function&lt;br /&gt;
&lt;br /&gt;
:8. At line &#039;&#039;7&#039;&#039; we end our if statement of line &#039;&#039;4&#039;&#039; so we will write &#039;&#039;&#039;	end                       	--close the if at line 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we get to the code that gets executed when the command was not &#039;&#039;lol&#039;&#039;.&lt;br /&gt;
::We got nothing todo here so we will return 0 to make [[ETPro]] handle it.&lt;br /&gt;
&lt;br /&gt;
:9. To make ETPro handle all other commands, write &#039;&#039;&#039;	return 0 --if the command wasnt &#039;lol&#039; then we will get here and return 0 to make ETPro handle it&#039;&#039;&#039; at line &#039;&#039;8&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we are almost done just end our function.&lt;br /&gt;
&lt;br /&gt;
:10. So at line &#039;&#039;9&#039;&#039; we will write &#039;&#039;&#039;end --close function et_ConsoleCommand() at line 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/ServerCmdLol.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ConsoleCommand() &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--called when someone types a cokmmand in conosle or uses sa todo a server command&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;local&amp;lt;/font&amp;gt; cmd = et.trap_Argv(&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--load out the first parameter of the test typed in console (the command itself)&amp;lt;/font&amp;gt;&lt;br /&gt;
     cmd = string.lower(cmd) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--convert it to lower case so its easyer to match in our if statements&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; cmd == &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;lol&amp;quot;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--run our code if the command was &#039;lol&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
         et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;hihi\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--print out &#039;hihi&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--return 1 to make etpro ignore the command so u wont get an &#039;invalid command&#039; warning&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close the if at line 7&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--if the command wasnt &#039;lol&#039; then we will get here and return 0 to make etpro handle it&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- close et_ConsoleCommand()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will be able to use &#039;&#039;lol&#039;&#039; as a server command.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Server Command Dumpuserid===&lt;br /&gt;
:Here we will show how to make a new server command that will simply preform a the dumpuser cmd on the name of the client slot we enter.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need to create a new file for the script.  Create a new file and name it &#039;&#039;ServerCmdDumpuserid.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::To start we need an ETPro Lua function that will be called automatically by ETPro when a certain server command has been entered.&lt;br /&gt;
::To do this we will use et_ConsoleCommand()&#039;&#039;.&lt;br /&gt;
::It is called for every server command but not for engine commands like &#039;&#039;say&#039;&#039;,&#039;&#039;broadcast&#039;&#039;,&#039;&#039;echo&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_ConsoleCommand()--called when someone types a command in conosle or uses sa todo a server command&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now the first thing we need to know is what command was entered.&lt;br /&gt;
::Commands that are entered will be split up by spaces, so &#039;&#039;cmd1 hello all&#039;&#039; will be split up into &amp;quot;cmd1&amp;quot;, &amp;quot;hello&amp;quot; and &amp;quot;all&amp;quot;.&lt;br /&gt;
::The only exception is that &#039;&#039;cmd2 &amp;quot;hello all&amp;quot;&#039;&#039; will be split up in &amp;quot;cmd2&amp;quot; and &amp;quot;hello all&amp;quot; because, &amp;quot;hello all&amp;quot; is entered as one string by enclosing them in quotes.&lt;br /&gt;
::To get a part of the command you should use et.trap_Argv(&#039;&#039;partnumber&#039;&#039;)&lt;br /&gt;
::&#039;&#039;partnumber&#039;&#039; 0 is the actual command and, &#039;&#039;partnumber&#039;&#039; 1 is the first parameter of the command&lt;br /&gt;
:: so in our example above we would get:&lt;br /&gt;
:::et.trap_Argv(0) = &amp;quot;cmd1&amp;quot;&lt;br /&gt;
:::et.trap_Argv(1) = &amp;quot;hello&amp;quot;&lt;br /&gt;
:::et.trap_Argv(2) = &amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:3. At line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;	local cmd = et.trap_Argv(0) --load out the first parameter of the test typed in console (the command itself)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::The commands are sent the same way they were entered, so if you enter &#039;&#039;cMd3&#039;&#039; you will get &#039;&#039;cMd3&#039;&#039;.&lt;br /&gt;
::To detect all variations, we will convert the string to lowercase using a normal Lua function.&lt;br /&gt;
&lt;br /&gt;
:4. To make it lower case we will write &#039;&#039;&#039;	cmd = string.lower(cmd) --convert it to lowercase so it is easier to match in our if statements&#039;&#039;&#039; at line &#039;&#039;3&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we can use a simple &#039;&#039;if&#039;&#039; statement to check if the command is &#039;&#039;dumpuserid&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:5. At line &#039;&#039;4&#039;&#039; write &#039;&#039;&#039;	if cmd == &amp;quot;dumpuserid&amp;quot; then --run our code if the command was &amp;quot;dumpuserid&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::If thats true then we need to know witch client id to dump the userinfo from, therefor we just load in the 2nd comand parameter whit et.trap_Argv(1).&lt;br /&gt;
&lt;br /&gt;
:6. To do this, at line &#039;&#039;5&#039;&#039; write &#039;&#039;&#039;        local id = et.trap_Argv(1) --load out the first parameter the command (the userid to dump)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::now we got the 2nd parameter as string, the first thing we do now is check if it isnt an empty string (&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
:7. So at line &#039;&#039;6&#039;&#039; write &#039;&#039;&#039;     	if id ~= &amp;quot;&amp;quot; then --check if parameter1 isnt empty&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::if its not an empty string then we wil contiune but if it is we will print back an error. We will get to the error later at line &#039;&#039;17&#039;&#039;. Now we will go on whit the next step. We will convert our string to a number this way, we not only get it as a number but, we can also get a nil if it can be coverted so, we can see if the 2nd parameter of the command is a real number and not a word.&lt;br /&gt;
&lt;br /&gt;
:8. so at line &#039;&#039;7&#039;&#039; write &#039;&#039;&#039;    		local idnumber = tonumber(id) --get a number out of the string&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we will check if its a real number and not a nil. Todo this we can simpely check if its &#039;true&#039; since only &#039;nil&#039; and &#039;false&#039; are &#039;false&#039; in lua. If its &#039;false&#039; we will print back an error but we will handle that at line &#039;&#039;15&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:9. Todo this we will write at line &#039;&#039;8&#039;&#039; &#039;&#039;&#039;    		if idnumber then --check if its not a nil&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we go on assuming we got a normal client slot id so we will try to parse his name. there are 3 ways to parse a name but i use the most simpel one. the other ways are to get it out of a configstring or userinfo. but we will use the  et.gentity_get() on the &#039;pers.netname&#039;&lt;br /&gt;
&lt;br /&gt;
:10. So at line &#039;&#039;9&#039;&#039; we write &#039;&#039;&#039;        		local idnickname = et.gentity_get(id,&amp;quot;pers.netname&amp;quot;) --get the player name for player slot &#039;id&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if the person entered a wrong number where there is no client connected then we get an enpty string so first we now check if our string is not empty. if its empty we will print an error but we handle that at line &#039;&#039;13&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:11. At line &#039;&#039;10&#039;&#039; write &#039;&#039;&#039;        		if idnickname ~= &amp;quot;&amp;quot; then --check if the username isnt empty&lt;br /&gt;
&lt;br /&gt;
::oke the rest comes soon :p&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will be able to use &#039;&#039;dumpuserod&#039;&#039; as a server command.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2491</id>
		<title>Lua Tutorials</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2491"/>
		<updated>2006-08-28T20:16:37Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: fixed a litle lol / dumpuserid thingy&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
This page is here to help you understand [[ETPro]] [http://www.lua.org/ Lua] functions.&lt;br /&gt;
&lt;br /&gt;
Before you start on this tutorial I assume you know basic [http://www.lua.org/ Lua] scripting.  If not then I suggest you take a look at 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;
You can also take a look at code made by someone else, a list of [[ETPro]] mods that can be found [[:Category:ETPro:Mods|here]], or our [[ETPro:Lua Sample Code|Lua Sample Code]].&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
===Loading a Script===&lt;br /&gt;
:Scripts are loaded by their file name out of the /etpro sub directory of your Enemy Territory installation, so don&#039;t forget to save them in the right folder.&amp;lt;br&amp;gt;&lt;br /&gt;
:if you want to load HelloWorld.lua you would have to set the server cvar &#039;&#039;&#039;lua_modules&#039;&#039;&#039; to &#039;&#039;&amp;quot;HelloWorld.lua&amp;quot;&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
:If you want to load more mods you can add them to the same variables separated by a space like &#039;&#039;&amp;quot;HelloWorld.lua lol.lua pingpong.lua&amp;quot;&#039;&#039;&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you modify this cvar all currently loaded [http://www.lua.org/ lua] modules will be unloaded.&lt;br /&gt;
&lt;br /&gt;
:After editing your script you save it and then reload it in [[ETPro]] to make your chances take effect, this can simply be done by &#039;&#039;&#039;reset_match&#039;&#039;&#039; server command.&lt;br /&gt;
&lt;br /&gt;
===Development Environment===&lt;br /&gt;
:While scripting you will see your code gets hard to read, its much easier to read with syntax highlighting. This can be done by scripting inside an [http://www.lua.org/ lua] development environment.&lt;br /&gt;
&lt;br /&gt;
:These can be found under the &#039;&#039;Development Environments&#039;&#039; heading at  [http://lua-users.org/wiki/LuaAddons this page].&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Lines written in &#039;&#039;&#039;Bold&#039;&#039;&#039; are the actual lines we are going to write in our scripts.&lt;br /&gt;
===Hello World===&lt;br /&gt;
:Here we will show a simple hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloWorld.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. Therefore we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039;. That function is called once every round at the beginning. It&#039;s a good function to do some initial settings. We do not have to worry about those parameters (levelTime,randomSeed,restart) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) -- called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console.&lt;br /&gt;
&lt;br /&gt;
:3. At line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello World!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end out function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloWorld.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello World!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the server console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Spam===&lt;br /&gt;
:Here we will show a simple Spammy hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloSpam.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] many times to make it spammy. Therefore we will use &#039;&#039;et_RunFrame(levelTime)&#039;&#039;. That function is called every server frame. It is a good function for stuff you need to constantly check but you should not put to much code in here. We do not have to worry about those parameter (levelTime) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_RunFrame(levelTime) --called every serverframe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so, now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;; that function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console&lt;br /&gt;
&lt;br /&gt;
:3. Now at line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello Spam!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end our function at line &#039;&#039;1&#039;&#039; with a simple at line &#039;&#039;3&#039;&#039; &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_RunFrame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloSpam.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_RunFrame(levelTime) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--called every serverframe&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello Spam!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_RunFrame()&amp;lt;/font&amp;gt;&lt;br /&gt;
::Now save and load your script and you will see Hello Spam!!! in the server console.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Client===&lt;br /&gt;
:Here we will show a simple hello world example for the client console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloClient.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need a [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. To do this we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039; as shown in the &#039;&#039;Hello World&#039;&#039; example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) --called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we need a function to print a message to the client his console. We will use et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;message\n\&amp;quot;&amp;quot;)&#039;&#039; to achieve this. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the client&#039;s console.&lt;br /&gt;
::The first parameter is the client slot to send to. When this is -1 ETPro will send the message to all clients. The 2nd parameter looks confusing and like the original author&#039;s spelling, it is. First you have the main command witch is &amp;quot;print  ..&amp;quot;. Then, at the place of the dots, comes the data to send with the print. In our case this is &amp;quot;message\n&amp;quot;&amp;quot;.&lt;br /&gt;
::The \n will send a newline command to the console so the next message written to the console is on the next line. The \&amp;quot; are just quotes but since they are already inside a string you need to prefix them with a \ (commonly known as an escape character).&lt;br /&gt;
&lt;br /&gt;
:3. So just write this at line &#039;&#039;2&#039;&#039; &#039;&#039;&#039;    et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Last we need to end our function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloClient.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.trap_SendServerCommand(-&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;,&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the client&#039;s console at the begin of a round.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Server Command lol===&lt;br /&gt;
:Here we will show how to make a new server command that will simply print &#039;&#039;hihi&#039;&#039;.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need to create a new file for the script.  Create a new file and name it &#039;&#039;ServerCmdLol.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::To start we need an ETPro Lua function that will be called automatically by ETPro when a certain server command has been entered.&lt;br /&gt;
::To do this we will use et_ConsoleCommand()&#039;&#039;.&lt;br /&gt;
::It is called for every server command but now for engine commands like &#039;&#039;say&#039;&#039;,&#039;&#039;broadcast&#039;&#039;,&#039;&#039;echo&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_ConsoleCommand()--called when someone types a command in conosle or uses sa todo a server command&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now the first thing we need to know is what command was entered.&lt;br /&gt;
::Commands that are entered will be split up by spaces, so &#039;&#039;cmd1 hello all&#039;&#039; will be split up into &amp;quot;cmd1&amp;quot;, &amp;quot;hello&amp;quot; and &amp;quot;all&amp;quot;.&lt;br /&gt;
::The only exception is that &#039;&#039;cmd2 &amp;quot;hello all&amp;quot;&#039;&#039; will be split up in &amp;quot;cmd2&amp;quot; and &amp;quot;hello all&amp;quot; because, &amp;quot;hello all&amp;quot; is entered as one string by enclosing them in quotes.&lt;br /&gt;
::To get a part of the command you should use et.trap_Argv(&#039;&#039;partnumber&#039;&#039;)&lt;br /&gt;
::&#039;&#039;partnumber&#039;&#039; 0 is the actual command and, &#039;&#039;partnumber&#039;&#039; 1 is the first parameter of the command&lt;br /&gt;
:: so in our example above we would get:&lt;br /&gt;
:::et.trap_Argv(0) = &amp;quot;cmd1&amp;quot;&lt;br /&gt;
:::et.trap_Argv(1) = &amp;quot;hello&amp;quot;&lt;br /&gt;
:::et.trap_Argv(2) = &amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:3. At line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;	local cmd = et.trap_Argv(0) --load out the first parameter of the test typed in console (the command itself)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::The commands are sent the same way they were entered, so if you enter &#039;&#039;cMd3&#039;&#039; you will get &#039;&#039;cMd3&#039;&#039;.&lt;br /&gt;
::To detect all variations, we will convert the string to lowercase using a normal Lua function.&lt;br /&gt;
&lt;br /&gt;
:4. To make it lower case we will write &#039;&#039;&#039;	cmd = string.lower(cmd) --convert it to lowercase so it is easier to match in our if statements&#039;&#039;&#039; at line &#039;&#039;3&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we can use a simple &#039;&#039;if&#039;&#039; statement to check if the command is &#039;&#039;lol&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:5. At line &#039;&#039;4&#039;&#039; write &#039;&#039;&#039;	if cmd == &amp;quot;lol&amp;quot; then --run our code if the command was &amp;quot;lol&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::If thats true then the script should print &amp;quot;hihi&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:6. To do this, at line &#039;&#039;5&#039;&#039; write &#039;&#039;&#039;        et.G_Print(&amp;quot;hihi\n&amp;quot;) --print out &amp;quot;hihi&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now that we have handled the command in our [[ETPro]] [http://www.lua.org/ Lua] script, we do not need to send it to the normal ETPro code since that will return &amp;quot;Unknown Command&amp;quot; anyway.&lt;br /&gt;
::We can let ETPro ignore the command by returning 1 out of our function.&lt;br /&gt;
&lt;br /&gt;
:7. So at line &#039;&#039;6&#039;&#039; we will write &#039;&#039;&#039;        return 1 --return 1 to make ETPro ignore the command so you wont get an &#039;invalid command&#039; warning&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Thats all we need to do for this command so we can start closing our function&lt;br /&gt;
&lt;br /&gt;
:8. At line &#039;&#039;7&#039;&#039; we end our if statement of line &#039;&#039;4&#039;&#039; so we will write &#039;&#039;&#039;	end                       	--close the if at line 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we get to the code that gets executed when the command was not &#039;&#039;lol&#039;&#039;.&lt;br /&gt;
::We got nothing todo here so we will return 0 to make [[ETPro]] handle it.&lt;br /&gt;
&lt;br /&gt;
:9. To make ETPro handle all other commands, write &#039;&#039;&#039;	return 0 --if the command wasnt &#039;lol&#039; then we will get here and return 0 to make ETPro handle it&#039;&#039;&#039; at line &#039;&#039;8&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we are almost done just end our function.&lt;br /&gt;
&lt;br /&gt;
:10. So at line &#039;&#039;9&#039;&#039; we will write &#039;&#039;&#039;end --close function et_ConsoleCommand() at line 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/ServerCmdLol.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ConsoleCommand() &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--called when someone types a cokmmand in conosle or uses sa todo a server command&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;local&amp;lt;/font&amp;gt; cmd = et.trap_Argv(&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--load out the first parameter of the test typed in console (the command itself)&amp;lt;/font&amp;gt;&lt;br /&gt;
     cmd = string.lower(cmd) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--convert it to lower case so its easyer to match in our if statements&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; cmd == &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;lol&amp;quot;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--run our code if the command was &#039;lol&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
         et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;hihi\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--print out &#039;hihi&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--return 1 to make etpro ignore the command so u wont get an &#039;invalid command&#039; warning&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close the if at line 7&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--if the command wasnt &#039;lol&#039; then we will get here and return 0 to make etpro handle it&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- close et_ConsoleCommand()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will be able to use &#039;&#039;lol&#039;&#039; as a server command.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=ETPro:Lua_Sample_Code&amp;diff=2490</id>
		<title>ETPro:Lua Sample Code</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=ETPro:Lua_Sample_Code&amp;diff=2490"/>
		<updated>2006-08-28T20:03:30Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: Added link to toturals page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This code does nothing useful besides demonstrate and exercise the [[Lua Mod API]]&lt;br /&gt;
&lt;br /&gt;
Real tutorials about ETPro Lua scripting can be found [[Lua Tutorials|here]].&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printf wrapper&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et.G_Printf(...)&lt;br /&gt;
        et.G_Print(string.format(unpack(arg)))&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- test some of the supported etpro lua functions&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; test_lua_functions()&lt;br /&gt;
        et.trap_Cvar_Set( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;bla1&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;bla2&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;sv_hostname [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_Cvar_Get( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;sv_hostname&amp;quot;&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;configstring 1 [%s] \n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_GetConfigstring( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
        et.trap_SetConfigstring( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;4&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;yadda test&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;configstring 4 [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_GetConfigstring( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;4&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
        et.trap_SendConsoleCommand( et.EXEC_APPEND, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;cvarlist *charge*\n&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.trap_SendServerCommand( -&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;print \&amp;quot;Yadda yadda\&amp;quot;&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;gentity[1022].classname = [%s]&amp;quot;&amp;lt;/font&amp;gt;, et.gentity_get( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1022&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;classname&amp;quot;&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called when game inits&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame( levelTime, randomSeed, restart )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_InitGame [%d] [%d] [%d]\n&amp;quot;&amp;lt;/font&amp;gt;, levelTime, randomSeed, restart )&lt;br /&gt;
        et.RegisterModname( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;bani qagame &amp;quot;&amp;lt;/font&amp;gt; .. et.FindSelf() )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--     test_lua_functions()&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called every server frame&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_RunFrame( levelTime )&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; math.mod( levelTime, &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1000&amp;lt;/font&amp;gt; ) == &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0 then&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--             et.G_Printf( et_RunFrame [%d]\n&amp;quot;, levelTime )&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every clientcommand&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- return 1 if intercepted, 0 if passthrough&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientCommand( clientNum, cmd )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientCommand: [%d] [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_Argc(), cmd )&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every consolecommand&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- return 1 if intercepted, 0 if passthrough&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ConsoleCommand()&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ConsoleCommand: [%s] [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_Argc(), et.trap_Argv(&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;) )&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; et.trap_Argv(&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;) == &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;listmods&amp;quot;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt;&lt;br /&gt;
                i = &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;&lt;br /&gt;
                &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;repeat&amp;lt;/font&amp;gt;&lt;br /&gt;
                        modname, signature = et.FindMod( i )&lt;br /&gt;
                        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; modname &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;and&amp;lt;/font&amp;gt; signature &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt;&lt;br /&gt;
                                et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;vm slot [%d] name [%s] signature [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, i, modname, signature )&lt;br /&gt;
                                et.IPCSend( i, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;hello&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
                        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
                        i = i + &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;&lt;br /&gt;
                &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;until&amp;lt;/font&amp;gt; modname == &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;nil&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;or&amp;lt;/font&amp;gt; signature == &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;nil&amp;lt;/font&amp;gt;&lt;br /&gt;
                &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;&lt;br /&gt;
  &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called when we receive an IPC from another VM&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_IPCReceive( vmnumber, message )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;IPCReceive [%d] from [%d] message [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.FindSelf(), vmnumber, message )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every ClientConnect&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientConnect( clientNum, firstTime, isBot )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientConnect: [%d] [%d] [%d]\n&amp;quot;&amp;lt;/font&amp;gt;, clientNum, firstTime, isBot )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--     return &amp;quot;go away&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;nil&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every ClientDisconnect&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientDisconnect( clientNum )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientDisconnect: [%d]\n&amp;quot;&amp;lt;/font&amp;gt;, clientNum )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every ClientBegin&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientBegin( clientNum )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientBegin: [%d]\n&amp;quot;&amp;lt;/font&amp;gt;, clientNum )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every ClientUserinfoChanged&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientUserinfoChanged( clientNum )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientUserinfoChanged: [%d] = [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, clientNum, et.trap_GetUserinfo( clientNum ) )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every trap_Printf&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_Print( text )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--     et.G_Printf( &amp;quot;et_Print [%s]&amp;quot;, text )&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2262</id>
		<title>Lua Tutorials</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2262"/>
		<updated>2006-04-29T13:04:21Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: added spaces in the code exmple&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
This page is here to help you understand [[ETPro]] [http://www.lua.org/ Lua] functions.&lt;br /&gt;
&lt;br /&gt;
Before you start on this tutorial I assume you know basic [http://www.lua.org/ Lua] scripting.  If not then I suggest you take a look at 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;
You can also take a look at code made by someone else, a list of [[ETPro]] mods that can be found [[:Category:ETPro:Mods|here]], or our [[ETPro:Lua Sample Code|Lua Sample Code]].&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
===Loading a Script===&lt;br /&gt;
:Scripts are loaded by their file name out of the /etpro sub directory of your Enemy Territory installation, so don&#039;t forget to save them in the right folder.&amp;lt;br&amp;gt;&lt;br /&gt;
:if you want to load HelloWorld.lua you would have to set the server cvar &#039;&#039;&#039;lua_modules&#039;&#039;&#039; to &#039;&#039;&amp;quot;HelloWorld.lua&amp;quot;&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
:If you want to load more mods you can add them to the same variables separated by a space like &#039;&#039;&amp;quot;HelloWorld.lua lol.lua pingpong.lua&amp;quot;&#039;&#039;&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you modify this cvar all currently loaded [http://www.lua.org/ lua] modules will be unloaded.&lt;br /&gt;
&lt;br /&gt;
:After editing your script you save it and then reload it in [[ETPro]] to make your chances take effect, this can simply be done by &#039;&#039;&#039;reset_match&#039;&#039;&#039; server command.&lt;br /&gt;
&lt;br /&gt;
===Development Environment===&lt;br /&gt;
:While scripting you will see your code gets hard to read, its much easier to read with syntax highlighting. This can be done by scripting inside an [http://www.lua.org/ lua] development environment.&lt;br /&gt;
&lt;br /&gt;
:These can be found under the &#039;&#039;Development Environments&#039;&#039; heading at  [http://lua-users.org/wiki/LuaAddons this page].&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Lines written in &#039;&#039;&#039;Bold&#039;&#039;&#039; are the actual lines we are going to write in our scripts.&lt;br /&gt;
===Hello World===&lt;br /&gt;
:Here we will show a simple hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloWorld.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. Therefore we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039;. That function is called once every round at the beginning. It&#039;s a good function to do some initial settings. We do not have to worry about those parameters (levelTime,randomSeed,restart) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) -- called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console.&lt;br /&gt;
&lt;br /&gt;
:3. At line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello World!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end out function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloWorld.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello World!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the server console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Spam===&lt;br /&gt;
:Here we will show a simple Spammy hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloSpam.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] many times to make it spammy. Therefore we will use &#039;&#039;et_RunFrame(levelTime)&#039;&#039;. That function is called every server frame. It is a good function for stuff you need to constantly check but you should not put to much code in here. We do not have to worry about those parameter (levelTime) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_RunFrame(levelTime) --called every serverframe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so, now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;; that function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console&lt;br /&gt;
&lt;br /&gt;
:3. Now at line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello Spam!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end our function at line &#039;&#039;1&#039;&#039; with a simple at line &#039;&#039;3&#039;&#039; &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_RunFrame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloSpam.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_RunFrame(levelTime) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--called every serverframe&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello Spam!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_RunFrame()&amp;lt;/font&amp;gt;&lt;br /&gt;
::Now save and load your script and you will see Hello Spam!!! in the server console.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Client===&lt;br /&gt;
:Here we will show a simple hello world example for the client console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloClient.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need a [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. To do this we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039; as shown in the &#039;&#039;Hello World&#039;&#039; example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) --called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we need a function to print a message to the client his console. We will use et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;message\n\&amp;quot;&amp;quot;)&#039;&#039; to achieve this. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the client&#039;s console.&lt;br /&gt;
::The first parameter is the client slot to send to. When this is -1 ETPro will send the message to all clients. The 2nd parameter looks confusing and like the original author&#039;s spelling, it is. First you have the main command witch is &amp;quot;print  ..&amp;quot;. Then, at the place of the dots, comes the data to send with the print. In our case this is &amp;quot;message\n&amp;quot;&amp;quot;.&lt;br /&gt;
::The \n will send a newline command to the console so the next message written to the console is on the next line. The \&amp;quot; are just quotes but since they are already inside a string you need to prefix them with a \ (commonly known as an escape character).&lt;br /&gt;
&lt;br /&gt;
:3. So just write this at line &#039;&#039;2&#039;&#039; &#039;&#039;&#039;    et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Last we need to end our function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloClient.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.trap_SendServerCommand(-&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;,&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the client&#039;s console at the begin of a round.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Server Command lol===&lt;br /&gt;
:Here we will show how to make a new server command that will simply print &#039;&#039;hihi&#039;&#039;.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need to create a new file for the script.  Create a new file and name it &#039;&#039;ServerCmdLol.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::To start we need an ETPro Lua function that will be called automatically by ETPro when a certain server command has been entered.&lt;br /&gt;
::To do this we will use et_ConsoleCommand()&#039;&#039;.&lt;br /&gt;
::It is called for every server command but now for engine commands like &#039;&#039;say&#039;&#039;,&#039;&#039;broadcast&#039;&#039;,&#039;&#039;echo&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_ConsoleCommand()--called when someone types a command in conosle or uses sa todo a server command&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now the first thing we need to know is what command was entered.&lt;br /&gt;
::Commands that are entered will be split up by spaces, so &#039;&#039;cmd1 hello all&#039;&#039; will be split up into &amp;quot;cmd1&amp;quot;, &amp;quot;hello&amp;quot; and &amp;quot;all&amp;quot;.&lt;br /&gt;
::The only exception is that &#039;&#039;cmd2 &amp;quot;hello all&amp;quot;&#039;&#039; will be split up in &amp;quot;cmd2&amp;quot; and &amp;quot;hello all&amp;quot; because, &amp;quot;hello all&amp;quot; is entered as one string by enclosing them in quotes.&lt;br /&gt;
::To get a part of the command you should use et.trap_Argv(&#039;&#039;partnumber&#039;&#039;)&lt;br /&gt;
::&#039;&#039;partnumber&#039;&#039; 0 is the actual command and, &#039;&#039;partnumber&#039;&#039; 1 is the first parameter of the command&lt;br /&gt;
:: so in our example above we would get:&lt;br /&gt;
:::et.trap_Argv(0) = &amp;quot;cmd1&amp;quot;&lt;br /&gt;
:::et.trap_Argv(1) = &amp;quot;hello&amp;quot;&lt;br /&gt;
:::et.trap_Argv(2) = &amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:3. At line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;	local cmd = et.trap_Argv(0) --load out the first parameter of the test typed in console (the command itself)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::The commands are sent the same way they were entered, so if you enter &#039;&#039;cMd3&#039;&#039; you will get &#039;&#039;cMd3&#039;&#039;.&lt;br /&gt;
::To detect all variations, we will convert the string to lowercase using a normal Lua function.&lt;br /&gt;
&lt;br /&gt;
:4. To make it lower case we will write &#039;&#039;&#039;	cmd = string.lower(cmd) --convert it to lowercase so it is easier to match in our if statements&#039;&#039;&#039; at line &#039;&#039;3&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we can use a simple &#039;&#039;if&#039;&#039; statement to check if the command is &#039;&#039;lol&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:5. At line &#039;&#039;4&#039;&#039; write &#039;&#039;&#039;	if cmd == &amp;quot;lol&amp;quot; then --run our code if the command was &amp;quot;dumpuserid&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::If thats true then the script should print &amp;quot;hihi&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:6. To do this, at line &#039;&#039;5&#039;&#039; write &#039;&#039;&#039;        et.G_Print(&amp;quot;hihi\n&amp;quot;) --print out &amp;quot;hihi&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now that we have handled the command in our [[ETPro]] [http://www.lua.org/ Lua] script, we do not need to send it to the normal ETPro code since that will return &amp;quot;Unknown Command&amp;quot; anyway.&lt;br /&gt;
::We can let ETPro ignore the command by returning 1 out of our function.&lt;br /&gt;
&lt;br /&gt;
:7. So at line &#039;&#039;6&#039;&#039; we will write &#039;&#039;&#039;        return 1 --return 1 to make ETPro ignore the command so you wont get an &#039;invalid command&#039; warning&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Thats all we need to do for this command so we can start closing our function&lt;br /&gt;
&lt;br /&gt;
:8. At line &#039;&#039;7&#039;&#039; we end our if statement of line &#039;&#039;4&#039;&#039; so we will write &#039;&#039;&#039;	end                       	--close the if at line 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we get to the code that gets executed when the command was not &#039;&#039;lol&#039;&#039;.&lt;br /&gt;
::We got nothing todo here so we will return 0 to make [[ETPro]] handle it.&lt;br /&gt;
&lt;br /&gt;
:9. To make ETPro handle all other commands, write &#039;&#039;&#039;	return 0 --if the command wasnt &#039;lol&#039; then we will get here and return 0 to make ETPro handle it&#039;&#039;&#039; at line &#039;&#039;8&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we are almost done just end our function.&lt;br /&gt;
&lt;br /&gt;
:10. So at line &#039;&#039;9&#039;&#039; we will write &#039;&#039;&#039;end --close function et_ConsoleCommand() at line 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/ServerCmdLol.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ConsoleCommand() &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--called when someone types a cokmmand in conosle or uses sa todo a server command&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;local&amp;lt;/font&amp;gt; cmd = et.trap_Argv(&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--load out the first parameter of the test typed in console (the command itself)&amp;lt;/font&amp;gt;&lt;br /&gt;
     cmd = string.lower(cmd) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--convert it to lower case so its easyer to match in our if statements&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; cmd == &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;lol&amp;quot;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--run our code if the command was &#039;dumpuserid&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
         et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;hihi\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--print out &#039;hihi&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
         &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--return 1 to make etpro ignore the command so u wont get an &#039;invalid command&#039; warning&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close the if at line 7&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--if the command wasnt &#039;lol&#039; then we will get here and return 0 to make etpro handle it&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- close et_ConsoleCommand()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will be able to use &#039;&#039;lol&#039;&#039; as a server command.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2259</id>
		<title>Lua Tutorials</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2259"/>
		<updated>2006-04-28T16:15:47Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: 2goodish fixes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
This page is here to help you understand [[ETPro]] [http://www.lua.org/ Lua] functions.&lt;br /&gt;
&lt;br /&gt;
Before you start on this tutorial I assume you know basic [http://www.lua.org/ Lua] scripting.  If not then I suggest you take a look at 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;
You can also take a look at code made by someone else, a list of [[ETPro]] mods that can be found [[:Category:ETPro:Mods|here]], or our [[ETPro:Lua Sample Code|Lua Sample Code]].&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
===Loading a Script===&lt;br /&gt;
:Scripts are loaded by their file name out of the /etpro sub directory of your Enemy Territory installation, so don&#039;t forget to save them in the right folder.&amp;lt;br&amp;gt;&lt;br /&gt;
:if you want to load HelloWorld.lua you would have to set the server cvar &#039;&#039;&#039;lua_modules&#039;&#039;&#039; to &#039;&#039;&amp;quot;HelloWorld.lua&amp;quot;&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
:If you want to load more mods you can add them to the same variables separated by a space like &#039;&#039;&amp;quot;HelloWorld.lua lol.lua pingpong.lua&amp;quot;&#039;&#039;&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you modify this cvar all currently loaded [http://www.lua.org/ lua] modules will be unloaded.&lt;br /&gt;
&lt;br /&gt;
:After editing your script you save it and then reload it in [[ETPro]] to make your chances take effect, this can simply be done by &#039;&#039;&#039;reset_match&#039;&#039;&#039; server command.&lt;br /&gt;
&lt;br /&gt;
===Development Environment===&lt;br /&gt;
:While scripting you will see your code gets hard to read, its much easier to read with syntax highlighting. This can be done by scripting inside an [http://www.lua.org/ lua] development environment.&lt;br /&gt;
&lt;br /&gt;
:These can be found under the &#039;&#039;Development Environments&#039;&#039; heading at  [http://lua-users.org/wiki/LuaAddons this page].&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Lines written in &#039;&#039;&#039;Bold&#039;&#039;&#039; are the actual lines we are going to write in our scripts.&lt;br /&gt;
===Hello World===&lt;br /&gt;
:Here we will show a simple hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloWorld.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. Therefore we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039;. That function is called once every round at the beginning. It&#039;s a good function to do some initial settings. We do not have to worry about those parameters (levelTime,randomSeed,restart) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) -- called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console.&lt;br /&gt;
&lt;br /&gt;
:3. At line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello World!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end out function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloWorld.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello World!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the server console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Spam===&lt;br /&gt;
:Here we will show a simple Spammy hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloSpam.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] many times to make it spammy. Therefore we will use &#039;&#039;et_RunFrame(levelTime)&#039;&#039;. That function is called every server frame. It is a good function for stuff you need to constantly check but you should not put to much code in here. We do not have to worry about those parameter (levelTime) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_RunFrame(levelTime) --called every serverframe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so, now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;; that function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console&lt;br /&gt;
&lt;br /&gt;
:3. Now at line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello Spam!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end our function at line &#039;&#039;1&#039;&#039; with a simple at line &#039;&#039;3&#039;&#039; &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_RunFrame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloSpam.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_RunFrame(levelTime) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--called every serverframe&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello Spam!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_RunFrame()&amp;lt;/font&amp;gt;&lt;br /&gt;
::Now save and load your script and you will see Hello Spam!!! in the server console.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Client===&lt;br /&gt;
:Here we will show a simple hello world example for the client console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloClient.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need a [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. To do this we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039; as shown in the &#039;&#039;Hello World&#039;&#039; example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) --called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we need a function to print a message to the client his console. We will use et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;message\n\&amp;quot;&amp;quot;)&#039;&#039; to achieve this. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the client&#039;s console.&lt;br /&gt;
::The first parameter is the client slot to send to. When this is -1 ETPro will send the message to all clients. The 2nd parameter looks confusing and like the original author&#039;s spelling, it is. First you have the main command witch is &amp;quot;print  ..&amp;quot;. Then, at the place of the dots, comes the data to send with the print. In our case this is &amp;quot;message\n&amp;quot;&amp;quot;.&lt;br /&gt;
::The \n will send a newline command to the console so the next message written to the console is on the next line. The \&amp;quot; are just quotes but since they are already inside a string you need to prefix them with a \ (commonly known as an escape character).&lt;br /&gt;
&lt;br /&gt;
:3. So just write this at line &#039;&#039;2&#039;&#039; &#039;&#039;&#039;    et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Last we need to end our function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloClient.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.trap_SendServerCommand(-&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;,&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the client&#039;s console at the begin of a round.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Server Command lol===&lt;br /&gt;
:Here we will show how to make a new server command that, will simpely print back &#039;&#039;hihi&#039;&#039;.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;ServerCmdLol.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::To start we need a [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when a server command has been entered.&lt;br /&gt;
::To do this we will use et_ConsoleCommand()&#039;&#039;.&lt;br /&gt;
::Its called for every server command but now for engine commands like &#039;&#039;say&#039;&#039;,&#039;&#039;broadcast&#039;&#039;,&#039;&#039;echo&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_ConsoleCommand()--called when someone types a command in conosle or uses sa todo a server command&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now the first thing we need to know is wut command was entered.&lt;br /&gt;
::Commands there are entered will be split up by spaces so, &#039;&#039;cmd1 hello all&#039;&#039; will be split up in &amp;quot;cmd1&amp;quot;, &amp;quot;hello&amp;quot; and &amp;quot;all&amp;quot;.&lt;br /&gt;
::The only ecception is that &#039;&#039;cmd2 &amp;quot;hello all&amp;quot;&#039;&#039; will be split up in &amp;quot;cmd2&amp;quot; and &amp;quot;hello all&amp;quot; becase, &amp;quot;hello all&amp;quot; is entered as 1 string&lt;br /&gt;
::To get a part of the command you should use et.trap_Argv(&#039;&#039;partnumber&#039;&#039;)&lt;br /&gt;
::&#039;&#039;partnumber&#039;&#039; 0 is the actual command and, &#039;&#039;partnumber&#039;&#039; 1 is the first parameter of the command&lt;br /&gt;
:: so in our example above we would get:&lt;br /&gt;
:::et.trap_Argv(0) = &amp;quot;cmd1&amp;quot;&lt;br /&gt;
:::et.trap_Argv(1) = &amp;quot;hello&amp;quot;&lt;br /&gt;
:::et.trap_Argv(2) = &amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:3. so at line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;	local cmd = et.trap_Argv(0) --load out the first parameter of the test typed in console (the command itself)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::The commands are send on like they way they where entered so if you enter &#039;&#039;cMd3&#039;&#039; you will get &#039;&#039;cMd3&#039;&#039;.&lt;br /&gt;
::But that makes them harder to detect there for we will convert the string to lower case using a normal [http://www.lua.org/ lua] function.&lt;br /&gt;
&lt;br /&gt;
:4. to make it lower case we will write &#039;&#039;&#039;	cmd = string.lower(cmd) --convert it to lower case so its easyer to match in our if statements&#039;&#039;&#039; at line &#039;&#039;3&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Ok, now we can use a simpel &#039;&#039;if&#039;&#039; statement to check if the command is &#039;&#039;lol&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:5. So now at line &#039;&#039;4&#039;&#039; write &#039;&#039;&#039;	if cmd == &amp;quot;lol&amp;quot; then --run our code if the command was &amp;quot;dumpuserid&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::If thats true then we will print &amp;quot;hihi&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:6. So at line &#039;&#039;5&#039;&#039; write &#039;&#039;&#039;        et.G_Print(&amp;quot;hihi\n&amp;quot;) --print out &amp;quot;hihi&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we handled the command in our [[ETPro]] [http://www.lua.org/ lua] script therefor, we dont need to send it on to the normal [[ETPro]] code since that will return &amp;quot;Uknown Command&amp;quot; anyway&lt;br /&gt;
::We can let [[ETPro]] ignore the command by returning 1 out of our function.&lt;br /&gt;
&lt;br /&gt;
:7. So at line &#039;&#039;6&#039;&#039; we will write &#039;&#039;&#039;        return 1 --return 1 to make etpro ignore the command so u wont get an &#039;invalid command&#039; warning&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Thats all we need todo for this command so we can start closing our function&lt;br /&gt;
&lt;br /&gt;
:8. At line &#039;&#039;7&#039;&#039; we end our if statement of line &#039;&#039;4&#039;&#039; so we will write &#039;&#039;&#039;	end                       	--close the if at line 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we get to the code that gets executed when the command was not &#039;&#039;lol&#039;&#039;.&lt;br /&gt;
::We got nothing todo here so we will return 0 to make [[ETPro]] habdle it.&lt;br /&gt;
&lt;br /&gt;
:9. make etpro handle all other commands so write &#039;&#039;&#039;	return 0 --if the command wasnt &#039;lol&#039; then we will get here and return 0 to make etpro handle it&#039;&#039;&#039; at line &#039;&#039;8&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we are almost done just end our function.&lt;br /&gt;
&lt;br /&gt;
:10. So at line &#039;&#039;9&#039;&#039; we will write &#039;&#039;&#039;end --close function et_ConsoleCommand() at line 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/ServerCmdLol.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ConsoleCommand() &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--called when someone types a cokmmand in conosle or uses sa todo a server command&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;local&amp;lt;/font&amp;gt; cmd = et.trap_Argv(&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--load out the first parameter of the test typed in console (the command itself)&amp;lt;/font&amp;gt;&lt;br /&gt;
     cmd = string.lower(cmd) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--convert it to lower case so its easyer to match in our if statements&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; cmd == &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;lol&amp;quot;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--run our code if the command was &#039;dumpuserid&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;hihi\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--print out &#039;hihi&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--return 1 to make etpro ignore the command so u wont get an &#039;invalid command&#039; warning&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close the if at line 7&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--if the command wasnt &#039;lol&#039; then we will get here and return 0 to make etpro handle it&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- close et_ConsoleCommand()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will be able to use &#039;&#039;lol&#039;&#039; as a server command.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2258</id>
		<title>Lua Tutorials</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2258"/>
		<updated>2006-04-28T15:54:49Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: added ServerCmdLol 1e try&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
This page is here to help you understand [[ETPro]] [http://www.lua.org/ Lua] functions.&lt;br /&gt;
&lt;br /&gt;
Before you start on this tutorial I assume you know basic [http://www.lua.org/ Lua] scripting.  If not then I suggest you take a look at 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;
You can also take a look at code made by someone else, a list of [[ETPro]] mods that can be found [[:Category:ETPro:Mods|here]], or our [[ETPro:Lua Sample Code|Lua Sample Code]].&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
===Loading a Script===&lt;br /&gt;
:Scripts are loaded by their file name out of the /etpro sub directory of your Enemy Territory installation, so don&#039;t forget to save them in the right folder.&amp;lt;br&amp;gt;&lt;br /&gt;
:if you want to load HelloWorld.lua you would have to set the server cvar &#039;&#039;&#039;lua_modules&#039;&#039;&#039; to &#039;&#039;&amp;quot;HelloWorld.lua&amp;quot;&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
:If you want to load more mods you can add them to the same variables separated by a space like &#039;&#039;&amp;quot;HelloWorld.lua lol.lua pingpong.lua&amp;quot;&#039;&#039;&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you modify this cvar all currently loaded [http://www.lua.org/ lua] modules will be unloaded.&lt;br /&gt;
&lt;br /&gt;
:After editing your script you save it and then reload it in [[ETPro]] to make your chances take effect, this can simply be done by &#039;&#039;&#039;reset_match&#039;&#039;&#039; server command.&lt;br /&gt;
&lt;br /&gt;
===Development Environment===&lt;br /&gt;
:While scripting you will see your code gets hard to read, its much easier to read with syntax highlighting. This can be done by scripting inside an [http://www.lua.org/ lua] development environment.&lt;br /&gt;
&lt;br /&gt;
:These can be found under the &#039;&#039;Development Environments&#039;&#039; heading at  [http://lua-users.org/wiki/LuaAddons this page].&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Lines written in &#039;&#039;&#039;Bold&#039;&#039;&#039; are the actual lines we are going to write in our scripts.&lt;br /&gt;
===Hello World===&lt;br /&gt;
:Here we will show a simple hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloWorld.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. Therefore we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039;. That function is called once every round at the beginning. It&#039;s a good function to do some initial settings. We do not have to worry about those parameters (levelTime,randomSeed,restart) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) -- called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console.&lt;br /&gt;
&lt;br /&gt;
:3. At line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello World!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end out function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloWorld.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello World!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the server console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Spam===&lt;br /&gt;
:Here we will show a simple Spammy hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloSpam.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] many times to make it spammy. Therefore we will use &#039;&#039;et_RunFrame(levelTime)&#039;&#039;. That function is called every server frame. It is a good function for stuff you need to constantly check but you should not put to much code in here. We do not have to worry about those parameter (levelTime) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_RunFrame(levelTime) --called every serverframe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so, now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;; that function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console&lt;br /&gt;
&lt;br /&gt;
:3. Now at line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello Spam!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end our function at line &#039;&#039;1&#039;&#039; with a simple at line &#039;&#039;3&#039;&#039; &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_RunFrame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloSpam.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_RunFrame(levelTime) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--called every serverframe&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello Spam!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_RunFrame()&amp;lt;/font&amp;gt;&lt;br /&gt;
::Now save and load your script and you will see Hello Spam!!! in the server console.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Client===&lt;br /&gt;
:Here we will show a simple hello world example for the client console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;HelloClient.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need a [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. To do this we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039; as shown in the &#039;&#039;Hello World&#039;&#039; example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) --called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we need a function to print a message to the client his console. We will use et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;message\n\&amp;quot;&amp;quot;)&#039;&#039; to achieve this. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the client&#039;s console.&lt;br /&gt;
::The first parameter is the client slot to send to. When this is -1 ETPro will send the message to all clients. The 2nd parameter looks confusing and like the original author&#039;s spelling, it is. First you have the main command witch is &amp;quot;print  ..&amp;quot;. Then, at the place of the dots, comes the data to send with the print. In our case this is &amp;quot;message\n&amp;quot;&amp;quot;.&lt;br /&gt;
::The \n will send a newline command to the console so the next message written to the console is on the next line. The \&amp;quot; are just quotes but since they are already inside a string you need to prefix them with a \ (commonly known as an escape character).&lt;br /&gt;
&lt;br /&gt;
:3. So just write this at line &#039;&#039;2&#039;&#039; &#039;&#039;&#039;    et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Last we need to end our function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloClient.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.trap_SendServerCommand(-&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;,&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the client&#039;s console at the begin of a round.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Server Command lol===&lt;br /&gt;
:Here we will show how to make a new server command that, will simpely print back &#039;&#039;hihi&#039;&#039;.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;ServerCmdLol.lua&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::To start we need a [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when a server command has been entered.&lt;br /&gt;
::To do this we will use et_ConsoleCommand()&#039;&#039;.&lt;br /&gt;
::Its called for every server command but now for engine commands like &#039;&#039;say&#039;&#039;,&#039;&#039;broadcast&#039;&#039;,&#039;&#039;echo&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_ConsoleCommand()--called when someone types a command in conosle or uses sa todo a server command&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now the first thing we need to know is wut command was entered.&lt;br /&gt;
::Commands there are entered will be split up by spaces so, &#039;&#039;cmd1 hello all&#039;&#039; will split in &amp;quot;cmd1&amp;quot;, &amp;quot;hello&amp;quot; and &amp;quot;all&amp;quot;.&lt;br /&gt;
::The only ecception is that &#039;&#039;cmd2 &amp;quot;hello all&amp;quot;&#039;&#039; will be split up in &amp;quot;cmd2&amp;quot; and &amp;quot;hello all&amp;quot; becase, &amp;quot;hello all&amp;quot; is entered as 1 string&lt;br /&gt;
::To get a part of the command u should use et.trap_Argv(&#039;&#039;partnumber&#039;&#039;)&lt;br /&gt;
::&#039;&#039;partnumber&#039;&#039; 0 is the actual command and, &#039;&#039;partnumber&#039;&#039; 1 is the first parameter of the command&lt;br /&gt;
:: so in our example above we would get:&lt;br /&gt;
:::et.trap_Argv(0) = &amp;quot;cmd1&amp;quot;&lt;br /&gt;
:::et.trap_Argv(1) = &amp;quot;hello&amp;quot;&lt;br /&gt;
:::et.trap_Argv(2) = &amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:3. so at line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;	local cmd = et.trap_Argv(0) --load out the first parameter of the test typed in console (the command itself)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::The commands are send on like they way they where entered so ifu enter &#039;&#039;cMd3&#039;&#039; you will get &#039;&#039;cMd3&#039;&#039;.&lt;br /&gt;
::But that makes them harder to detect there for we will convert the string to lower case using a normal [http://www.lua.org/ lua] function.&lt;br /&gt;
&lt;br /&gt;
:4. to make it lower case we will write &#039;&#039;&#039;	cmd = string.lower(cmd) --convert it to lower case so its easyer to match in our if statements&#039;&#039;&#039; at line &#039;&#039;3&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Ok, now we can use a simpel &#039;&#039;if&#039;&#039; statement to check if the command is &#039;&#039;lol&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:5. So now at line &#039;&#039;4&#039;&#039; write &#039;&#039;&#039;	if cmd == &amp;quot;lol&amp;quot; then --run our code if the command was &amp;quot;dumpuserid&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::If thats true then we will print &amp;quot;hihi&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:6. So at line &#039;&#039;5&#039;&#039; write &#039;&#039;&#039;        et.G_Print(&amp;quot;hihi\n&amp;quot;) --print out &amp;quot;hihi&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we handled the command in our [[ETPro]] [http://www.lua.org/ lua] script therefor, we dont need to send it on to the normal [[ETPro]] code since that will return &amp;quot;Uknown Command&amp;quot; anyway&lt;br /&gt;
::We can let [[ETPro]] ignore the command by returning 1 out of our function.&lt;br /&gt;
&lt;br /&gt;
:7. So at line &#039;&#039;6&#039;&#039; we will write &#039;&#039;&#039;        return 1 --return 1 to make etpro ignore the command so u wont get an &#039;invalid command&#039; warning&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Thats all we need todo for this command so we can start closing our function&lt;br /&gt;
&lt;br /&gt;
:8. At line &#039;&#039;7&#039;&#039; we end our if statement of line &#039;&#039;4&#039;&#039; so we will write &#039;&#039;&#039;	end                       	--close the if at line 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we get to the code that gets executed when the command was not &#039;&#039;lol&#039;&#039;.&lt;br /&gt;
::We got nothing todo here so we will return 0 to make [[ETPro]] habdle it.&lt;br /&gt;
&lt;br /&gt;
:9. make etpro handle all other commands so write &#039;&#039;&#039;	return 0 --if the command wasnt &#039;lol&#039; then we will get here and return 0 to make etpro handle it&#039;&#039;&#039; at line &#039;&#039;8&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we are almost done just end our function.&lt;br /&gt;
&lt;br /&gt;
:10. So at line &#039;&#039;9&#039;&#039; we will write &#039;&#039;&#039;end --close function et_ConsoleCommand() at line 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/ServerCmdLol.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ConsoleCommand() &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--called when someone types a cokmmand in conosle or uses sa todo a server command&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;local&amp;lt;/font&amp;gt; cmd = et.trap_Argv(&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--load out the first parameter of the test typed in console (the command itself)&amp;lt;/font&amp;gt;&lt;br /&gt;
     cmd = string.lower(cmd) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--convert it to lower case so its easyer to match in our if statements&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; cmd == &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;lol&amp;quot;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--run our code if the command was &#039;dumpuserid&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;hihi\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--print out &#039;hihi&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--return 1 to make etpro ignore the command so u wont get an &#039;invalid command&#039; warning&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close the if at line 7&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--if the command wasnt &#039;lol&#039; then we will get here and return 0 to make etpro handle it&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- close et_ConsoleCommand()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the client&#039;s console at the begin of a round.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2257</id>
		<title>Lua Tutorials</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2257"/>
		<updated>2006-04-28T10:25:59Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: samm fixes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
This page is here to help you understand [[ETPro]] [http://www.lua.org/ Lua] functions.&lt;br /&gt;
&lt;br /&gt;
Before you start on this tutorial I assume you know basic [http://www.lua.org/ Lua] scripting.  If not then I suggest you take a look at 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;
You can also take a look at code made by someone else, a list of [[ETPro]] mods that can be found [[:Category:ETPro:Mods|here]], or our [[ETPro:Lua Sample Code|Lua Sample Code]].&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
===Loading a Script===&lt;br /&gt;
:Scripts are loaded by their file name out of the /etpro sub directory of your Enemy Territory installation, so don&#039;t forget to save them in the right folder.&amp;lt;br&amp;gt;&lt;br /&gt;
:if you want to load HelloWorld.lua you would have to set the server cvar &#039;&#039;&#039;lua_modules&#039;&#039;&#039; to &#039;&#039;&amp;quot;HelloWorld.lua&amp;quot;&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
:If you want to load more mods you can add them to the same variables separated by a space like &#039;&#039;&amp;quot;HelloWorld.lua lol.lua pingpong.lua&amp;quot;&#039;&#039;&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you modify this cvar all currently loaded [http://www.lua.org/ lua] modules will be unloaded.&lt;br /&gt;
&lt;br /&gt;
:After editing your script you save it and then reload it in [[ETPro]] to make your chances take effect, this can simply be done by &#039;&#039;&#039;reset_match&#039;&#039;&#039; server command.&lt;br /&gt;
&lt;br /&gt;
===Development Environment===&lt;br /&gt;
:While scripting you will see your code gets hard to read, its much easier to read with syntax highlighting. This can be done by scripting inside an [http://www.lua.org/ lua] development environment.&lt;br /&gt;
&lt;br /&gt;
:These can be found under the &#039;&#039;Development Environments&#039;&#039; heading at  [http://lua-users.org/wiki/LuaAddons this page].&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Lines written in &#039;&#039;&#039;Bold&#039;&#039;&#039; are the actual lines we are going to write in our scripts.&lt;br /&gt;
===Hello World===&lt;br /&gt;
:Here we will show a simple hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it HelloWorld.lua.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. Therefore we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039;. That function is called once every round at the beginning. It&#039;s a good function to do some initial settings. We do not have to worry about those parameters (levelTime,randomSeed,restart) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) -- called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console.&lt;br /&gt;
&lt;br /&gt;
:3. At line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello World!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end out function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloWorld.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello World!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the server console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Spam===&lt;br /&gt;
:Here we will show a simple Spammy hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;&#039;HelloSpam.lua&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] many times to make it spammy. Therefore we will use &#039;&#039;et_RunFrame(levelTime)&#039;&#039;. That function is called every server frame. It is a good function for stuff you need to constantly check but you should not put to much code in here. We do not have to worry about those parameter (levelTime) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_RunFrame(levelTime) --called every serverframe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so, now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;; that function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console&lt;br /&gt;
&lt;br /&gt;
:3. Now at line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello Spam!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end our function at line &#039;&#039;1&#039;&#039; with a simple at line &#039;&#039;3&#039;&#039; &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_RunFrame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloSpam.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_RunFrame(levelTime) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--called every serverframe&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello Spam!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_RunFrame()&amp;lt;/font&amp;gt;&lt;br /&gt;
::Now save and load your script and you will see Hello Spam!!! in the server console.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Client===&lt;br /&gt;
:Here we will show a simple hello world example for the client console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it HelloClient.lua.&lt;br /&gt;
&lt;br /&gt;
::Now we need a [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. To do this we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039; as shown in the &#039;&#039;Hello World&#039;&#039; example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) --called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we need a function to print a message to the client his console. We will use et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;message\n\&amp;quot;&amp;quot;)&#039;&#039; to achieve this. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the client&#039;s console.&lt;br /&gt;
::The first parameter is the client slot to send to. When this is -1 ETPro will send the message to all clients. The 2nd parameter looks confusing and like the original author&#039;s spelling, it is. First you have the main command witch is &amp;quot;print  ..&amp;quot;. Then, at the place of the dots, comes the data to send with the print. In our case this is &amp;quot;message\n&amp;quot;&amp;quot;.&lt;br /&gt;
::The \n will send a newline command to the console so the next message written to the console is on the next line. The \&amp;quot; are just quotes but since they are already inside a string you need to prefix them with a \ (commonly known as an escape character).&lt;br /&gt;
&lt;br /&gt;
:3. So just write this at line &#039;&#039;2&#039;&#039; &#039;&#039;&#039;    et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Last we need to end our function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloClient.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.trap_SendServerCommand(-&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;,&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the client&#039;s console at the begin of a round.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
[[Category:Lua]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=ETPro:Lua_Sample_Code&amp;diff=2233</id>
		<title>ETPro:Lua Sample Code</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=ETPro:Lua_Sample_Code&amp;diff=2233"/>
		<updated>2006-04-27T20:24:12Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: i forgot to color 1 if&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This code does nothing useful besides demonstrate and exercise the [[Lua Mod API]]&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printf wrapper&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et.G_Printf(...)&lt;br /&gt;
        et.G_Print(string.format(unpack(arg)))&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- test some of the supported etpro lua functions&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; test_lua_functions()&lt;br /&gt;
        et.trap_Cvar_Set( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;bla1&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;bla2&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;sv_hostname [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_Cvar_Get( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;sv_hostname&amp;quot;&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;configstring 1 [%s] \n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_GetConfigstring( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
        et.trap_SetConfigstring( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;4&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;yadda test&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;configstring 4 [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_GetConfigstring( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;4&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
        et.trap_SendConsoleCommand( et.EXEC_APPEND, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;cvarlist *charge*\n&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.trap_SendServerCommand( -&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;print \&amp;quot;Yadda yadda\&amp;quot;&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;gentity[1022].classname = [%s]&amp;quot;&amp;lt;/font&amp;gt;, et.gentity_get( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1022&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;classname&amp;quot;&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called when game inits&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame( levelTime, randomSeed, restart )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_InitGame [%d] [%d] [%d]\n&amp;quot;&amp;lt;/font&amp;gt;, levelTime, randomSeed, restart )&lt;br /&gt;
        et.RegisterModname( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;bani qagame &amp;quot;&amp;lt;/font&amp;gt; .. et.FindSelf() )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--     test_lua_functions()&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called every server frame&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_RunFrame( levelTime )&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; math.mod( levelTime, &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1000&amp;lt;/font&amp;gt; ) == &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0 then&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--             et.G_Printf( et_RunFrame [%d]\n&amp;quot;, levelTime )&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every clientcommand&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- return 1 if intercepted, 0 if passthrough&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientCommand( clientNum, cmd )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientCommand: [%d] [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_Argc(), cmd )&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every consolecommand&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- return 1 if intercepted, 0 if passthrough&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ConsoleCommand()&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ConsoleCommand: [%s] [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_Argc(), et.trap_Argv(&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;) )&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; et.trap_Argv(&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;) == &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;listmods&amp;quot;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt;&lt;br /&gt;
                i = &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;&lt;br /&gt;
                &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;repeat&amp;lt;/font&amp;gt;&lt;br /&gt;
                        modname, signature = et.FindMod( i )&lt;br /&gt;
                        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; modname &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;and&amp;lt;/font&amp;gt; signature &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt;&lt;br /&gt;
                                et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;vm slot [%d] name [%s] signature [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, i, modname, signature )&lt;br /&gt;
                                et.IPCSend( i, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;hello&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
                        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
                        i = i + &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;&lt;br /&gt;
                &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;until&amp;lt;/font&amp;gt; modname == &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;nil&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;or&amp;lt;/font&amp;gt; signature == &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;nil&amp;lt;/font&amp;gt;&lt;br /&gt;
                &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;&lt;br /&gt;
  &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called when we receive an IPC from another VM&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_IPCReceive( vmnumber, message )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;IPCReceive [%d] from [%d] message [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.FindSelf(), vmnumber, message )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every ClientConnect&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientConnect( clientNum, firstTime, isBot )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientConnect: [%d] [%d] [%d]\n&amp;quot;&amp;lt;/font&amp;gt;, clientNum, firstTime, isBot )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--     return &amp;quot;go away&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;nil&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every ClientDisconnect&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientDisconnect( clientNum )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientDisconnect: [%d]\n&amp;quot;&amp;lt;/font&amp;gt;, clientNum )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every ClientBegin&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientBegin( clientNum )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientBegin: [%d]\n&amp;quot;&amp;lt;/font&amp;gt;, clientNum )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every ClientUserinfoChanged&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientUserinfoChanged( clientNum )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientUserinfoChanged: [%d] = [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, clientNum, et.trap_GetUserinfo( clientNum ) )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every trap_Printf&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_Print( text )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--     et.G_Printf( &amp;quot;et_Print [%s]&amp;quot;, text )&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2229</id>
		<title>Lua Tutorials</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Lua_Tutorials&amp;diff=2229"/>
		<updated>2006-04-27T14:37:07Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: added sample code link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
This page isn&#039;t finished but it is supposed to make you understand [[ETPro]] [http://www.lua.org/ lua] functions.&lt;br /&gt;
&lt;br /&gt;
Before you start on this tutorial I assume you know basic [http://www.lua.org/ lua] scripting. If not then I suggest you take a look at 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;
You can also take a look at someone else his code, a list of [[ETPro]] mods can be found [[:Category:ETPro:Mods|here]] or, look at the [[ETPro:Lua Sample Code]]&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
===Loading a Script===&lt;br /&gt;
:Scripts are loaded by their file name out of the /etpro sub directory of your Enemy Territory installation, so don&#039;t forget to save them in the right folder.&amp;lt;br&amp;gt;&lt;br /&gt;
:if you want to load HelloWorld.lua you would have to set the server cvar &#039;&#039;&#039;lua_modules&#039;&#039;&#039; to &#039;&#039;&amp;quot;HelloWorld.lua&amp;quot;&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
:If you want to load more mods you can add them to the same variables separated by a space like &#039;&#039;&amp;quot;HelloWorld.lua lol.lua pingpong.lua&amp;quot;&#039;&#039;&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you modify this cvar all currently loaded [http://www.lua.org/ lua] modules will be unloaded.&lt;br /&gt;
&lt;br /&gt;
:After editing your script you save it and then reload it in [[ETPro]] to make your chances take effect, this can simply be done by &#039;&#039;&#039;reset_match&#039;&#039;&#039; server command.&lt;br /&gt;
&lt;br /&gt;
===Development Environment===&lt;br /&gt;
:While scripting you will see your code gets hard to read, its much easier to read with syntax highlighting. This can be done be scripting inside an [http://www.lua.org/ lua] development environment.&lt;br /&gt;
&lt;br /&gt;
:At [http://lua-users.org/wiki/LuaAddons this page] under &#039;&#039;[http://lua-users.org/wiki/LuaAddons development environments]&#039;&#039; you will find a list of [http://lua-users.org/wiki/LuaAddons development environments].&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
:&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Lines written in &#039;&#039;&#039;Bold&#039;&#039;&#039; are the actual lines we are going to write in our script.&lt;br /&gt;
===Hello World===&lt;br /&gt;
:Here we will show a simple hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it HelloWorld.lua.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. Therefore we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039;. That function is called once every round at the beginning. It&#039;s a good function to do some initial settings. We do not have to worry about those parameters (levelTime,randomSeed,restart) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) -- called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console.&lt;br /&gt;
&lt;br /&gt;
:3. At line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello World!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end out function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloWorld.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello World!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the server console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Spam===&lt;br /&gt;
:Here we will show a simple Spammy hello world example for the server console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it &#039;&#039;&#039;HelloSpam.lua&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
::Now we need an [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] many times to make it spammy. Therefore we will use &#039;&#039;et_RunFrame(levelTime)&#039;&#039;. That function is called every server frame. It is a good function for stuff you need to constantly check but you should not put to much code in here. We do not have to worry about those parameter (levelTime) in this example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_RunFrame(levelTime) --called every serverframe&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we got a part of our script that is called at the beginning of a round so, now we can add our code to it. We are going to print &#039;&#039;&amp;quot;hello world&amp;quot;&#039;&#039; in the server console. To do this we will use &#039;&#039;et.G_Print(&amp;quot;message&amp;quot;)&#039;&#039;; that function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the server console&lt;br /&gt;
&lt;br /&gt;
:3. Now at line &#039;&#039;2&#039;&#039; we will write &#039;&#039;&#039;    et.G_Print(&amp;quot;Hello Spam!!!\n&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Lastly we need to end our function at line &#039;&#039;1&#039;&#039; with a simple at line &#039;&#039;3&#039;&#039; &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_RunFrame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloSpam.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_RunFrame(levelTime) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--called every serverframe&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.G_Print(&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;Hello Spam!!!\n&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--close et_RunFrame()&amp;lt;/font&amp;gt;&lt;br /&gt;
::Now save and load your script and you will see Hello Spam!!! in the server console.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
===Hello Client===&lt;br /&gt;
:Here we will show a simple hello world example for the client console.&lt;br /&gt;
:Just follow the steps and read the comments.&lt;br /&gt;
&lt;br /&gt;
:1. First we need a new file so, create a new file and name it HelloClient.lua.&lt;br /&gt;
&lt;br /&gt;
::Now we need a [[ETPro]] [http://www.lua.org/ lua] function that will be called automatically by [[ETPro]] when we want it. To do this we will use &#039;&#039;et_InitGame(levelTime,randomSeed,restart)&#039;&#039; as shown in the &#039;&#039;Hello World&#039;&#039; example.&lt;br /&gt;
&lt;br /&gt;
:2. Inside our file at line &#039;&#039;1&#039;&#039; we will write &#039;&#039;&#039;function et_InitGame(levelTime,randomSeed,restart) --called at beginning of a gameround&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now we need a function to print a message to the client his console. We will use et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;message\n\&amp;quot;&amp;quot;)&#039;&#039; to achieve this. That function will simply print the &#039;&#039;&amp;quot;message&amp;quot;&#039;&#039; in the client&#039;s console.&lt;br /&gt;
::The first parameter is the client slot to send to. When this is -1 ETPro will send the message to all clients. The 2nd parameter looks confusing and like the original author&#039;s spelling, it is. First you have the main command witch is &amp;quot;print  ..&amp;quot;. Then, at the place of the dots, comes the data to send with the print. In our case this is &amp;quot;message\n&amp;quot;&amp;quot;.&lt;br /&gt;
::The \n will send a newline command to the console so the next message written to the console is on the next line. The \&amp;quot; are just quotes but since they are already inside a string you need to prefix them with a \ (commonly known as an escape character).&lt;br /&gt;
&lt;br /&gt;
:3. So just write this at line &#039;&#039;2&#039;&#039; &#039;&#039;&#039;    et.trap_SendServerCommand(-1,&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;) -- printout our text to the console&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Last we need to end our function at line &#039;&#039;1&#039;&#039; with a simple &#039;&#039;end&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:4. At line &#039;&#039;3&#039;&#039; place &#039;&#039;&#039;end --close et_InitGame()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::Now if you did it right you should have something like [http://home.zonnet.nl/westhof99/lua/HelloClient.lua this]:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame(levelTime,randomSeed,restart) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called at beginning of a gameround&amp;lt;/font&amp;gt;&lt;br /&gt;
     et.trap_SendServerCommand(-&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;,&amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;print \&amp;quot;Hello Client\n\&amp;quot;&amp;quot;&amp;lt;/font&amp;gt;) &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printout our text to the console&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- close et_InitGame()&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::Now save and load your script and you will see Hello World!!! in the client&#039;s console at the begin of a round.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;br /&gt;
[[Category:ETPro:LUA]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=ETPro:Lua_Sample_Code&amp;diff=2228</id>
		<title>ETPro:Lua Sample Code</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=ETPro:Lua_Sample_Code&amp;diff=2228"/>
		<updated>2006-04-27T14:33:14Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: syntax highlight part 2 + removed old et_ClientSay&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This code does nothing useful besides demonstrate and exercise the [[ETPro:Lua Mod API]]&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printf wrapper&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et.G_Printf(...)&lt;br /&gt;
        et.G_Print(string.format(unpack(arg)))&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- test some of the supported etpro lua functions&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; test_lua_functions()&lt;br /&gt;
        et.trap_Cvar_Set( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;bla1&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;bla2&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;sv_hostname [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_Cvar_Get( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;sv_hostname&amp;quot;&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;configstring 1 [%s] \n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_GetConfigstring( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
        et.trap_SetConfigstring( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;4&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;yadda test&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;configstring 4 [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_GetConfigstring( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;4&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
        et.trap_SendConsoleCommand( et.EXEC_APPEND, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;cvarlist *charge*\n&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.trap_SendServerCommand( -&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;print \&amp;quot;Yadda yadda\&amp;quot;&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;gentity[1022].classname = [%s]&amp;quot;&amp;lt;/font&amp;gt;, et.gentity_get( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1022&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;classname&amp;quot;&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called when game inits&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame( levelTime, randomSeed, restart )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_InitGame [%d] [%d] [%d]\n&amp;quot;&amp;lt;/font&amp;gt;, levelTime, randomSeed, restart )&lt;br /&gt;
        et.RegisterModname( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;bani qagame &amp;quot;&amp;lt;/font&amp;gt; .. et.FindSelf() )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--     test_lua_functions()&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called every server frame&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_RunFrame( levelTime )&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; math.mod( levelTime, &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1000&amp;lt;/font&amp;gt; ) == &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0 then&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--             et.G_Printf( et_RunFrame [%d]\n&amp;quot;, levelTime )&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every clientcommand&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- return 1 if intercepted, 0 if passthrough&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientCommand( clientNum, cmd )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientCommand: [%d] [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_Argc(), cmd )&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every consolecommand&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- return 1 if intercepted, 0 if passthrough&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ConsoleCommand()&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ConsoleCommand: [%s] [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_Argc(), et.trap_Argv(&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;) )&lt;br /&gt;
        if et.trap_Argv(&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;) == &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;listmods&amp;quot;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt;&lt;br /&gt;
                i = &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;&lt;br /&gt;
                &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;repeat&amp;lt;/font&amp;gt;&lt;br /&gt;
                        modname, signature = et.FindMod( i )&lt;br /&gt;
                        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; modname &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;and&amp;lt;/font&amp;gt; signature &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;then&amp;lt;/font&amp;gt;&lt;br /&gt;
                                et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;vm slot [%d] name [%s] signature [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, i, modname, signature )&lt;br /&gt;
                                et.IPCSend( i, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;hello&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
                        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
                        i = i + &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;&lt;br /&gt;
                &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;until&amp;lt;/font&amp;gt; modname == &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;nil&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;or&amp;lt;/font&amp;gt; signature == &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;nil&amp;lt;/font&amp;gt;&lt;br /&gt;
                &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;&lt;br /&gt;
  &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called when we receive an IPC from another VM&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_IPCReceive( vmnumber, message )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;IPCReceive [%d] from [%d] message [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.FindSelf(), vmnumber, message )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every ClientConnect&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientConnect( clientNum, firstTime, isBot )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientConnect: [%d] [%d] [%d]\n&amp;quot;&amp;lt;/font&amp;gt;, clientNum, firstTime, isBot )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--     return &amp;quot;go away&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;return&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;nil&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every ClientDisconnect&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientDisconnect( clientNum )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientDisconnect: [%d]\n&amp;quot;&amp;lt;/font&amp;gt;, clientNum )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every ClientBegin&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientBegin( clientNum )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientBegin: [%d]\n&amp;quot;&amp;lt;/font&amp;gt;, clientNum )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every ClientUserinfoChanged&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientUserinfoChanged( clientNum )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientUserinfoChanged: [%d] = [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, clientNum, et.trap_GetUserinfo( clientNum ) )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every trap_Printf&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_Print( text )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--     et.G_Printf( &amp;quot;et_Print [%s]&amp;quot;, text )&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=ETPro:Lua_Sample_Code&amp;diff=2227</id>
		<title>ETPro:Lua Sample Code</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=ETPro:Lua_Sample_Code&amp;diff=2227"/>
		<updated>2006-04-27T13:19:55Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: connected into 1 block&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This code does nothing useful besides demonstrate and exercise the [[ETPro:Lua Mod API]]&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printf wrapper&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et.G_Printf(...)&lt;br /&gt;
        et.G_Print(string.format(unpack(arg)))&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- test some of the supported etpro lua functions&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; test_lua_functions()&lt;br /&gt;
        et.trap_Cvar_Set( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;bla1&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;bla2&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;sv_hostname [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_Cvar_Get( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;sv_hostname&amp;quot;&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;configstring 1 [%s] \n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_GetConfigstring( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
        et.trap_SetConfigstring( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;4&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;yadda test&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;configstring 4 [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_GetConfigstring( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;4&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
        et.trap_SendConsoleCommand( et.EXEC_APPEND, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;cvarlist *charge*\n&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.trap_SendServerCommand( -&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;print \&amp;quot;Yadda yadda\&amp;quot;&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;gentity[1022].classname = [%s]&amp;quot;&amp;lt;/font&amp;gt;, et.gentity_get( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1022&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;classname&amp;quot;&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called when game inits&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame( levelTime, randomSeed, restart )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_InitGame [%d] [%d] [%d]\n&amp;quot;&amp;lt;/font&amp;gt;, levelTime, randomSeed, restart )&lt;br /&gt;
        et.RegisterModname( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;bani qagame &amp;quot;&amp;lt;/font&amp;gt; .. et.FindSelf() )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--      test_lua_functions()&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called every server frame&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_RunFrame( levelTime )&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; math.mod( levelTime, &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1000&amp;lt;/font&amp;gt; ) == &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0 then&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--              et.G_Printf( et_RunFrame [%d]\n&amp;quot;, levelTime )&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every clientcommand&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- return 1 if intercepted, 0 if passthrough&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientCommand( clientNum, cmd )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientCommand: [%d] [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_Argc(), cmd )&lt;br /&gt;
        return &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- called for every consolecommand&lt;br /&gt;
-- return 1 if intercepted, 0 if passthrough&lt;br /&gt;
function et_ConsoleCommand()&lt;br /&gt;
        et.G_Printf( &amp;quot;et_ConsoleCommand: [%s] [%s]\n&amp;quot;, et.trap_Argc(), et.trap_Argv(0) )&lt;br /&gt;
        if et.trap_Argv(0) == &amp;quot;listmods&amp;quot; then&lt;br /&gt;
                i = 1&lt;br /&gt;
                repeat&lt;br /&gt;
                        modname, signature = et.FindMod( i )&lt;br /&gt;
                        if modname and signature then&lt;br /&gt;
                                et.G_Printf( &amp;quot;vm slot [%d] name [%s] signature [%s]\n&amp;quot;, i, modname, signature )&lt;br /&gt;
                                et.IPCSend( i, &amp;quot;hello&amp;quot; )&lt;br /&gt;
                        end&lt;br /&gt;
                        i = i + 1&lt;br /&gt;
                until modname == nil or signature == nil&lt;br /&gt;
                return 1&lt;br /&gt;
        end&lt;br /&gt;
        return 0&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- called when we receive an IPC from another VM&lt;br /&gt;
function et_IPCReceive( vmnumber, message )&lt;br /&gt;
        et.G_Printf( &amp;quot;IPCReceive [%d] from [%d] message [%s]\n&amp;quot;, et.FindSelf(), vmnumber, message )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- called for every ClientConnect&lt;br /&gt;
function et_ClientConnect( clientNum, firstTime, isBot )&lt;br /&gt;
        et.G_Printf( &amp;quot;et_ClientConnect: [%d] [%d] [%d]\n&amp;quot;, clientNum, firstTime, isBot )&lt;br /&gt;
--      return &amp;quot;go away&amp;quot;&lt;br /&gt;
        return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- called for every ClientDisconnect&lt;br /&gt;
function et_ClientDisconnect( clientNum )&lt;br /&gt;
        et.G_Printf( &amp;quot;et_ClientDisconnect: [%d]\n&amp;quot;, clientNum )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- called for every ClientBegin&lt;br /&gt;
function et_ClientBegin( clientNum )&lt;br /&gt;
        et.G_Printf( &amp;quot;et_ClientBegin: [%d]\n&amp;quot;, clientNum )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- called for every ClientUserinfoChanged&lt;br /&gt;
function et_ClientUserinfoChanged( clientNum )&lt;br /&gt;
        et.G_Printf( &amp;quot;et_ClientUserinfoChanged: [%d] = [%s]\n&amp;quot;, clientNum, et.trap_GetUserinfo( clientNum ) )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- called for every trap_Printf&lt;br /&gt;
function et_Print( text )&lt;br /&gt;
--      et.G_Printf( &amp;quot;et_Print [%s]&amp;quot;, text )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function et_ClientSay( cno, mode, text )&lt;br /&gt;
        et.G_Printf( &amp;quot;et_ClientSay [%d] [%d] [%s]\n&amp;quot;, cno, mode, text )&lt;br /&gt;
        et.G_Say( cno, mode, text )&lt;br /&gt;
        return 1&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:ETPro]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=ETPro:Lua_Sample_Code&amp;diff=2226</id>
		<title>ETPro:Lua Sample Code</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=ETPro:Lua_Sample_Code&amp;diff=2226"/>
		<updated>2006-04-27T13:11:26Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: syntax highlighting part 1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This code does nothing useful besides demonstrate and exercise the [[ETPro:Lua Mod API]]&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- printf wrapper&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et.G_Printf(...)&lt;br /&gt;
        et.G_Print(string.format(unpack(arg)))&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- test some of the supported etpro lua functions&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; test_lua_functions()&lt;br /&gt;
        et.trap_Cvar_Set( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;bla1&amp;quot;&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;bla2&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;sv_hostname [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_Cvar_Get( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;sv_hostname&amp;quot;&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;configstring 1 [%s] \n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_GetConfigstring( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
        et.trap_SetConfigstring( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;4&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;yadda test&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;configstring 4 [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_GetConfigstring( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;4&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
        et.trap_SendConsoleCommand( et.EXEC_APPEND, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;cvarlist *charge*\n&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.trap_SendServerCommand( -&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;print \&amp;quot;Yadda yadda\&amp;quot;&amp;quot;&amp;lt;/font&amp;gt; )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;gentity[1022].classname = [%s]&amp;quot;&amp;lt;/font&amp;gt;, et.gentity_get( &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1022&amp;lt;/font&amp;gt;, &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;classname&amp;quot;&amp;lt;/font&amp;gt; ) )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called when game inits&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_InitGame( levelTime, randomSeed, restart )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_InitGame [%d] [%d] [%d]\n&amp;quot;&amp;lt;/font&amp;gt;, levelTime, randomSeed, restart )&lt;br /&gt;
        et.RegisterModname( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;bani qagame &amp;quot;&amp;lt;/font&amp;gt; .. et.FindSelf() )&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--      test_lua_functions()&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called every server frame&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_RunFrame( levelTime )&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;if&amp;lt;/font&amp;gt; math.mod( levelTime, &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;1000&amp;lt;/font&amp;gt; ) == &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0 then&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;--              et.G_Printf( et_RunFrame [%d]\n&amp;quot;, levelTime )&amp;lt;/font&amp;gt;&lt;br /&gt;
        &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- called for every clientcommand&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;-- return 1 if intercepted, 0 if passthrough&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;function&amp;lt;/font&amp;gt; et_ClientCommand( clientNum, cmd )&lt;br /&gt;
        et.G_Printf( &amp;lt;font color=&amp;quot;darkblue&amp;quot;&amp;gt;&amp;quot;et_ClientCommand: [%d] [%s]\n&amp;quot;&amp;lt;/font&amp;gt;, et.trap_Argc(), cmd )&lt;br /&gt;
        return &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;0&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- called for every consolecommand&lt;br /&gt;
-- return 1 if intercepted, 0 if passthrough&lt;br /&gt;
function et_ConsoleCommand()&lt;br /&gt;
        et.G_Printf( &amp;quot;et_ConsoleCommand: [%s] [%s]\n&amp;quot;, et.trap_Argc(), et.trap_Argv(0) )&lt;br /&gt;
        if et.trap_Argv(0) == &amp;quot;listmods&amp;quot; then&lt;br /&gt;
                i = 1&lt;br /&gt;
                repeat&lt;br /&gt;
                        modname, signature = et.FindMod( i )&lt;br /&gt;
                        if modname and signature then&lt;br /&gt;
                                et.G_Printf( &amp;quot;vm slot [%d] name [%s] signature [%s]\n&amp;quot;, i, modname, signature )&lt;br /&gt;
                                et.IPCSend( i, &amp;quot;hello&amp;quot; )&lt;br /&gt;
                        end&lt;br /&gt;
                        i = i + 1&lt;br /&gt;
                until modname == nil or signature == nil&lt;br /&gt;
                return 1&lt;br /&gt;
        end&lt;br /&gt;
        return 0&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- called when we receive an IPC from another VM&lt;br /&gt;
function et_IPCReceive( vmnumber, message )&lt;br /&gt;
        et.G_Printf( &amp;quot;IPCReceive [%d] from [%d] message [%s]\n&amp;quot;, et.FindSelf(), vmnumber, message )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- called for every ClientConnect&lt;br /&gt;
function et_ClientConnect( clientNum, firstTime, isBot )&lt;br /&gt;
        et.G_Printf( &amp;quot;et_ClientConnect: [%d] [%d] [%d]\n&amp;quot;, clientNum, firstTime, isBot )&lt;br /&gt;
--      return &amp;quot;go away&amp;quot;&lt;br /&gt;
        return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- called for every ClientDisconnect&lt;br /&gt;
function et_ClientDisconnect( clientNum )&lt;br /&gt;
        et.G_Printf( &amp;quot;et_ClientDisconnect: [%d]\n&amp;quot;, clientNum )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- called for every ClientBegin&lt;br /&gt;
function et_ClientBegin( clientNum )&lt;br /&gt;
        et.G_Printf( &amp;quot;et_ClientBegin: [%d]\n&amp;quot;, clientNum )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- called for every ClientUserinfoChanged&lt;br /&gt;
function et_ClientUserinfoChanged( clientNum )&lt;br /&gt;
        et.G_Printf( &amp;quot;et_ClientUserinfoChanged: [%d] = [%s]\n&amp;quot;, clientNum, et.trap_GetUserinfo( clientNum ) )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- called for every trap_Printf&lt;br /&gt;
function et_Print( text )&lt;br /&gt;
--      et.G_Printf( &amp;quot;et_Print [%s]&amp;quot;, text )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function et_ClientSay( cno, mode, text )&lt;br /&gt;
        et.G_Printf( &amp;quot;et_ClientSay [%d] [%d] [%s]\n&amp;quot;, cno, mode, text )&lt;br /&gt;
        et.G_Say( cno, mode, text )&lt;br /&gt;
        return 1&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:ETPro]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Mod_API&amp;diff=2198</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=2198"/>
		<updated>2006-04-26T09:07:37Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
ETPro now supports serverside 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. ETPro also provides an &amp;quot;et&amp;quot; library of function calls for lua to access the server engine, and provides callbacks so a serverside 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 Totural about [[ETPro]] [http://www.lua.org/ lua] scripting for nubs can be found [[:Category:ETPro:Lua_Noob|here]].&lt;br /&gt;
&lt;br /&gt;
API Requests can be discussed [http://wolfwiki.anime.net/index.php/Talk:ETPro:Lua_Mod_API here].&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 re-load my lua file without restarting the whole server ?&amp;lt;br&amp;gt;&lt;br /&gt;
A: change maps or map_restart&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]]&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;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Mod_API&amp;diff=2195</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=2195"/>
		<updated>2006-04-26T07:54:47Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: aded totural page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
ETPro now supports serverside 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. ETPro also provides an &amp;quot;et&amp;quot; library of function calls for lua to access the server engine, and provides callbacks so a serverside 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 Totural for [[ETPro]] [http://www.lua.org/ lua] scripting for nubs can be found [[:Category:ETPro:Lua_Noob|here]].&lt;br /&gt;
&lt;br /&gt;
API Requests can be discussed [http://wolfwiki.anime.net/index.php/Talk:ETPro:Lua_Mod_API here].&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 re-load my lua file without restarting the whole server ?&amp;lt;br&amp;gt;&lt;br /&gt;
A: change maps or map_restart&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]]&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;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2107</id>
		<title>Fieldname</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2107"/>
		<updated>2006-03-08T17:51:34Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: fixors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
==Entity Fieldnames==&lt;br /&gt;
List of fields supported by [[ETPro:Lua Mod API#entities|et.gentity_get() and et.gentity_set()]] functions&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;field;type;access&amp;quot; widths=&amp;quot;180;120;60&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
activator;entity;RO;&lt;br /&gt;
chain;entity;RW;&lt;br /&gt;
classname;string;RW;&lt;br /&gt;
client.inactivityTime;integer;RW;&lt;br /&gt;
client.inactivityWarning;qboolean;RW;&lt;br /&gt;
clipmask;integer;?;&lt;br /&gt;
closespeed;float;RW;&lt;br /&gt;
count;integer;RW;&lt;br /&gt;
count2;integer;RW;&lt;br /&gt;
damage;integer;RW;&lt;br /&gt;
deathType;meansOfDeath_t;RW;&lt;br /&gt;
delay;float;RW;&lt;br /&gt;
dl_atten;integer;RW;&lt;br /&gt;
dl_color;vec3;RW;&lt;br /&gt;
dl_shader;string;RO;&lt;br /&gt;
dl_stylestring;string;RO;&lt;br /&gt;
duration;float;RW;&lt;br /&gt;
end_size;integer;RW;&lt;br /&gt;
enemy;entity;RW;&lt;br /&gt;
flags;bitflag;RO;&lt;br /&gt;
harc;float;RW;&lt;br /&gt;
health;integer;RW;&lt;br /&gt;
inuse;qboolean;RO;&lt;br /&gt;
isProp;qboolean;RO;&lt;br /&gt;
item;string;RW;&lt;br /&gt;
key;integer;RW;&lt;br /&gt;
message;string;RW;&lt;br /&gt;
methodOfDeath;integer;RW;&lt;br /&gt;
mg42BaseEnt;integer;RW;&lt;br /&gt;
missionLevel;integer;RW;&lt;br /&gt;
model;string;RO;&lt;br /&gt;
model2;string;RO;&lt;br /&gt;
nextTrain;entity;RW;&lt;br /&gt;
noise_index;integer;RW;&lt;br /&gt;
origin;vec3;RW;&lt;br /&gt;
pers.connected;connected_t;?;&lt;br /&gt;
pers.netname;string;?;&lt;br /&gt;
pers.localClient;qboolean;?;&lt;br /&gt;
pers.initialSpawn;qboolean;?; &lt;br /&gt;
pers.enterTime;integer;?;&lt;br /&gt;
pers.connectTime;integer;?; &lt;br /&gt;
pers.teamState.state;teamstatestate_t;?;&lt;br /&gt;
pers.voteCount;integer;?;&lt;br /&gt;
pers.teamVoteCount;integer;?; &lt;br /&gt;
pers.complaints;integer;?; &lt;br /&gt;
pers.complaintClient;integer;?; &lt;br /&gt;
pers.complaintEndTime;integer;?; &lt;br /&gt;
pers.lastReinforceTime;integer;?; &lt;br /&gt;
pers.applicationClient;integer;?; &lt;br /&gt;
pers.applicationEndTime;integer;?; &lt;br /&gt;
pers.invitationClient;integer;?; &lt;br /&gt;
pers.invitationEndTime;integer;?; &lt;br /&gt;
pers.propositionClient;integer;?; &lt;br /&gt;
pers.propositionClient2;integer;?; &lt;br /&gt;
pers.propositionEndTime;integer;?; &lt;br /&gt;
pers.autofireteamEndTime;integer;?; &lt;br /&gt;
pers.autofireteamCreateEndTime;integer;?; &lt;br /&gt;
pers.autofireteamJoinEndTime;integer;?; &lt;br /&gt;
pers.lastSpawnTime;integer;?;&lt;br /&gt;
pers.ready;qboolean;?;&lt;br /&gt;
prevTrain;entity;RW;&lt;br /&gt;
props_frame_state;integer;RO;&lt;br /&gt;
ps.stats;integer array;RW; &lt;br /&gt;
ps.persistant;integer array;RW;&lt;br /&gt;
ps.ping;integer;?;&lt;br /&gt;
ps.powerups;integer array;RW;&lt;br /&gt;
ps.ammo;integer array;RW; &lt;br /&gt;
ps.ammoclip;integer array;RW;&lt;br /&gt;
r.absmax;vec3;RO;&lt;br /&gt;
r.absmin;vec3;RO;&lt;br /&gt;
r.bmodel;qboolean;RO;&lt;br /&gt;
r.contents;integer;RW;&lt;br /&gt;
r.currentAngles;vec3;RW;&lt;br /&gt;
r.currentOrigin;vec3;RW;&lt;br /&gt;
r.eventTime;integer;RW;&lt;br /&gt;
r.linkcount;integer;RO;&lt;br /&gt;
r.linked;qboolean;RO;&lt;br /&gt;
r.maxs;vec3;RW;&lt;br /&gt;
r.mins;vec3;RW;&lt;br /&gt;
r.ownerNum;integer;RW;&lt;br /&gt;
r.singleClient;integer;RW;&lt;br /&gt;
r.svFlags;integer;RW;&lt;br /&gt;
r.worldflags;integer;RO;&lt;br /&gt;
radius;integer;RW;&lt;br /&gt;
random;float;RW;&lt;br /&gt;
rotate;vec3;RW;&lt;br /&gt;
s.angles;vec3;RW;&lt;br /&gt;
s.angles2;vec3;RW;&lt;br /&gt;
s.apos;trajectory;RW;&lt;br /&gt;
s.clientNum;integer;RW;&lt;br /&gt;
s.constantLight;integer;RW;&lt;br /&gt;
s.density;integer;RW;&lt;br /&gt;
s.dl_intensity;integer;RW;&lt;br /&gt;
s.dmgFlags;integer;RW;&lt;br /&gt;
s.eFlags;integer;RW;&lt;br /&gt;
s.eType;integer;?;&lt;br /&gt;
s.effect1Time;integer;RW;&lt;br /&gt;
s.effect2Time;integer;RW;&lt;br /&gt;
s.effect3Time;integer;RW;&lt;br /&gt;
s.frame;integer;RW;&lt;br /&gt;
s.groundEntityNum;integer;RO;&lt;br /&gt;
s.loopSound;integer;RW;&lt;br /&gt;
s.modelindex;integer;RW;&lt;br /&gt;
s.modelindex2;integer;RW;&lt;br /&gt;
s.number;integer;RO;&lt;br /&gt;
s.onFireEnd;integer;RW;&lt;br /&gt;
s.onFireStart;integer;RW;&lt;br /&gt;
s.origin;vec3;?;&lt;br /&gt;
s.origin2;vec3;?;&lt;br /&gt;
s.pos;trajectory;RW;&lt;br /&gt;
s.powerups;integer;RO;&lt;br /&gt;
s.solid;integer;RW;&lt;br /&gt;
s.teamNum;integer;RW;&lt;br /&gt;
s.time;integer;RW;&lt;br /&gt;
s.time2;integer;RW;&lt;br /&gt;
s.weapon;integer;RO;&lt;br /&gt;
scriptName;string;RO;&lt;br /&gt;
sess.sessionTeam;team_t;RW;&lt;br /&gt;
sess.spectatorTime;integer;RW;&lt;br /&gt;
sess.spectatorState;spectatorState_t;RW;&lt;br /&gt;
sess.spectatorClient;integer;RW;&lt;br /&gt;
sess.latchSpectatorClient;integer;RW;&lt;br /&gt;
sess.playerType;integer;RW;&lt;br /&gt;
sess.playerWeapon;integer;RW;&lt;br /&gt;
sess.playerWeapon2;integer;RW;&lt;br /&gt;
sess.spawnObjectiveIndex;integer;RW;&lt;br /&gt;
sess.latchPlayerType;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon2;integer;RW;&lt;br /&gt;
sess.damage_given;integer;RW;&lt;br /&gt;
sess.damage_received;integer;RW;&lt;br /&gt;
sess.deaths;integer;RW;&lt;br /&gt;
sess.game_points;integer;RW;&lt;br /&gt;
sess.gibs;integer;RW;&lt;br /&gt;
sess.kills;integer;RW;&lt;br /&gt;
sess.medals;integer array;RW;&lt;br /&gt;
sess.muted;qboolean;RW;&lt;br /&gt;
sess.rank;integer;RW;&lt;br /&gt;
sess.referee;integer;RW;&lt;br /&gt;
sess.rounds;integer;RW;&lt;br /&gt;
sess.semiadmin;integer;RW;&lt;br /&gt;
sess.skill;integer array;RW;&lt;br /&gt;
sess.spec_invite;integer;RW;&lt;br /&gt;
sess.spec_team;integer;RW;&lt;br /&gt;
sess.suicides;integer;RW;&lt;br /&gt;
sess.team_damage;integer;RW;&lt;br /&gt;
sess.team_kills;integer;RW;&lt;br /&gt;
sess.team_received;integer;RW;&lt;br /&gt;
sess.aWeaponStats;weapon_stat_t;RW;&lt;br /&gt;
spawnflags;integer;RO;&lt;br /&gt;
spawnitem;string;RO;&lt;br /&gt;
speed;float;RW;&lt;br /&gt;
splashDamage;integer;RW;&lt;br /&gt;
splashMethodOfDeath;integer;RW;&lt;br /&gt;
splashRadius;integer;RW;&lt;br /&gt;
start_size;integer;RW;&lt;br /&gt;
tagName;string;RO;&lt;br /&gt;
tagParent;entity;RW;&lt;br /&gt;
takedamage;boolean;RW;&lt;br /&gt;
tankLink;entity;RW;&lt;br /&gt;
target;string;RW;&lt;br /&gt;
TargetAngles;vec3;RW;&lt;br /&gt;
TargetFlag;integer;RO;&lt;br /&gt;
targetname;string;RO;&lt;br /&gt;
teamchain;entity;RW;&lt;br /&gt;
teammaster;entity;RW;&lt;br /&gt;
track;string;RO;&lt;br /&gt;
varc;float;RW;&lt;br /&gt;
wait;float;RW;&lt;br /&gt;
waterlevel;integer;RO;&lt;br /&gt;
watertype;integer;RO;&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
:&#039;&#039;note&#039;&#039;: all the sess.* fields will return nil unless the entity is associated with client slot &amp;lt; sv_maxclients.&lt;br /&gt;
:&#039;&#039;note&#039;&#039;: all array variables need tobe called or get whit an additional parameter&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==ET variable types==&lt;br /&gt;
&lt;br /&gt;
===qboolean===&lt;br /&gt;
:a &#039;&#039;&#039;qboolean&#039;&#039;&#039; is a bool made of a number, it has 2 valeus 1 or 0&lt;br /&gt;
:0 is considered as false&lt;br /&gt;
:1 is considered as true&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===vec3===&lt;br /&gt;
:a &#039;&#039;&#039;vec3_t&#039;&#039;&#039; is a 3-element array of numbers (C definition: typedef float vec3_t[3];). It is usually used to store and process coordinates in 3D space.&amp;lt;br&amp;gt;&lt;br /&gt;
:In etpro-lua a vector is an array (table indexed by integers) containing 3 numbers. It can be accessed by&lt;br /&gt;
:doing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
origin = et.gentity_get(entNum,&amp;quot;r.currentOrigin&amp;quot;) --a vec3 value&lt;br /&gt;
x,y,z = origin[1],origin[2],origin[3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===trajectory===&lt;br /&gt;
:a &#039;&#039;&#039;trajectory&#039;&#039;&#039; is returned as a lua table described below&lt;br /&gt;
&amp;lt;pre&amp;gt;{&lt;br /&gt;
  trDuration = &amp;lt;number&amp;gt;, --- int&lt;br /&gt;
  trTime = &amp;lt;number&amp;gt;, -- int&lt;br /&gt;
  trType = &amp;lt;number&amp;gt;, -- see below for allowed values&lt;br /&gt;
  trBase = &amp;lt;vec3_t&amp;gt;, -- vec3, as described above&lt;br /&gt;
  trDelta = &amp;lt;vec3_t&amp;gt; -- also a vec3&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
: the allowed values for trType (along with the enum names and original comments from the ET source), are as follows. Note &lt;br /&gt;
: that not all values make sense for all entity types &lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;number;type;discription&amp;quot; widths=&amp;quot;40;160;450&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
1;TR_STATIONARY;&lt;br /&gt;
2;TR_INTERPOLATE;non-parametric, but interpolate between snapshots;&lt;br /&gt;
3;TR_LINEAR;&lt;br /&gt;
4;TR_LINEAR_STOP;&lt;br /&gt;
5;TR_LINEAR_STOP_BACK;reverse movement can be different than forward;&lt;br /&gt;
6;TR_SINE;value = base + sin( time / duration ) * delta;&lt;br /&gt;
7;TR_GRAVITY;&lt;br /&gt;
8;TR_GRAVITY_LOW;&lt;br /&gt;
9;TR_GRAVITY_FLOAT;super low grav with no gravity acceleration;&lt;br /&gt;
10;TR_GRAVITY_PAUSED;has stopped, but trace to see if it should be switched back to TR_GRAVITY;&lt;br /&gt;
11;TR_ACCELERATE;&lt;br /&gt;
12;TR_DECCELERATE;&lt;br /&gt;
13;TR_SPLINE;&lt;br /&gt;
14;TR_LINEAR_PATH;&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===entity===&lt;br /&gt;
:The fields listed as having type &#039;&#039;&#039;enitity&#039;&#039;&#039; return an entity number or nil. Entity numbers are integers from 0 through 1023. Some of the entity numbers have special meanings:&lt;br /&gt;
:0 - (sv_privateclients - 1) are reserved for clients who connect with the private slot password&lt;br /&gt;
:0 - 63 are reserved for clients. A client&#039;s entity number is also its client number (as shown by /players for example)&lt;br /&gt;
:1022 is the &#039;&#039;&#039;worldspawn&#039;&#039;&#039; entity&lt;br /&gt;
:1023 is &#039;&#039;&#039;ENTITYNUM_NONE&#039;&#039;&#039; which is used instead of null in C under some circumstances to indicate no entity. This is needed where an entity number will be passed over the network.&lt;br /&gt;
:&#039;&#039;Note&#039;&#039;: Some other fields not listed as type &#039;entity&#039; may take an entity number value. &#039;&#039;&#039;mg42BaseEnt&#039;&#039;&#039; and &#039;&#039;&#039;s.number&#039;&#039;&#039; are examples.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===meansOfDeath===&lt;br /&gt;
:a &#039;&#039;&#039;meansOfDeath_t&#039;&#039;&#039; is a number indicating the [[etdamage|Method of Death]] Click  [[etdamage|here]] for a list whit posable value&#039;s&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2106</id>
		<title>Fieldname</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2106"/>
		<updated>2006-03-08T17:51:01Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: added qboolean,meansOfDeath_t&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
==Entity Fieldnames==&lt;br /&gt;
List of fields supported by [[ETPro:Lua Mod API#entities|et.gentity_get() and et.gentity_set()]] functions&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;field;type;access&amp;quot; widths=&amp;quot;180;120;60&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
activator;entity;RO;&lt;br /&gt;
chain;entity;RW;&lt;br /&gt;
classname;string;RW;&lt;br /&gt;
client.inactivityTime;integer;RW;&lt;br /&gt;
client.inactivityWarning;qboolean;RW;&lt;br /&gt;
clipmask;integer;?;&lt;br /&gt;
closespeed;float;RW;&lt;br /&gt;
count;integer;RW;&lt;br /&gt;
count2;integer;RW;&lt;br /&gt;
damage;integer;RW;&lt;br /&gt;
deathType;meansOfDeath_t;RW;&lt;br /&gt;
delay;float;RW;&lt;br /&gt;
dl_atten;integer;RW;&lt;br /&gt;
dl_color;vec3;RW;&lt;br /&gt;
dl_shader;string;RO;&lt;br /&gt;
dl_stylestring;string;RO;&lt;br /&gt;
duration;float;RW;&lt;br /&gt;
end_size;integer;RW;&lt;br /&gt;
enemy;entity;RW;&lt;br /&gt;
flags;bitflag;RO;&lt;br /&gt;
harc;float;RW;&lt;br /&gt;
health;integer;RW;&lt;br /&gt;
inuse;qboolean;RO;&lt;br /&gt;
isProp;qboolean;RO;&lt;br /&gt;
item;string;RW;&lt;br /&gt;
key;integer;RW;&lt;br /&gt;
message;string;RW;&lt;br /&gt;
methodOfDeath;integer;RW;&lt;br /&gt;
mg42BaseEnt;integer;RW;&lt;br /&gt;
missionLevel;integer;RW;&lt;br /&gt;
model;string;RO;&lt;br /&gt;
model2;string;RO;&lt;br /&gt;
nextTrain;entity;RW;&lt;br /&gt;
noise_index;integer;RW;&lt;br /&gt;
origin;vec3;RW;&lt;br /&gt;
pers.connected;connected_t;?;&lt;br /&gt;
pers.netname;string;?;&lt;br /&gt;
pers.localClient;qboolean;?;&lt;br /&gt;
pers.initialSpawn;qboolean;?; &lt;br /&gt;
pers.enterTime;integer;?;&lt;br /&gt;
pers.connectTime;integer;?; &lt;br /&gt;
pers.teamState.state;teamstatestate_t;?;&lt;br /&gt;
pers.voteCount;integer;?;&lt;br /&gt;
pers.teamVoteCount;integer;?; &lt;br /&gt;
pers.complaints;integer;?; &lt;br /&gt;
pers.complaintClient;integer;?; &lt;br /&gt;
pers.complaintEndTime;integer;?; &lt;br /&gt;
pers.lastReinforceTime;integer;?; &lt;br /&gt;
pers.applicationClient;integer;?; &lt;br /&gt;
pers.applicationEndTime;integer;?; &lt;br /&gt;
pers.invitationClient;integer;?; &lt;br /&gt;
pers.invitationEndTime;integer;?; &lt;br /&gt;
pers.propositionClient;integer;?; &lt;br /&gt;
pers.propositionClient2;integer;?; &lt;br /&gt;
pers.propositionEndTime;integer;?; &lt;br /&gt;
pers.autofireteamEndTime;integer;?; &lt;br /&gt;
pers.autofireteamCreateEndTime;integer;?; &lt;br /&gt;
pers.autofireteamJoinEndTime;integer;?; &lt;br /&gt;
pers.lastSpawnTime;integer;?;&lt;br /&gt;
pers.ready;qboolean;?;&lt;br /&gt;
prevTrain;entity;RW;&lt;br /&gt;
props_frame_state;integer;RO;&lt;br /&gt;
ps.stats;integer array;RW; &lt;br /&gt;
ps.persistant;integer array;RW;&lt;br /&gt;
ps.ping;integer;?;&lt;br /&gt;
ps.powerups;integer array;RW;&lt;br /&gt;
ps.ammo;integer array;RW; &lt;br /&gt;
ps.ammoclip;integer array;RW;&lt;br /&gt;
r.absmax;vec3;RO;&lt;br /&gt;
r.absmin;vec3;RO;&lt;br /&gt;
r.bmodel;qboolean;RO;&lt;br /&gt;
r.contents;integer;RW;&lt;br /&gt;
r.currentAngles;vec3;RW;&lt;br /&gt;
r.currentOrigin;vec3;RW;&lt;br /&gt;
r.eventTime;integer;RW;&lt;br /&gt;
r.linkcount;integer;RO;&lt;br /&gt;
r.linked;qboolean;RO;&lt;br /&gt;
r.maxs;vec3;RW;&lt;br /&gt;
r.mins;vec3;RW;&lt;br /&gt;
r.ownerNum;integer;RW;&lt;br /&gt;
r.singleClient;integer;RW;&lt;br /&gt;
r.svFlags;integer;RW;&lt;br /&gt;
r.worldflags;integer;RO;&lt;br /&gt;
radius;integer;RW;&lt;br /&gt;
random;float;RW;&lt;br /&gt;
rotate;vec3;RW;&lt;br /&gt;
s.angles;vec3;RW;&lt;br /&gt;
s.angles2;vec3;RW;&lt;br /&gt;
s.apos;trajectory;RW;&lt;br /&gt;
s.clientNum;integer;RW;&lt;br /&gt;
s.constantLight;integer;RW;&lt;br /&gt;
s.density;integer;RW;&lt;br /&gt;
s.dl_intensity;integer;RW;&lt;br /&gt;
s.dmgFlags;integer;RW;&lt;br /&gt;
s.eFlags;integer;RW;&lt;br /&gt;
s.eType;integer;?;&lt;br /&gt;
s.effect1Time;integer;RW;&lt;br /&gt;
s.effect2Time;integer;RW;&lt;br /&gt;
s.effect3Time;integer;RW;&lt;br /&gt;
s.frame;integer;RW;&lt;br /&gt;
s.groundEntityNum;integer;RO;&lt;br /&gt;
s.loopSound;integer;RW;&lt;br /&gt;
s.modelindex;integer;RW;&lt;br /&gt;
s.modelindex2;integer;RW;&lt;br /&gt;
s.number;integer;RO;&lt;br /&gt;
s.onFireEnd;integer;RW;&lt;br /&gt;
s.onFireStart;integer;RW;&lt;br /&gt;
s.origin;vec3;?;&lt;br /&gt;
s.origin2;vec3;?;&lt;br /&gt;
s.pos;trajectory;RW;&lt;br /&gt;
s.powerups;integer;RO;&lt;br /&gt;
s.solid;integer;RW;&lt;br /&gt;
s.teamNum;integer;RW;&lt;br /&gt;
s.time;integer;RW;&lt;br /&gt;
s.time2;integer;RW;&lt;br /&gt;
s.weapon;integer;RO;&lt;br /&gt;
scriptName;string;RO;&lt;br /&gt;
sess.sessionTeam;team_t;RW;&lt;br /&gt;
sess.spectatorTime;integer;RW;&lt;br /&gt;
sess.spectatorState;spectatorState_t;RW;&lt;br /&gt;
sess.spectatorClient;integer;RW;&lt;br /&gt;
sess.latchSpectatorClient;integer;RW;&lt;br /&gt;
sess.playerType;integer;RW;&lt;br /&gt;
sess.playerWeapon;integer;RW;&lt;br /&gt;
sess.playerWeapon2;integer;RW;&lt;br /&gt;
sess.spawnObjectiveIndex;integer;RW;&lt;br /&gt;
sess.latchPlayerType;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon2;integer;RW;&lt;br /&gt;
sess.damage_given;integer;RW;&lt;br /&gt;
sess.damage_received;integer;RW;&lt;br /&gt;
sess.deaths;integer;RW;&lt;br /&gt;
sess.game_points;integer;RW;&lt;br /&gt;
sess.gibs;integer;RW;&lt;br /&gt;
sess.kills;integer;RW;&lt;br /&gt;
sess.medals;integer array;RW;&lt;br /&gt;
sess.muted;qboolean;RW;&lt;br /&gt;
sess.rank;integer;RW;&lt;br /&gt;
sess.referee;integer;RW;&lt;br /&gt;
sess.rounds;integer;RW;&lt;br /&gt;
sess.semiadmin;integer;RW;&lt;br /&gt;
sess.skill;integer array;RW;&lt;br /&gt;
sess.spec_invite;integer;RW;&lt;br /&gt;
sess.spec_team;integer;RW;&lt;br /&gt;
sess.suicides;integer;RW;&lt;br /&gt;
sess.team_damage;integer;RW;&lt;br /&gt;
sess.team_kills;integer;RW;&lt;br /&gt;
sess.team_received;integer;RW;&lt;br /&gt;
sess.aWeaponStats;weapon_stat_t;RW;&lt;br /&gt;
spawnflags;integer;RO;&lt;br /&gt;
spawnitem;string;RO;&lt;br /&gt;
speed;float;RW;&lt;br /&gt;
splashDamage;integer;RW;&lt;br /&gt;
splashMethodOfDeath;integer;RW;&lt;br /&gt;
splashRadius;integer;RW;&lt;br /&gt;
start_size;integer;RW;&lt;br /&gt;
tagName;string;RO;&lt;br /&gt;
tagParent;entity;RW;&lt;br /&gt;
takedamage;boolean;RW;&lt;br /&gt;
tankLink;entity;RW;&lt;br /&gt;
target;string;RW;&lt;br /&gt;
TargetAngles;vec3;RW;&lt;br /&gt;
TargetFlag;integer;RO;&lt;br /&gt;
targetname;string;RO;&lt;br /&gt;
teamchain;entity;RW;&lt;br /&gt;
teammaster;entity;RW;&lt;br /&gt;
track;string;RO;&lt;br /&gt;
varc;float;RW;&lt;br /&gt;
wait;float;RW;&lt;br /&gt;
waterlevel;integer;RO;&lt;br /&gt;
watertype;integer;RO;&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
:&#039;&#039;note&#039;&#039;: all the sess.* fields will return nil unless the entity is associated with client slot &amp;lt; sv_maxclients.&lt;br /&gt;
:&#039;&#039;note&#039;&#039;: all array variables need tobe called or get whit an additional parameter&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==ET variable types==&lt;br /&gt;
&lt;br /&gt;
===qboolean===&lt;br /&gt;
:a &#039;&#039;&#039;qboolean&#039;&#039;&#039; is a bool made of a number, it has 2 valeus 1 or 0&lt;br /&gt;
:0 is considered as false&lt;br /&gt;
:1 is considered as true&lt;br /&gt;
&lt;br /&gt;
===vec3===&lt;br /&gt;
:a &#039;&#039;&#039;vec3_t&#039;&#039;&#039; is a 3-element array of numbers (C definition: typedef float vec3_t[3];). It is usually used to store and process coordinates in 3D space.&amp;lt;br&amp;gt;&lt;br /&gt;
:In etpro-lua a vector is an array (table indexed by integers) containing 3 numbers. It can be accessed by&lt;br /&gt;
:doing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
origin = et.gentity_get(entNum,&amp;quot;r.currentOrigin&amp;quot;) --a vec3 value&lt;br /&gt;
x,y,z = origin[1],origin[2],origin[3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===trajectory===&lt;br /&gt;
:a &#039;&#039;&#039;trajectory&#039;&#039;&#039; is returned as a lua table described below&lt;br /&gt;
&amp;lt;pre&amp;gt;{&lt;br /&gt;
  trDuration = &amp;lt;number&amp;gt;, --- int&lt;br /&gt;
  trTime = &amp;lt;number&amp;gt;, -- int&lt;br /&gt;
  trType = &amp;lt;number&amp;gt;, -- see below for allowed values&lt;br /&gt;
  trBase = &amp;lt;vec3_t&amp;gt;, -- vec3, as described above&lt;br /&gt;
  trDelta = &amp;lt;vec3_t&amp;gt; -- also a vec3&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
: the allowed values for trType (along with the enum names and original comments from the ET source), are as follows. Note &lt;br /&gt;
: that not all values make sense for all entity types &lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;number;type;discription&amp;quot; widths=&amp;quot;40;160;450&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
1;TR_STATIONARY;&lt;br /&gt;
2;TR_INTERPOLATE;non-parametric, but interpolate between snapshots;&lt;br /&gt;
3;TR_LINEAR;&lt;br /&gt;
4;TR_LINEAR_STOP;&lt;br /&gt;
5;TR_LINEAR_STOP_BACK;reverse movement can be different than forward;&lt;br /&gt;
6;TR_SINE;value = base + sin( time / duration ) * delta;&lt;br /&gt;
7;TR_GRAVITY;&lt;br /&gt;
8;TR_GRAVITY_LOW;&lt;br /&gt;
9;TR_GRAVITY_FLOAT;super low grav with no gravity acceleration;&lt;br /&gt;
10;TR_GRAVITY_PAUSED;has stopped, but trace to see if it should be switched back to TR_GRAVITY;&lt;br /&gt;
11;TR_ACCELERATE;&lt;br /&gt;
12;TR_DECCELERATE;&lt;br /&gt;
13;TR_SPLINE;&lt;br /&gt;
14;TR_LINEAR_PATH;&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===entity===&lt;br /&gt;
:The fields listed as having type &#039;&#039;&#039;enitity&#039;&#039;&#039; return an entity number or nil. Entity numbers are integers from 0 through 1023. Some of the entity numbers have special meanings:&lt;br /&gt;
:0 - (sv_privateclients - 1) are reserved for clients who connect with the private slot password&lt;br /&gt;
:0 - 63 are reserved for clients. A client&#039;s entity number is also its client number (as shown by /players for example)&lt;br /&gt;
:1022 is the &#039;&#039;&#039;worldspawn&#039;&#039;&#039; entity&lt;br /&gt;
:1023 is &#039;&#039;&#039;ENTITYNUM_NONE&#039;&#039;&#039; which is used instead of null in C under some circumstances to indicate no entity. This is needed where an entity number will be passed over the network.&lt;br /&gt;
:&#039;&#039;Note&#039;&#039;: Some other fields not listed as type &#039;entity&#039; may take an entity number value. &#039;&#039;&#039;mg42BaseEnt&#039;&#039;&#039; and &#039;&#039;&#039;s.number&#039;&#039;&#039; are examples.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===meansOfDeath===&lt;br /&gt;
:a &#039;&#039;&#039;meansOfDeath_t&#039;&#039;&#039; is a number indicating the [[etdamage|Method of Death]] Click  [[etdamage|here]] for a list whit posable value&#039;s&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2105</id>
		<title>Fieldname</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2105"/>
		<updated>2006-03-08T17:37:46Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: small fixors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Entity Fieldnames==&lt;br /&gt;
List of fields supported by [[ETPro:Lua Mod API#entities|et.gentity_get() and et.gentity_set()]] functions&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;field;type;access&amp;quot; widths=&amp;quot;180;120;60&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
activator;entity;RO;&lt;br /&gt;
chain;entity;RW;&lt;br /&gt;
classname;string;RW;&lt;br /&gt;
client.inactivityTime;integer;RW;&lt;br /&gt;
client.inactivityWarning;qboolean;RW;&lt;br /&gt;
clipmask;integer;?;&lt;br /&gt;
closespeed;float;RW;&lt;br /&gt;
count;integer;RW;&lt;br /&gt;
count2;integer;RW;&lt;br /&gt;
damage;integer;RW;&lt;br /&gt;
deathType;meansOfDeath_t;RW;&lt;br /&gt;
delay;float;RW;&lt;br /&gt;
dl_atten;integer;RW;&lt;br /&gt;
dl_color;vec3;RW;&lt;br /&gt;
dl_shader;string;RO;&lt;br /&gt;
dl_stylestring;string;RO;&lt;br /&gt;
duration;float;RW;&lt;br /&gt;
end_size;integer;RW;&lt;br /&gt;
enemy;entity;RW;&lt;br /&gt;
flags;bitflag;RO;&lt;br /&gt;
harc;float;RW;&lt;br /&gt;
health;integer;RW;&lt;br /&gt;
inuse;qboolean;RO;&lt;br /&gt;
isProp;qboolean;RO;&lt;br /&gt;
item;string;RW;&lt;br /&gt;
key;integer;RW;&lt;br /&gt;
message;string;RW;&lt;br /&gt;
methodOfDeath;integer;RW;&lt;br /&gt;
mg42BaseEnt;integer;RW;&lt;br /&gt;
missionLevel;integer;RW;&lt;br /&gt;
model;string;RO;&lt;br /&gt;
model2;string;RO;&lt;br /&gt;
nextTrain;entity;RW;&lt;br /&gt;
noise_index;integer;RW;&lt;br /&gt;
origin;vec3;RW;&lt;br /&gt;
pers.connected;connected_t;?;&lt;br /&gt;
pers.netname;string;?;&lt;br /&gt;
pers.localClient;qboolean;?;&lt;br /&gt;
pers.initialSpawn;qboolean;?; &lt;br /&gt;
pers.enterTime;integer;?;&lt;br /&gt;
pers.connectTime;integer;?; &lt;br /&gt;
pers.teamState.state;teamstatestate_t;?;&lt;br /&gt;
pers.voteCount;integer;?;&lt;br /&gt;
pers.teamVoteCount;integer;?; &lt;br /&gt;
pers.complaints;integer;?; &lt;br /&gt;
pers.complaintClient;integer;?; &lt;br /&gt;
pers.complaintEndTime;integer;?; &lt;br /&gt;
pers.lastReinforceTime;integer;?; &lt;br /&gt;
pers.applicationClient;integer;?; &lt;br /&gt;
pers.applicationEndTime;integer;?; &lt;br /&gt;
pers.invitationClient;integer;?; &lt;br /&gt;
pers.invitationEndTime;integer;?; &lt;br /&gt;
pers.propositionClient;integer;?; &lt;br /&gt;
pers.propositionClient2;integer;?; &lt;br /&gt;
pers.propositionEndTime;integer;?; &lt;br /&gt;
pers.autofireteamEndTime;integer;?; &lt;br /&gt;
pers.autofireteamCreateEndTime;integer;?; &lt;br /&gt;
pers.autofireteamJoinEndTime;integer;?; &lt;br /&gt;
pers.lastSpawnTime;integer;?;&lt;br /&gt;
pers.ready;qboolean;?;&lt;br /&gt;
prevTrain;entity;RW;&lt;br /&gt;
props_frame_state;integer;RO;&lt;br /&gt;
ps.stats;integer array;RW; &lt;br /&gt;
ps.persistant;integer array;RW;&lt;br /&gt;
ps.ping;integer;?;&lt;br /&gt;
ps.powerups;integer array;RW;&lt;br /&gt;
ps.ammo;integer array;RW; &lt;br /&gt;
ps.ammoclip;integer array;RW;&lt;br /&gt;
r.absmax;vec3;RO;&lt;br /&gt;
r.absmin;vec3;RO;&lt;br /&gt;
r.bmodel;qboolean;RO;&lt;br /&gt;
r.contents;integer;RW;&lt;br /&gt;
r.currentAngles;vec3;RW;&lt;br /&gt;
r.currentOrigin;vec3;RW;&lt;br /&gt;
r.eventTime;integer;RW;&lt;br /&gt;
r.linkcount;integer;RO;&lt;br /&gt;
r.linked;qboolean;RO;&lt;br /&gt;
r.maxs;vec3;RW;&lt;br /&gt;
r.mins;vec3;RW;&lt;br /&gt;
r.ownerNum;integer;RW;&lt;br /&gt;
r.singleClient;integer;RW;&lt;br /&gt;
r.svFlags;integer;RW;&lt;br /&gt;
r.worldflags;integer;RO;&lt;br /&gt;
radius;integer;RW;&lt;br /&gt;
random;float;RW;&lt;br /&gt;
rotate;vec3;RW;&lt;br /&gt;
s.angles;vec3;RW;&lt;br /&gt;
s.angles2;vec3;RW;&lt;br /&gt;
s.apos;trajectory;RW;&lt;br /&gt;
s.clientNum;integer;RW;&lt;br /&gt;
s.constantLight;integer;RW;&lt;br /&gt;
s.density;integer;RW;&lt;br /&gt;
s.dl_intensity;integer;RW;&lt;br /&gt;
s.dmgFlags;integer;RW;&lt;br /&gt;
s.eFlags;integer;RW;&lt;br /&gt;
s.eType;integer;?;&lt;br /&gt;
s.effect1Time;integer;RW;&lt;br /&gt;
s.effect2Time;integer;RW;&lt;br /&gt;
s.effect3Time;integer;RW;&lt;br /&gt;
s.frame;integer;RW;&lt;br /&gt;
s.groundEntityNum;integer;RO;&lt;br /&gt;
s.loopSound;integer;RW;&lt;br /&gt;
s.modelindex;integer;RW;&lt;br /&gt;
s.modelindex2;integer;RW;&lt;br /&gt;
s.number;integer;RO;&lt;br /&gt;
s.onFireEnd;integer;RW;&lt;br /&gt;
s.onFireStart;integer;RW;&lt;br /&gt;
s.origin;vec3;?;&lt;br /&gt;
s.origin2;vec3;?;&lt;br /&gt;
s.pos;trajectory;RW;&lt;br /&gt;
s.powerups;integer;RO;&lt;br /&gt;
s.solid;integer;RW;&lt;br /&gt;
s.teamNum;integer;RW;&lt;br /&gt;
s.time;integer;RW;&lt;br /&gt;
s.time2;integer;RW;&lt;br /&gt;
s.weapon;integer;RO;&lt;br /&gt;
scriptName;string;RO;&lt;br /&gt;
sess.sessionTeam;team_t;RW;&lt;br /&gt;
sess.spectatorTime;integer;RW;&lt;br /&gt;
sess.spectatorState;spectatorState_t;RW;&lt;br /&gt;
sess.spectatorClient;integer;RW;&lt;br /&gt;
sess.latchSpectatorClient;integer;RW;&lt;br /&gt;
sess.playerType;integer;RW;&lt;br /&gt;
sess.playerWeapon;integer;RW;&lt;br /&gt;
sess.playerWeapon2;integer;RW;&lt;br /&gt;
sess.spawnObjectiveIndex;integer;RW;&lt;br /&gt;
sess.latchPlayerType;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon2;integer;RW;&lt;br /&gt;
sess.damage_given;integer;RW;&lt;br /&gt;
sess.damage_received;integer;RW;&lt;br /&gt;
sess.deaths;integer;RW;&lt;br /&gt;
sess.game_points;integer;RW;&lt;br /&gt;
sess.gibs;integer;RW;&lt;br /&gt;
sess.kills;integer;RW;&lt;br /&gt;
sess.medals;integer array;RW;&lt;br /&gt;
sess.muted;qboolean;RW;&lt;br /&gt;
sess.rank;integer;RW;&lt;br /&gt;
sess.referee;integer;RW;&lt;br /&gt;
sess.rounds;integer;RW;&lt;br /&gt;
sess.semiadmin;integer;RW;&lt;br /&gt;
sess.skill;integer array;RW;&lt;br /&gt;
sess.spec_invite;integer;RW;&lt;br /&gt;
sess.spec_team;integer;RW;&lt;br /&gt;
sess.suicides;integer;RW;&lt;br /&gt;
sess.team_damage;integer;RW;&lt;br /&gt;
sess.team_kills;integer;RW;&lt;br /&gt;
sess.team_received;integer;RW;&lt;br /&gt;
sess.aWeaponStats;weapon_stat_t;RW;&lt;br /&gt;
spawnflags;integer;RO;&lt;br /&gt;
spawnitem;string;RO;&lt;br /&gt;
speed;float;RW;&lt;br /&gt;
splashDamage;integer;RW;&lt;br /&gt;
splashMethodOfDeath;integer;RW;&lt;br /&gt;
splashRadius;integer;RW;&lt;br /&gt;
start_size;integer;RW;&lt;br /&gt;
tagName;string;RO;&lt;br /&gt;
tagParent;entity;RW;&lt;br /&gt;
takedamage;boolean;RW;&lt;br /&gt;
tankLink;entity;RW;&lt;br /&gt;
target;string;RW;&lt;br /&gt;
TargetAngles;vec3;RW;&lt;br /&gt;
TargetFlag;integer;RO;&lt;br /&gt;
targetname;string;RO;&lt;br /&gt;
teamchain;entity;RW;&lt;br /&gt;
teammaster;entity;RW;&lt;br /&gt;
track;string;RO;&lt;br /&gt;
varc;float;RW;&lt;br /&gt;
wait;float;RW;&lt;br /&gt;
waterlevel;integer;RO;&lt;br /&gt;
watertype;integer;RO;&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
:&#039;&#039;note&#039;&#039;: all the sess.* fields will return nil unless the entity is associated with client slot &amp;lt; sv_maxclients.&lt;br /&gt;
:&#039;&#039;note&#039;&#039;: all array variables need tobe called or get whit an additional parameter&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==ET variable types==&lt;br /&gt;
&lt;br /&gt;
===vec3===&lt;br /&gt;
:a &#039;&#039;&#039;vec3&#039;&#039;&#039; is a 3-element array of numbers (C definition: typedef float vec3_t[3];). It is usually used to store and process coordinates in 3D space.&amp;lt;br&amp;gt;&lt;br /&gt;
:In etpro-lua a vector is an array (table indexed by integers) containing 3 numbers. It can be accessed by&lt;br /&gt;
:doing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
origin = et.gentity_get(entNum,&amp;quot;r.currentOrigin&amp;quot;) --a vec3 value&lt;br /&gt;
x,y,z = origin[1],origin[2],origin[3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===trajectory===&lt;br /&gt;
:a &#039;&#039;&#039;trajectory&#039;&#039;&#039; is returned as a lua table described below&lt;br /&gt;
&amp;lt;pre&amp;gt;{&lt;br /&gt;
  trDuration = &amp;lt;number&amp;gt;, --- int&lt;br /&gt;
  trTime = &amp;lt;number&amp;gt;, -- int&lt;br /&gt;
  trType = &amp;lt;number&amp;gt;, -- see below for allowed values&lt;br /&gt;
  trBase = &amp;lt;vec3_t&amp;gt;, -- vec3, as described above&lt;br /&gt;
  trDelta = &amp;lt;vec3_t&amp;gt; -- also a vec3&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
: the allowed values for trType (along with the enum names and original comments from the ET source), are as follows. Note &lt;br /&gt;
: that not all values make sense for all entity types &lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;number;type;discription&amp;quot; widths=&amp;quot;40;160;450&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
1;TR_STATIONARY;&lt;br /&gt;
2;TR_INTERPOLATE;non-parametric, but interpolate between snapshots;&lt;br /&gt;
3;TR_LINEAR;&lt;br /&gt;
4;TR_LINEAR_STOP;&lt;br /&gt;
5;TR_LINEAR_STOP_BACK;reverse movement can be different than forward;&lt;br /&gt;
6;TR_SINE;value = base + sin( time / duration ) * delta;&lt;br /&gt;
7;TR_GRAVITY;&lt;br /&gt;
8;TR_GRAVITY_LOW;&lt;br /&gt;
9;TR_GRAVITY_FLOAT;super low grav with no gravity acceleration;&lt;br /&gt;
10;TR_GRAVITY_PAUSED;has stopped, but trace to see if it should be switched back to TR_GRAVITY;&lt;br /&gt;
11;TR_ACCELERATE;&lt;br /&gt;
12;TR_DECCELERATE;&lt;br /&gt;
13;TR_SPLINE;&lt;br /&gt;
14;TR_LINEAR_PATH;&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===entity===&lt;br /&gt;
:The fields listed as having type &#039;&#039;&#039;enitity&#039;&#039;&#039; return an entity number or nil. Entity numbers are integers from 0 through 1023. Some of the entity numbers have special meanings:&lt;br /&gt;
:0 - (sv_privateclients - 1) are reserved for clients who connect with the private slot password&lt;br /&gt;
:0 - 63 are reserved for clients. A client&#039;s entity number is also its client number (as shown by /players for example)&lt;br /&gt;
:1022 is the &#039;&#039;&#039;worldspawn&#039;&#039;&#039; entity&lt;br /&gt;
:1023 is &#039;&#039;&#039;ENTITYNUM_NONE&#039;&#039;&#039; which is used instead of null in C under some circumstances to indicate no entity. This is needed where an entity number will be passed over the network.&lt;br /&gt;
:&#039;&#039;Note&#039;&#039;: Some other fields not listed as type &#039;entity&#039; may take an entity number value. &#039;&#039;&#039;mg42BaseEnt&#039;&#039;&#039; and &#039;&#039;&#039;s.number&#039;&#039;&#039; are examples.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2104</id>
		<title>Fieldname</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2104"/>
		<updated>2006-03-08T17:34:47Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: restyled to make room for other entity types&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Entity Fieldnames==&lt;br /&gt;
List of fields supported by [[ETPro:Lua Mod API#entities|et.gentity_get() and et.gentity_set()]] functions&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;field;type;access&amp;quot; widths=&amp;quot;180;120;60&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
activator;entity;RO;&lt;br /&gt;
chain;entity;RW;&lt;br /&gt;
classname;string;RW;&lt;br /&gt;
client.inactivityTime;integer;RW;&lt;br /&gt;
client.inactivityWarning;qboolean;RW;&lt;br /&gt;
clipmask;integer;?;&lt;br /&gt;
closespeed;float;RW;&lt;br /&gt;
count;integer;RW;&lt;br /&gt;
count2;integer;RW;&lt;br /&gt;
damage;integer;RW;&lt;br /&gt;
deathType;meansOfDeath_t;RW;&lt;br /&gt;
delay;float;RW;&lt;br /&gt;
dl_atten;integer;RW;&lt;br /&gt;
dl_color;vec3;RW;&lt;br /&gt;
dl_shader;string;RO;&lt;br /&gt;
dl_stylestring;string;RO;&lt;br /&gt;
duration;float;RW;&lt;br /&gt;
end_size;integer;RW;&lt;br /&gt;
enemy;entity;RW;&lt;br /&gt;
flags;bitflag;RO;&lt;br /&gt;
harc;float;RW;&lt;br /&gt;
health;integer;RW;&lt;br /&gt;
inuse;qboolean;RO;&lt;br /&gt;
isProp;qboolean;RO;&lt;br /&gt;
item;string;RW;&lt;br /&gt;
key;integer;RW;&lt;br /&gt;
message;string;RW;&lt;br /&gt;
methodOfDeath;integer;RW;&lt;br /&gt;
mg42BaseEnt;integer;RW;&lt;br /&gt;
missionLevel;integer;RW;&lt;br /&gt;
model;string;RO;&lt;br /&gt;
model2;string;RO;&lt;br /&gt;
nextTrain;entity;RW;&lt;br /&gt;
noise_index;integer;RW;&lt;br /&gt;
origin;vec3;RW;&lt;br /&gt;
pers.connected;connected_t;?;&lt;br /&gt;
pers.netname;string;?;&lt;br /&gt;
pers.localClient;qboolean;?;&lt;br /&gt;
pers.initialSpawn;qboolean;?; &lt;br /&gt;
pers.enterTime;integer;?;&lt;br /&gt;
pers.connectTime;integer;?; &lt;br /&gt;
pers.teamState.state;teamstatestate_t;?;&lt;br /&gt;
pers.voteCount;integer;?;&lt;br /&gt;
pers.teamVoteCount;integer;?; &lt;br /&gt;
pers.complaints;integer;?; &lt;br /&gt;
pers.complaintClient;integer;?; &lt;br /&gt;
pers.complaintEndTime;integer;?; &lt;br /&gt;
pers.lastReinforceTime;integer;?; &lt;br /&gt;
pers.applicationClient;integer;?; &lt;br /&gt;
pers.applicationEndTime;integer;?; &lt;br /&gt;
pers.invitationClient;integer;?; &lt;br /&gt;
pers.invitationEndTime;integer;?; &lt;br /&gt;
pers.propositionClient;integer;?; &lt;br /&gt;
pers.propositionClient2;integer;?; &lt;br /&gt;
pers.propositionEndTime;integer;?; &lt;br /&gt;
pers.autofireteamEndTime;integer;?; &lt;br /&gt;
pers.autofireteamCreateEndTime;integer;?; &lt;br /&gt;
pers.autofireteamJoinEndTime;integer;?; &lt;br /&gt;
pers.lastSpawnTime;integer;?;&lt;br /&gt;
pers.ready;qboolean;?;&lt;br /&gt;
prevTrain;entity;RW;&lt;br /&gt;
props_frame_state;integer;RO;&lt;br /&gt;
ps.stats;integer array;RW; &lt;br /&gt;
ps.persistant;integer array;RW;&lt;br /&gt;
ps.ping;integer;?;&lt;br /&gt;
ps.powerups;integer array;RW;&lt;br /&gt;
ps.ammo;integer array;RW; &lt;br /&gt;
ps.ammoclip;integer array;RW;&lt;br /&gt;
r.absmax;vec3;RO;&lt;br /&gt;
r.absmin;vec3;RO;&lt;br /&gt;
r.bmodel;qboolean;RO;&lt;br /&gt;
r.contents;integer;RW;&lt;br /&gt;
r.currentAngles;vec3;RW;&lt;br /&gt;
r.currentOrigin;vec3;RW;&lt;br /&gt;
r.eventTime;integer;RW;&lt;br /&gt;
r.linkcount;integer;RO;&lt;br /&gt;
r.linked;qboolean;RO;&lt;br /&gt;
r.maxs;vec3;RW;&lt;br /&gt;
r.mins;vec3;RW;&lt;br /&gt;
r.ownerNum;integer;RW;&lt;br /&gt;
r.singleClient;integer;RW;&lt;br /&gt;
r.svFlags;integer;RW;&lt;br /&gt;
r.worldflags;integer;RO;&lt;br /&gt;
radius;integer;RW;&lt;br /&gt;
random;float;RW;&lt;br /&gt;
rotate;vec3;RW;&lt;br /&gt;
s.angles;vec3;RW;&lt;br /&gt;
s.angles2;vec3;RW;&lt;br /&gt;
s.apos;trajectory;RW;&lt;br /&gt;
s.clientNum;integer;RW;&lt;br /&gt;
s.constantLight;integer;RW;&lt;br /&gt;
s.density;integer;RW;&lt;br /&gt;
s.dl_intensity;integer;RW;&lt;br /&gt;
s.dmgFlags;integer;RW;&lt;br /&gt;
s.eFlags;integer;RW;&lt;br /&gt;
s.eType;integer;?;&lt;br /&gt;
s.effect1Time;integer;RW;&lt;br /&gt;
s.effect2Time;integer;RW;&lt;br /&gt;
s.effect3Time;integer;RW;&lt;br /&gt;
s.frame;integer;RW;&lt;br /&gt;
s.groundEntityNum;integer;RO;&lt;br /&gt;
s.loopSound;integer;RW;&lt;br /&gt;
s.modelindex;integer;RW;&lt;br /&gt;
s.modelindex2;integer;RW;&lt;br /&gt;
s.number;integer;RO;&lt;br /&gt;
s.onFireEnd;integer;RW;&lt;br /&gt;
s.onFireStart;integer;RW;&lt;br /&gt;
s.origin;vec3;?;&lt;br /&gt;
s.origin2;vec3;?;&lt;br /&gt;
s.pos;trajectory;RW;&lt;br /&gt;
s.powerups;integer;RO;&lt;br /&gt;
s.solid;integer;RW;&lt;br /&gt;
s.teamNum;integer;RW;&lt;br /&gt;
s.time;integer;RW;&lt;br /&gt;
s.time2;integer;RW;&lt;br /&gt;
s.weapon;integer;RO;&lt;br /&gt;
scriptName;string;RO;&lt;br /&gt;
sess.sessionTeam;team_t;RW;&lt;br /&gt;
sess.spectatorTime;integer;RW;&lt;br /&gt;
sess.spectatorState;spectatorState_t;RW;&lt;br /&gt;
sess.spectatorClient;integer;RW;&lt;br /&gt;
sess.latchSpectatorClient;integer;RW;&lt;br /&gt;
sess.playerType;integer;RW;&lt;br /&gt;
sess.playerWeapon;integer;RW;&lt;br /&gt;
sess.playerWeapon2;integer;RW;&lt;br /&gt;
sess.spawnObjectiveIndex;integer;RW;&lt;br /&gt;
sess.latchPlayerType;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon2;integer;RW;&lt;br /&gt;
sess.damage_given;integer;RW;&lt;br /&gt;
sess.damage_received;integer;RW;&lt;br /&gt;
sess.deaths;integer;RW;&lt;br /&gt;
sess.game_points;integer;RW;&lt;br /&gt;
sess.gibs;integer;RW;&lt;br /&gt;
sess.kills;integer;RW;&lt;br /&gt;
sess.medals;integer array;RW;&lt;br /&gt;
sess.muted;qboolean;RW;&lt;br /&gt;
sess.rank;integer;RW;&lt;br /&gt;
sess.referee;integer;RW;&lt;br /&gt;
sess.rounds;integer;RW;&lt;br /&gt;
sess.semiadmin;integer;RW;&lt;br /&gt;
sess.skill;integer array;RW;&lt;br /&gt;
sess.spec_invite;integer;RW;&lt;br /&gt;
sess.spec_team;integer;RW;&lt;br /&gt;
sess.suicides;integer;RW;&lt;br /&gt;
sess.team_damage;integer;RW;&lt;br /&gt;
sess.team_kills;integer;RW;&lt;br /&gt;
sess.team_received;integer;RW;&lt;br /&gt;
sess.aWeaponStats;weapon_stat_t;RW;&lt;br /&gt;
spawnflags;integer;RO;&lt;br /&gt;
spawnitem;string;RO;&lt;br /&gt;
speed;float;RW;&lt;br /&gt;
splashDamage;integer;RW;&lt;br /&gt;
splashMethodOfDeath;integer;RW;&lt;br /&gt;
splashRadius;integer;RW;&lt;br /&gt;
start_size;integer;RW;&lt;br /&gt;
tagName;string;RO;&lt;br /&gt;
tagParent;entity;RW;&lt;br /&gt;
takedamage;boolean;RW;&lt;br /&gt;
tankLink;entity;RW;&lt;br /&gt;
target;string;RW;&lt;br /&gt;
TargetAngles;vec3;RW;&lt;br /&gt;
TargetFlag;integer;RO;&lt;br /&gt;
targetname;string;RO;&lt;br /&gt;
teamchain;entity;RW;&lt;br /&gt;
teammaster;entity;RW;&lt;br /&gt;
track;string;RO;&lt;br /&gt;
varc;float;RW;&lt;br /&gt;
wait;float;RW;&lt;br /&gt;
waterlevel;integer;RO;&lt;br /&gt;
watertype;integer;RO;&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
:&#039;&#039;note&#039;&#039;: all the sess.* fields will return nil unless the entity is associated with client slot &amp;lt; sv_maxclients.&lt;br /&gt;
:&#039;&#039;note&#039;&#039;: all array variables need tobe called or get whit an additional parameter&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==ET variable types==&lt;br /&gt;
&lt;br /&gt;
===vec3===&lt;br /&gt;
:a &#039;&#039;&#039;vec3&#039;&#039;&#039; is a 3-element array of numbers (C definition: &amp;lt;tt&amp;gt;typedef float vec3_t[3];&lt;br /&gt;
&amp;lt;/tt&amp;gt;). It is usually used to store and process coordinates in 3D space.&amp;lt;br&amp;gt;&lt;br /&gt;
In etpro-lua a vector is an array (table indexed by integers) containing 3 numbers. It can be accessed by&lt;br /&gt;
doing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
origin = et.gentity_get(entNum,&amp;quot;r.currentOrigin&amp;quot;) --a vec3 value&lt;br /&gt;
x,y,z = origin[1],origin[2],origin[3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===trajectory===&lt;br /&gt;
:a &#039;&#039;&#039;trajectory&#039;&#039;&#039; is returned as a lua table described below&lt;br /&gt;
&amp;lt;pre&amp;gt;{&lt;br /&gt;
  trDuration = &amp;lt;number&amp;gt;, --- int&lt;br /&gt;
  trTime = &amp;lt;number&amp;gt;, -- int&lt;br /&gt;
  trType = &amp;lt;number&amp;gt;, -- see below for allowed values&lt;br /&gt;
  trBase = &amp;lt;vec3_t&amp;gt;, -- vec3, as described above&lt;br /&gt;
  trDelta = &amp;lt;vec3_t&amp;gt; -- also a vec3&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
: the allowed values for trType (along with the enum names and original comments from the ET source), are as follows. Note &lt;br /&gt;
: that not all values make sense for all entity types &lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;number;type;discription&amp;quot; widths=&amp;quot;40;160;450&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
1;TR_STATIONARY;&lt;br /&gt;
2;TR_INTERPOLATE;non-parametric, but interpolate between snapshots;&lt;br /&gt;
3;TR_LINEAR;&lt;br /&gt;
4;TR_LINEAR_STOP;&lt;br /&gt;
5;TR_LINEAR_STOP_BACK;reverse movement can be different than forward;&lt;br /&gt;
6;TR_SINE;value = base + sin( time / duration ) * delta;&lt;br /&gt;
7;TR_GRAVITY;&lt;br /&gt;
8;TR_GRAVITY_LOW;&lt;br /&gt;
9;TR_GRAVITY_FLOAT;super low grav with no gravity acceleration;&lt;br /&gt;
10;TR_GRAVITY_PAUSED;has stopped, but trace to see if it should be switched back to TR_GRAVITY;&lt;br /&gt;
11;TR_ACCELERATE;&lt;br /&gt;
12;TR_DECCELERATE;&lt;br /&gt;
13;TR_SPLINE;&lt;br /&gt;
14;TR_LINEAR_PATH;&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===entity===&lt;br /&gt;
:The fields listed as having type &#039;&#039;&#039;enitity&#039;&#039;&#039; return an entity number or nil. Entity numbers are integers from 0 through 1023. Some of the entity numbers have special meanings:&lt;br /&gt;
:0 - (sv_privateclients - 1) are reserved for clients who connect with the private slot password&lt;br /&gt;
:0 - 63 are reserved for clients. A client&#039;s entity number is also its client number (as shown by /players for example)&lt;br /&gt;
:1022 is the &#039;&#039;&#039;worldspawn&#039;&#039;&#039; entity&lt;br /&gt;
:1023 is &#039;&#039;&#039;ENTITYNUM_NONE&#039;&#039;&#039; which is used instead of null in C under some circumstances to indicate no entity. This is needed where an entity number will be passed over the network.&lt;br /&gt;
:&#039;&#039;Note&#039;&#039;: Some other fields not listed as type &#039;entity&#039; may take an entity number value. &#039;&#039;&#039;mg42BaseEnt&#039;&#039;&#039; and &#039;&#039;&#039;s.number&#039;&#039;&#039; are examples.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Etdamage&amp;diff=2101</id>
		<title>Etdamage</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Etdamage&amp;diff=2101"/>
		<updated>2006-03-08T17:04:02Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: style fixor&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
*&#039;&#039;&#039;Damage Flags List&#039;&#039;&#039;&lt;br /&gt;
:damage flags are [[Bitmask-cvar|bitflags]]&lt;br /&gt;
:the following bits are available:&lt;br /&gt;
&amp;lt;pre&amp;gt;DAMAGE_RADIUS			1 // damage was indirect&lt;br /&gt;
DAMAGE_HALF_KNOCKBACK		2 // Gordon: do less knockback&lt;br /&gt;
DAMAGE_NO_KNOCKBACK		4 // do not affect velocity, just view angles&lt;br /&gt;
DAMAGE_NO_PROTECTION		8 // armor, shields, invulnerability, and godmode have no effect&lt;br /&gt;
DAMAGE_NO_TEAM_PROTECTION	16 // armor, shields, invulnerability, and godmode have no effect&lt;br /&gt;
DAMAGE_DISTANCEFALLOFF		32 // distance falloff&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Method of Death List&#039;&#039;&#039;&lt;br /&gt;
:Method&#039;s of Death are numbers indicatig of how the damage was inflickted&lt;br /&gt;
:The following Method&#039;s of Death are avialable:&lt;br /&gt;
&amp;lt;pitatable columns=2 headlines=&amp;quot;number;type&amp;quot; widths=&amp;quot;40;330&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
0;MOD_UNKNOWN;&lt;br /&gt;
1;MOD_MACHINEGUN;&lt;br /&gt;
2;MOD_BROWNING;&lt;br /&gt;
3;MOD_MG42;&lt;br /&gt;
4;MOD_GRENADE;&lt;br /&gt;
5;MOD_ROCKET;&lt;br /&gt;
6;MOD_KNIFE;&lt;br /&gt;
7;MOD_LUGER;&lt;br /&gt;
8;MOD_COLT;&lt;br /&gt;
9;MOD_MP40;&lt;br /&gt;
10;MOD_THOMPSON;&lt;br /&gt;
11;MOD_STEN;&lt;br /&gt;
12;MOD_GARAND;&lt;br /&gt;
13;MOD_SNOOPERSCOPE;&lt;br /&gt;
14;MOD_SILENCER;&lt;br /&gt;
15;MOD_FG42;&lt;br /&gt;
16;MOD_FG42SCOPE;&lt;br /&gt;
17;MOD_PANZERFAUST;&lt;br /&gt;
18;MOD_GRENADE_LAUNCHER;&lt;br /&gt;
19;MOD_FLAMETHROWER;&lt;br /&gt;
20;MOD_GRENADE_PINEAPPLE;&lt;br /&gt;
21;MOD_CROSS;&lt;br /&gt;
22;MOD_MAPMORTAR;&lt;br /&gt;
23;MOD_MAPMORTAR_SPLASH;&lt;br /&gt;
24;MOD_KICKED;&lt;br /&gt;
25;MOD_GRABBER;&lt;br /&gt;
26;MOD_DYNAMITE;&lt;br /&gt;
27;MOD_AIRSTRIKE;&lt;br /&gt;
28;MOD_SYRINGE;&lt;br /&gt;
29;MOD_AMMO;&lt;br /&gt;
30;MOD_ARTY;&lt;br /&gt;
31;MOD_WATER;&lt;br /&gt;
32;MOD_SLIME;&lt;br /&gt;
33;MOD_LAVA;&lt;br /&gt;
34;MOD_CRUSH;&lt;br /&gt;
35;MOD_TELEFRAG;&lt;br /&gt;
36;MOD_FALLING;&lt;br /&gt;
37;MOD_SUICIDE;&lt;br /&gt;
38;MOD_TARGET_LASER;&lt;br /&gt;
39;MOD_TRIGGER_HURT;&lt;br /&gt;
40;MOD_EXPLOSIVE;&lt;br /&gt;
41;MOD_CARBINE;&lt;br /&gt;
42;MOD_KAR98;&lt;br /&gt;
43;MOD_GPG40;&lt;br /&gt;
44;MOD_M7;&lt;br /&gt;
45;MOD_LANDMINE;&lt;br /&gt;
46;MOD_SATCHEL;&lt;br /&gt;
47;MOD_TRIPMINE;&lt;br /&gt;
48;MOD_SMOKEBOMB;&lt;br /&gt;
49;MOD_MOBILE_MG42;&lt;br /&gt;
50;MOD_SILENCED_COLT;&lt;br /&gt;
51;MOD_GARAND_SCOPE;&lt;br /&gt;
52;MOD_CRUSH_CONSTRUCTION;&lt;br /&gt;
53;MOD_CRUSH_CONSTRUCTIONDEATH;&lt;br /&gt;
54;MOD_CRUSH_CONSTRUCTIONDEATH_NOATTACKER;&lt;br /&gt;
55;MOD_K43;&lt;br /&gt;
56;MOD_K43_SCOPE;&lt;br /&gt;
57;MOD_MORTAR;&lt;br /&gt;
58;MOD_AKIMBO_COLT;&lt;br /&gt;
59;MOD_AKIMBO_LUGER;&lt;br /&gt;
60;MOD_AKIMBO_SILENCEDCOLT;&lt;br /&gt;
61;MOD_AKIMBO_SILENCEDLUGER;&lt;br /&gt;
62;MOD_SMOKEGRENADE;&lt;br /&gt;
63;MOD_SWAP_PLACES;&lt;br /&gt;
64;MOD_SWITCHTEAM;&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Etdamage&amp;diff=2100</id>
		<title>Etdamage</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Etdamage&amp;diff=2100"/>
		<updated>2006-03-08T17:03:18Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: fixed table with&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
*&#039;&#039;&#039;Damage Flags List&#039;&#039;&#039;&lt;br /&gt;
:damage flags are [[Bitmask-cvar|bitflags]]&lt;br /&gt;
:the following bits are available:&lt;br /&gt;
&amp;lt;pre&amp;gt;DAMAGE_RADIUS			1 // damage was indirect&lt;br /&gt;
DAMAGE_HALF_KNOCKBACK		2 // Gordon: do less knockback&lt;br /&gt;
DAMAGE_NO_KNOCKBACK		4 // do not affect velocity, just view angles&lt;br /&gt;
DAMAGE_NO_PROTECTION		8 // armor, shields, invulnerability, and godmode have no effect&lt;br /&gt;
DAMAGE_NO_TEAM_PROTECTION	16 // armor, shields, invulnerability, and godmode have no effect&lt;br /&gt;
DAMAGE_DISTANCEFALLOFF		32 // distance falloff&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Method of Death List&#039;&#039;&#039;&lt;br /&gt;
:Method&#039;s of Death are numbers indicatig of how the damage was inflickted&lt;br /&gt;
The following Method&#039;s of Death are avialable:&lt;br /&gt;
&amp;lt;pitatable columns=2 headlines=&amp;quot;number;type&amp;quot; widths=&amp;quot;40;330&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
0;MOD_UNKNOWN;&lt;br /&gt;
1;MOD_MACHINEGUN;&lt;br /&gt;
2;MOD_BROWNING;&lt;br /&gt;
3;MOD_MG42;&lt;br /&gt;
4;MOD_GRENADE;&lt;br /&gt;
5;MOD_ROCKET;&lt;br /&gt;
6;MOD_KNIFE;&lt;br /&gt;
7;MOD_LUGER;&lt;br /&gt;
8;MOD_COLT;&lt;br /&gt;
9;MOD_MP40;&lt;br /&gt;
10;MOD_THOMPSON;&lt;br /&gt;
11;MOD_STEN;&lt;br /&gt;
12;MOD_GARAND;&lt;br /&gt;
13;MOD_SNOOPERSCOPE;&lt;br /&gt;
14;MOD_SILENCER;&lt;br /&gt;
15;MOD_FG42;&lt;br /&gt;
16;MOD_FG42SCOPE;&lt;br /&gt;
17;MOD_PANZERFAUST;&lt;br /&gt;
18;MOD_GRENADE_LAUNCHER;&lt;br /&gt;
19;MOD_FLAMETHROWER;&lt;br /&gt;
20;MOD_GRENADE_PINEAPPLE;&lt;br /&gt;
21;MOD_CROSS;&lt;br /&gt;
22;MOD_MAPMORTAR;&lt;br /&gt;
23;MOD_MAPMORTAR_SPLASH;&lt;br /&gt;
24;MOD_KICKED;&lt;br /&gt;
25;MOD_GRABBER;&lt;br /&gt;
26;MOD_DYNAMITE;&lt;br /&gt;
27;MOD_AIRSTRIKE;&lt;br /&gt;
28;MOD_SYRINGE;&lt;br /&gt;
29;MOD_AMMO;&lt;br /&gt;
30;MOD_ARTY;&lt;br /&gt;
31;MOD_WATER;&lt;br /&gt;
32;MOD_SLIME;&lt;br /&gt;
33;MOD_LAVA;&lt;br /&gt;
34;MOD_CRUSH;&lt;br /&gt;
35;MOD_TELEFRAG;&lt;br /&gt;
36;MOD_FALLING;&lt;br /&gt;
37;MOD_SUICIDE;&lt;br /&gt;
38;MOD_TARGET_LASER;&lt;br /&gt;
39;MOD_TRIGGER_HURT;&lt;br /&gt;
40;MOD_EXPLOSIVE;&lt;br /&gt;
41;MOD_CARBINE;&lt;br /&gt;
42;MOD_KAR98;&lt;br /&gt;
43;MOD_GPG40;&lt;br /&gt;
44;MOD_M7;&lt;br /&gt;
45;MOD_LANDMINE;&lt;br /&gt;
46;MOD_SATCHEL;&lt;br /&gt;
47;MOD_TRIPMINE;&lt;br /&gt;
48;MOD_SMOKEBOMB;&lt;br /&gt;
49;MOD_MOBILE_MG42;&lt;br /&gt;
50;MOD_SILENCED_COLT;&lt;br /&gt;
51;MOD_GARAND_SCOPE;&lt;br /&gt;
52;MOD_CRUSH_CONSTRUCTION;&lt;br /&gt;
53;MOD_CRUSH_CONSTRUCTIONDEATH;&lt;br /&gt;
54;MOD_CRUSH_CONSTRUCTIONDEATH_NOATTACKER;&lt;br /&gt;
55;MOD_K43;&lt;br /&gt;
56;MOD_K43_SCOPE;&lt;br /&gt;
57;MOD_MORTAR;&lt;br /&gt;
58;MOD_AKIMBO_COLT;&lt;br /&gt;
59;MOD_AKIMBO_LUGER;&lt;br /&gt;
60;MOD_AKIMBO_SILENCEDCOLT;&lt;br /&gt;
61;MOD_AKIMBO_SILENCEDLUGER;&lt;br /&gt;
62;MOD_SMOKEGRENADE;&lt;br /&gt;
63;MOD_SWAP_PLACES;&lt;br /&gt;
64;MOD_SWITCHTEAM;&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Etdamage&amp;diff=2099</id>
		<title>Etdamage</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Etdamage&amp;diff=2099"/>
		<updated>2006-03-08T16:59:32Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: added MOD_&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
*&#039;&#039;&#039;Damage Flags List&#039;&#039;&#039;&lt;br /&gt;
:damage flags are [[Bitmask-cvar|bitflags]]&lt;br /&gt;
:the following bits are available:&lt;br /&gt;
&amp;lt;pre&amp;gt;DAMAGE_RADIUS			1 // damage was indirect&lt;br /&gt;
DAMAGE_HALF_KNOCKBACK		2 // Gordon: do less knockback&lt;br /&gt;
DAMAGE_NO_KNOCKBACK		4 // do not affect velocity, just view angles&lt;br /&gt;
DAMAGE_NO_PROTECTION		8 // armor, shields, invulnerability, and godmode have no effect&lt;br /&gt;
DAMAGE_NO_TEAM_PROTECTION	16 // armor, shields, invulnerability, and godmode have no effect&lt;br /&gt;
DAMAGE_DISTANCEFALLOFF		32 // distance falloff&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Method of Death List&#039;&#039;&#039;&lt;br /&gt;
:Method&#039;s of Death are numbers indicatig of how the damage was inflickted&lt;br /&gt;
The following Method&#039;s of Death are avialable:&lt;br /&gt;
&amp;lt;pitatable columns=2 headlines=&amp;quot;number;type&amp;quot; widths=&amp;quot;40;120&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
0;MOD_UNKNOWN;&lt;br /&gt;
1;MOD_MACHINEGUN;&lt;br /&gt;
2;MOD_BROWNING;&lt;br /&gt;
3;MOD_MG42;&lt;br /&gt;
4;MOD_GRENADE;&lt;br /&gt;
5;MOD_ROCKET;&lt;br /&gt;
6;MOD_KNIFE;&lt;br /&gt;
7;MOD_LUGER;&lt;br /&gt;
8;MOD_COLT;&lt;br /&gt;
9;MOD_MP40;&lt;br /&gt;
10;MOD_THOMPSON;&lt;br /&gt;
11;MOD_STEN;&lt;br /&gt;
12;MOD_GARAND;&lt;br /&gt;
13;MOD_SNOOPERSCOPE;&lt;br /&gt;
14;MOD_SILENCER;&lt;br /&gt;
15;MOD_FG42;&lt;br /&gt;
16;MOD_FG42SCOPE;&lt;br /&gt;
17;MOD_PANZERFAUST;&lt;br /&gt;
18;MOD_GRENADE_LAUNCHER;&lt;br /&gt;
19;MOD_FLAMETHROWER;&lt;br /&gt;
20;MOD_GRENADE_PINEAPPLE;&lt;br /&gt;
21;MOD_CROSS;&lt;br /&gt;
22;MOD_MAPMORTAR;&lt;br /&gt;
23;MOD_MAPMORTAR_SPLASH;&lt;br /&gt;
24;MOD_KICKED;&lt;br /&gt;
25;MOD_GRABBER;&lt;br /&gt;
26;MOD_DYNAMITE;&lt;br /&gt;
27;MOD_AIRSTRIKE;&lt;br /&gt;
28;MOD_SYRINGE;&lt;br /&gt;
29;MOD_AMMO;&lt;br /&gt;
30;MOD_ARTY;&lt;br /&gt;
31;MOD_WATER;&lt;br /&gt;
32;MOD_SLIME;&lt;br /&gt;
33;MOD_LAVA;&lt;br /&gt;
34;MOD_CRUSH;&lt;br /&gt;
35;MOD_TELEFRAG;&lt;br /&gt;
36;MOD_FALLING;&lt;br /&gt;
37;MOD_SUICIDE;&lt;br /&gt;
38;MOD_TARGET_LASER;&lt;br /&gt;
39;MOD_TRIGGER_HURT;&lt;br /&gt;
40;MOD_EXPLOSIVE;&lt;br /&gt;
41;MOD_CARBINE;&lt;br /&gt;
42;MOD_KAR98;&lt;br /&gt;
43;MOD_GPG40;&lt;br /&gt;
44;MOD_M7;&lt;br /&gt;
45;MOD_LANDMINE;&lt;br /&gt;
46;MOD_SATCHEL;&lt;br /&gt;
47;MOD_TRIPMINE;&lt;br /&gt;
48;MOD_SMOKEBOMB;&lt;br /&gt;
49;MOD_MOBILE_MG42;&lt;br /&gt;
50;MOD_SILENCED_COLT;&lt;br /&gt;
51;MOD_GARAND_SCOPE;&lt;br /&gt;
52;MOD_CRUSH_CONSTRUCTION;&lt;br /&gt;
53;MOD_CRUSH_CONSTRUCTIONDEATH;&lt;br /&gt;
54;MOD_CRUSH_CONSTRUCTIONDEATH_NOATTACKER;&lt;br /&gt;
55;MOD_K43;&lt;br /&gt;
56;MOD_K43_SCOPE;&lt;br /&gt;
57;MOD_MORTAR;&lt;br /&gt;
58;MOD_AKIMBO_COLT;&lt;br /&gt;
59;MOD_AKIMBO_LUGER;&lt;br /&gt;
60;MOD_AKIMBO_SILENCEDCOLT;&lt;br /&gt;
61;MOD_AKIMBO_SILENCEDLUGER;&lt;br /&gt;
62;MOD_SMOKEGRENADE;&lt;br /&gt;
63;MOD_SWAP_PLACES;&lt;br /&gt;
64;MOD_SWITCHTEAM;&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Etdamage&amp;diff=2098</id>
		<title>Etdamage</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Etdamage&amp;diff=2098"/>
		<updated>2006-03-08T16:22:31Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: added MOD_ beta 1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
*&#039;&#039;&#039;Damage Flags List&#039;&#039;&#039;&lt;br /&gt;
:damage flags are [[Bitmask-cvar|bitflags]]&lt;br /&gt;
:the following bits are available:&lt;br /&gt;
&amp;lt;pre&amp;gt;DAMAGE_RADIUS			1 // damage was indirect&lt;br /&gt;
DAMAGE_HALF_KNOCKBACK		2 // Gordon: do less knockback&lt;br /&gt;
DAMAGE_NO_KNOCKBACK		4 // do not affect velocity, just view angles&lt;br /&gt;
DAMAGE_NO_PROTECTION		8 // armor, shields, invulnerability, and godmode have no effect&lt;br /&gt;
DAMAGE_NO_TEAM_PROTECTION	16 // armor, shields, invulnerability, and godmode have no effect&lt;br /&gt;
DAMAGE_DISTANCEFALLOFF		32 // distance falloff&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Method of Death List&#039;&#039;&#039;&lt;br /&gt;
:Method&#039;s of Death are numbers indicatig of how the damage was inflickted&lt;br /&gt;
The following Method&#039;s of Death are avialable:&lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;number;type&amp;quot; widths=&amp;quot;40;80&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
0;MOD_UNKNOWN;&lt;br /&gt;
MOD_MACHINEGUN;&lt;br /&gt;
MOD_BROWNING;&lt;br /&gt;
MOD_MG42;&lt;br /&gt;
MOD_GRENADE&lt;br /&gt;
MOD_ROCKET5&lt;br /&gt;
MOD_KNIFE&lt;br /&gt;
MOD_LUGER&lt;br /&gt;
MOD_COLT&lt;br /&gt;
MOD_MP40&lt;br /&gt;
MOD_THOMPSON10&lt;br /&gt;
MOD_STEN,&lt;br /&gt;
MOD_GARAND,&lt;br /&gt;
MOD_SNOOPERSCOPE,&lt;br /&gt;
MOD_SILENCER,	&lt;br /&gt;
MOD_FG42,15&lt;br /&gt;
MOD_FG42SCOPE,&lt;br /&gt;
MOD_PANZERFAUST,&lt;br /&gt;
MOD_GRENADE_LAUNCHER,&lt;br /&gt;
MOD_FLAMETHROWER,&lt;br /&gt;
MOD_GRENADE_PINEAPPLE,20&lt;br /&gt;
MOD_CROSS,&lt;br /&gt;
MOD_MAPMORTAR,&lt;br /&gt;
MOD_MAPMORTAR_SPLASH,&lt;br /&gt;
MOD_KICKED,&lt;br /&gt;
MOD_GRABBER,25&lt;br /&gt;
MOD_DYNAMITE,&lt;br /&gt;
MOD_AIRSTRIKE,&lt;br /&gt;
MOD_SYRINGE,&lt;br /&gt;
MOD_AMMO,&lt;br /&gt;
MOD_ARTY,30&lt;br /&gt;
MOD_WATER,&lt;br /&gt;
MOD_SLIME,&lt;br /&gt;
MOD_LAVA,&lt;br /&gt;
MOD_CRUSH,&lt;br /&gt;
MOD_TELEFRAG,35&lt;br /&gt;
MOD_FALLING,&lt;br /&gt;
MOD_SUICIDE,&lt;br /&gt;
MOD_TARGET_LASER,&lt;br /&gt;
MOD_TRIGGER_HURT,&lt;br /&gt;
MOD_EXPLOSIVE,40&lt;br /&gt;
MOD_CARBINE,&lt;br /&gt;
MOD_KAR98,&lt;br /&gt;
MOD_GPG40,&lt;br /&gt;
MOD_M7,&lt;br /&gt;
MOD_LANDMINE,45&lt;br /&gt;
MOD_SATCHEL,&lt;br /&gt;
MOD_TRIPMINE,&lt;br /&gt;
MOD_SMOKEBOMB,&lt;br /&gt;
MOD_MOBILE_MG42,&lt;br /&gt;
MOD_SILENCED_COLT,50&lt;br /&gt;
MOD_GARAND_SCOPE,&lt;br /&gt;
MOD_CRUSH_CONSTRUCTION,&lt;br /&gt;
MOD_CRUSH_CONSTRUCTIONDEATH,&lt;br /&gt;
MOD_CRUSH_CONSTRUCTIONDEATH_NOATTACKER,&lt;br /&gt;
MOD_K43,55&lt;br /&gt;
MOD_K43_SCOPE,&lt;br /&gt;
MOD_MORTAR,&lt;br /&gt;
MOD_AKIMBO_COLT,&lt;br /&gt;
MOD_AKIMBO_LUGER,&lt;br /&gt;
MOD_AKIMBO_SILENCEDCOLT,60&lt;br /&gt;
MOD_AKIMBO_SILENCEDLUGER,&lt;br /&gt;
MOD_SMOKEGRENADE,&lt;br /&gt;
MOD_SWAP_PLACES,&lt;br /&gt;
MOD_SWITCHTEAM,&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&amp;lt;/pitatable&amp;gt;&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Etdamage&amp;diff=2097</id>
		<title>Etdamage</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Etdamage&amp;diff=2097"/>
		<updated>2006-03-08T16:12:07Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: added dflags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
*&#039;&#039;&#039;Damage Flags&#039;&#039;&#039;&lt;br /&gt;
:damage flags are bitflags&lt;br /&gt;
:the following bits are available&lt;br /&gt;
&amp;lt;pre&amp;gt;DAMAGE_RADIUS			1 // damage was indirect&lt;br /&gt;
DAMAGE_HALF_KNOCKBACK		2 // Gordon: do less knockback&lt;br /&gt;
DAMAGE_NO_KNOCKBACK		4 // do not affect velocity, just view angles&lt;br /&gt;
DAMAGE_NO_PROTECTION		8 // armor, shields, invulnerability, and godmode have no effect&lt;br /&gt;
DAMAGE_NO_TEAM_PROTECTION	16 // armor, shields, invulnerability, and godmode have no effect&lt;br /&gt;
DAMAGE_DISTANCEFALLOFF		32 // distance falloff&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Talk:Lua_Mod_API&amp;diff=2096</id>
		<title>Talk:Lua Mod API</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Talk:Lua_Mod_API&amp;diff=2096"/>
		<updated>2006-03-08T15:45:26Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: added my name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;- et.G_SlotSound( slotnum, soundindex ) -&amp;gt;  Plays the sound soundindex at for the player @ slotnum only. --[[User:RoadKillPuppy|RoadKillPuppy]] 14:17, 16 December 2005 (PST)&lt;br /&gt;
:you can do this with tempentities and SVF_SINGLECLIENT ...&lt;br /&gt;
:--[[User:Bani|Bani]] 17:32, 16 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
some of this can be done via function et_Print(text).. but this would greatly simplify life,&amp;lt;br&amp;gt;&lt;br /&gt;
my wish list for christmas:&amp;lt;br&amp;gt;&lt;br /&gt;
- getUserEguid(cno) - get a client&#039;s etpro guid?&amp;lt;br&amp;gt;&lt;br /&gt;
- repair gentity_set for vec3 - scotty fix the transporter please&amp;lt;br&amp;gt;&lt;br /&gt;
:[http://bani.anime.net/banimod/forums/viewtopic.php?t=6279 fixed.]--[[User:Bani|Bani]] 17:56, 22 December 2005 (PST)&lt;br /&gt;
- et.trap_SendServerCommand(cno, &amp;quot;kill&amp;quot;) - punish client as alternative to setting health&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Hadr0|Hadr0]] 02:10, 20 December 2005 (PST)&amp;lt;br&amp;gt;&lt;br /&gt;
:You can use et.G_Damage() in the new test version to do that.--[[User:Bani|Bani]] 01:38, 23 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
trap sen server cmd is a ET engine trap the comand u send it send to the client and recived as a server command no a client command&lt;br /&gt;
&lt;br /&gt;
to add ill well that would be al ot of coding for not much [[User:=FF=im2good4u|=FF=Im2good4u]] 12:12, 20 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
aight thnx.&amp;lt;br&amp;gt;&lt;br /&gt;
heres another api request, i&#039;d like to be able to get a clients xp directly. et.gentity_get(cno, &amp;quot;sess.game_points&amp;quot;) seems to return 0 always (?)&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Hadr0|Hadr0]] 15:38, 21 December 2005 (PST)&lt;br /&gt;
:oh nevermind, i see this can be done now with xp = et.gentity_get(cno, &amp;quot;ps.stats&amp;quot;, 8)&lt;br /&gt;
:nice... --[[User:Hadr0|Hadr0]] 16:58, 23 December 2005 (PST)&lt;br /&gt;
--------&lt;br /&gt;
add a way to determine if a client is 999, and if possible why he&#039;s 999 (loading, connecting, loosing packets, etc)&amp;lt;br&amp;gt;&lt;br /&gt;
--Gotenks&lt;br /&gt;
&lt;br /&gt;
999 means: server has not been sent data from client for &amp;gt; 1000 ms. So there is no way to certainly tell why.&lt;br /&gt;
The timeoutflag is stored in the pmflags IIRC. Don&#039;t know if lua can read them right now. --[[User:Deus|Deus]] 23:12, 22 December 2005 (PST)&amp;lt;br&amp;gt;&lt;br /&gt;
Still would like access to the ping, or a dummy variable if they are 999, but also the ammount of time they are inactive.&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Gotenks|Gotenks]] (Sorry for double post) 1:53, 31 December 2005 (CST)&lt;br /&gt;
:[http://bani.anime.net/banimod/forums/viewtopic.php?t=6291 fixed].--[[User:Bani|Bani]] 02:40, 7 February 2006 (PST)&lt;br /&gt;
----&lt;br /&gt;
Access to weapon stats during game similar to end of round stats that are displayed.&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:LethalInjection|LethalInjection]] 23:52, 22 December 2005 (PST)&lt;br /&gt;
:[http://bani.anime.net/banimod/forums/viewtopic.php?t=6291 fixed].--[[User:Bani|Bani]] 02:40, 7 February 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== IPC stuff ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
i would like a et_IPCReceive whit an return value so u can send info back on a request&lt;br /&gt;
&lt;br /&gt;
i would like a et_IPCSend that can send to all lua mods then them mods can decide if the wana use that message or not&lt;br /&gt;
[[User:=FF=im2good4u|=FF=Im2good4u]] 12:35, 8 January 2006 (PST)&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
  et_IPCReceive wouldn&#039;t send it to the other mod... afaik... so just use another send&lt;br /&gt;
  just et_IPCSend to all modules (afaik, you can even send to ones not there), simple loop function&lt;br /&gt;
[[User:gotenks|gotenks]] 20:04, 8 January 2006 (CST)&lt;br /&gt;
&lt;br /&gt;
yeh probely but its not verry handy its better to get the good vmnumber or to e able to send on mod filenames&lt;br /&gt;
&lt;br /&gt;
apart from that returning a value will be more handy since tnhe u cna contine in 1 funtion else u got to reacise it in the recieve funtion [[User:=FF=im2good4u|=FF=Im2good4u]] 10:45, 9 January 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
bani i need a console print function on the client that does sepport ascii plz [[User:=FF=im2good4u|=FF=Im2good4u]] 12:49, 12 January 2006 (PST)&lt;br /&gt;
:et.trap_SendServerCommand( clientnum, &amp;quot;print \&amp;quot;hello ascii console on the client\n\&amp;quot; ) ) --[[User:Bani|Bani]] 22:33, 15 January 2006 (PST)&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
bani: how about a et_sound(id, sound) event? [[User:gotenks|gotenks]] 20:45, 17 January 2006 (CST)&lt;br /&gt;
:[http://wolfwiki.anime.net/index.php/ETPro:Lua_Mod_API#sound et.G_Sound( entnum, soundindex )] --[[User:Bani|Bani]] 22:07, 18 January 2006 (PST)&lt;br /&gt;
:bani, i was referring to an on event call, so when a sound is played et_sound(id,sound) would be called.[[User:gotenks|gotenks]] 21:45, 20 January 2006 (CST)&lt;br /&gt;
::most sounds are clientside... this would not be of much use. --[[User:Bani|Bani]] 04:42, 22 January 2006 (PST)&lt;br /&gt;
:::except for checking when something like a killing spree sound is activated--[[User:gotenks|gotenks]] 07:54, 23 January 2006 (CST)&lt;br /&gt;
:::::There would be no way for you to know what sound was activated. You can&#039;t get a filename from the soundindex.--[[User:Bani|Bani]] 10:19, 24 January 2006 (PST)&lt;br /&gt;
:::::This is a case where IPCSend/IPCReceive would be useful, so mods can notify each other of specific events.--[[User:Bani|Bani]] 02:40, 7 February 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Is it possible to get a player&#039;s live angles? Fieldname &amp;quot;s.angles&amp;quot; only gives the spawn angles. Tried &amp;quot;rotate&amp;quot;, &amp;quot;s.angles2&amp;quot;, &amp;quot;TargetAngles&amp;quot;, &amp;quot;r.currentAngles&amp;quot; as well but they just give 0.000000 for each element. thanks for any help --[[User:Hadr0|Hadr0]] 01:35, 25 January 2006 (PST)&lt;br /&gt;
:This will be fixed in the next release, where you will get access to ps.viewangles--[[User:Bani|Bani]] 02:33, 7 February 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
== LoadLib ==&lt;br /&gt;
&lt;br /&gt;
Add loadlib ppl it says u have lua basic included but not loadlib !!&lt;br /&gt;
&lt;br /&gt;
(on windows it gives an error attept to call global load lin a nil valua)[[User:=FF=im2good4u|=FF=Im2good4u]] 05:16, 15 February 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
== XP controll not just skill ==&lt;br /&gt;
&lt;br /&gt;
i would like to requesst RW acces to &amp;quot;sess.skillpoints&amp;quot; array&lt;br /&gt;
&lt;br /&gt;
at atleast a callback on et.G_AddSkillPoints ( &#039;&#039;&#039;cno&#039;&#039;&#039;, &#039;&#039;&#039;skill&#039;&#039;&#039;, &#039;&#039;&#039;points&#039;&#039;&#039; ) [[User:=FF=im2good4u|=FF=Im2good4u]] 07:45, 8 March 2006 (PST)&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Talk:Lua_Mod_API&amp;diff=2095</id>
		<title>Talk:Lua Mod API</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Talk:Lua_Mod_API&amp;diff=2095"/>
		<updated>2006-03-08T15:44:16Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: XP controll not just skill&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;- et.G_SlotSound( slotnum, soundindex ) -&amp;gt;  Plays the sound soundindex at for the player @ slotnum only. --[[User:RoadKillPuppy|RoadKillPuppy]] 14:17, 16 December 2005 (PST)&lt;br /&gt;
:you can do this with tempentities and SVF_SINGLECLIENT ...&lt;br /&gt;
:--[[User:Bani|Bani]] 17:32, 16 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
some of this can be done via function et_Print(text).. but this would greatly simplify life,&amp;lt;br&amp;gt;&lt;br /&gt;
my wish list for christmas:&amp;lt;br&amp;gt;&lt;br /&gt;
- getUserEguid(cno) - get a client&#039;s etpro guid?&amp;lt;br&amp;gt;&lt;br /&gt;
- repair gentity_set for vec3 - scotty fix the transporter please&amp;lt;br&amp;gt;&lt;br /&gt;
:[http://bani.anime.net/banimod/forums/viewtopic.php?t=6279 fixed.]--[[User:Bani|Bani]] 17:56, 22 December 2005 (PST)&lt;br /&gt;
- et.trap_SendServerCommand(cno, &amp;quot;kill&amp;quot;) - punish client as alternative to setting health&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Hadr0|Hadr0]] 02:10, 20 December 2005 (PST)&amp;lt;br&amp;gt;&lt;br /&gt;
:You can use et.G_Damage() in the new test version to do that.--[[User:Bani|Bani]] 01:38, 23 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
trap sen server cmd is a ET engine trap the comand u send it send to the client and recived as a server command no a client command&lt;br /&gt;
&lt;br /&gt;
to add ill well that would be al ot of coding for not much [[User:=FF=im2good4u|=FF=Im2good4u]] 12:12, 20 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
aight thnx.&amp;lt;br&amp;gt;&lt;br /&gt;
heres another api request, i&#039;d like to be able to get a clients xp directly. et.gentity_get(cno, &amp;quot;sess.game_points&amp;quot;) seems to return 0 always (?)&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Hadr0|Hadr0]] 15:38, 21 December 2005 (PST)&lt;br /&gt;
:oh nevermind, i see this can be done now with xp = et.gentity_get(cno, &amp;quot;ps.stats&amp;quot;, 8)&lt;br /&gt;
:nice... --[[User:Hadr0|Hadr0]] 16:58, 23 December 2005 (PST)&lt;br /&gt;
--------&lt;br /&gt;
add a way to determine if a client is 999, and if possible why he&#039;s 999 (loading, connecting, loosing packets, etc)&amp;lt;br&amp;gt;&lt;br /&gt;
--Gotenks&lt;br /&gt;
&lt;br /&gt;
999 means: server has not been sent data from client for &amp;gt; 1000 ms. So there is no way to certainly tell why.&lt;br /&gt;
The timeoutflag is stored in the pmflags IIRC. Don&#039;t know if lua can read them right now. --[[User:Deus|Deus]] 23:12, 22 December 2005 (PST)&amp;lt;br&amp;gt;&lt;br /&gt;
Still would like access to the ping, or a dummy variable if they are 999, but also the ammount of time they are inactive.&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Gotenks|Gotenks]] (Sorry for double post) 1:53, 31 December 2005 (CST)&lt;br /&gt;
:[http://bani.anime.net/banimod/forums/viewtopic.php?t=6291 fixed].--[[User:Bani|Bani]] 02:40, 7 February 2006 (PST)&lt;br /&gt;
----&lt;br /&gt;
Access to weapon stats during game similar to end of round stats that are displayed.&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:LethalInjection|LethalInjection]] 23:52, 22 December 2005 (PST)&lt;br /&gt;
:[http://bani.anime.net/banimod/forums/viewtopic.php?t=6291 fixed].--[[User:Bani|Bani]] 02:40, 7 February 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== IPC stuff ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
i would like a et_IPCReceive whit an return value so u can send info back on a request&lt;br /&gt;
&lt;br /&gt;
i would like a et_IPCSend that can send to all lua mods then them mods can decide if the wana use that message or not&lt;br /&gt;
[[User:=FF=im2good4u|=FF=Im2good4u]] 12:35, 8 January 2006 (PST)&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
  et_IPCReceive wouldn&#039;t send it to the other mod... afaik... so just use another send&lt;br /&gt;
  just et_IPCSend to all modules (afaik, you can even send to ones not there), simple loop function&lt;br /&gt;
[[User:gotenks|gotenks]] 20:04, 8 January 2006 (CST)&lt;br /&gt;
&lt;br /&gt;
yeh probely but its not verry handy its better to get the good vmnumber or to e able to send on mod filenames&lt;br /&gt;
&lt;br /&gt;
apart from that returning a value will be more handy since tnhe u cna contine in 1 funtion else u got to reacise it in the recieve funtion [[User:=FF=im2good4u|=FF=Im2good4u]] 10:45, 9 January 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
bani i need a console print function on the client that does sepport ascii plz [[User:=FF=im2good4u|=FF=Im2good4u]] 12:49, 12 January 2006 (PST)&lt;br /&gt;
:et.trap_SendServerCommand( clientnum, &amp;quot;print \&amp;quot;hello ascii console on the client\n\&amp;quot; ) ) --[[User:Bani|Bani]] 22:33, 15 January 2006 (PST)&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
bani: how about a et_sound(id, sound) event? [[User:gotenks|gotenks]] 20:45, 17 January 2006 (CST)&lt;br /&gt;
:[http://wolfwiki.anime.net/index.php/ETPro:Lua_Mod_API#sound et.G_Sound( entnum, soundindex )] --[[User:Bani|Bani]] 22:07, 18 January 2006 (PST)&lt;br /&gt;
:bani, i was referring to an on event call, so when a sound is played et_sound(id,sound) would be called.[[User:gotenks|gotenks]] 21:45, 20 January 2006 (CST)&lt;br /&gt;
::most sounds are clientside... this would not be of much use. --[[User:Bani|Bani]] 04:42, 22 January 2006 (PST)&lt;br /&gt;
:::except for checking when something like a killing spree sound is activated--[[User:gotenks|gotenks]] 07:54, 23 January 2006 (CST)&lt;br /&gt;
:::::There would be no way for you to know what sound was activated. You can&#039;t get a filename from the soundindex.--[[User:Bani|Bani]] 10:19, 24 January 2006 (PST)&lt;br /&gt;
:::::This is a case where IPCSend/IPCReceive would be useful, so mods can notify each other of specific events.--[[User:Bani|Bani]] 02:40, 7 February 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Is it possible to get a player&#039;s live angles? Fieldname &amp;quot;s.angles&amp;quot; only gives the spawn angles. Tried &amp;quot;rotate&amp;quot;, &amp;quot;s.angles2&amp;quot;, &amp;quot;TargetAngles&amp;quot;, &amp;quot;r.currentAngles&amp;quot; as well but they just give 0.000000 for each element. thanks for any help --[[User:Hadr0|Hadr0]] 01:35, 25 January 2006 (PST)&lt;br /&gt;
:This will be fixed in the next release, where you will get access to ps.viewangles--[[User:Bani|Bani]] 02:33, 7 February 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
== LoadLib ==&lt;br /&gt;
&lt;br /&gt;
Add loadlib ppl it says u have lua basic included but not loadlib !!&lt;br /&gt;
&lt;br /&gt;
(on windows it gives an error attept to call global load lin a nil valua)[[User:=FF=im2good4u|=FF=Im2good4u]] 05:16, 15 February 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
== XP controll not just skill ==&lt;br /&gt;
&lt;br /&gt;
i would like to requesst RW acces to &amp;quot;sess.skillpoints&amp;quot; array&lt;br /&gt;
&lt;br /&gt;
at atleast a callback on et.G_AddSkillPoints ( &#039;&#039;&#039;cno&#039;&#039;&#039;, &#039;&#039;&#039;skill&#039;&#039;&#039;, &#039;&#039;&#039;points&#039;&#039;&#039; )&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Mod_API&amp;diff=2094</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=2094"/>
		<updated>2006-03-08T15:41:34Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: snapshot 3 callbacks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
ETPro now supports serverside 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. ETPro also provides an &amp;quot;et&amp;quot; library of function calls for lua to access the server engine, and provides callbacks so a serverside 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;
API Requests can be discussed [http://wolfwiki.anime.net/index.php/Talk:ETPro:Lua_Mod_API here].&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;,arraynumber&#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;arraynumber&#039;&#039; is an optional parameter to use when working whit array fields. In that case it represents the position in the array&lt;br /&gt;
et.gentity_set( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039;, &#039;&#039;arraynumber,&#039;&#039; &#039;&#039;&#039;(variable)&#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;(variable)&#039;&#039;&#039;&lt;br /&gt;
:&#039;&#039;arraynumber&#039;&#039; is an optional parameter to use when working whit array fields. In that case it represents the position in the array&amp;lt;br&amp;gt;&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 re-load my lua file without restarting the whole server ?&amp;lt;br&amp;gt;&lt;br /&gt;
A: change maps or map_restart&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]]&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;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=User:%3DFF%3Dim2good4u&amp;diff=2090</id>
		<title>User:=FF=im2good4u</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=User:%3DFF%3Dim2good4u&amp;diff=2090"/>
		<updated>2006-03-07T18:18:24Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: updated nowepaon&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;table witdh=100% height=100&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td width=400 align=center valign=center&amp;gt;http://news.bbc.co.uk/olmedia/1750000/images/_1752807_wolfen-activi150.jpg&amp;lt;/td&amp;gt;&amp;lt;td width=100% align=left valign=center&amp;gt;&lt;br /&gt;
== Contact ==&lt;br /&gt;
* &#039;&#039;&#039;Clan Homepage&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;[http://www.ffclan.net www.ffclan.net]&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Email&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;Hidden&lt;br /&gt;
* &#039;&#039;&#039;[[IRC]]&#039;&#039;&#039;&lt;br /&gt;
**&#039;&#039;#etpro&#039;&#039; - [[ETPro]] channel on freenode&amp;lt;br&amp;gt;[[irc://irc.freenode.net:6667/etpro]]&lt;br /&gt;
**&#039;&#039;#etpro&#039;&#039; - [[ETPro]] support channel on quakenet&amp;lt;br&amp;gt;[[irc://irc.quakenet.org:6667/etpro]]&lt;br /&gt;
**&#039;&#039;#=FF=Clan&#039;&#039; - [http://www.ffclan.net =FF=Clan] Clan channel on quakenet&amp;lt;br&amp;gt;[[irc://irc.quakenet.org:6667/=FF=Clan]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==ETPro/Lua libraries, modules and examples==&lt;br /&gt;
;Follow the link to the source code for more detailed information about each item.&lt;br /&gt;
&lt;br /&gt;
*[http://home.zonnet.nl/westhof99/lua/noweapon1.1.lua nowepaon.lua] &#039;&#039;disables the weapons u want except engineer tool and knife&#039;&amp;quot;&lt;br /&gt;
: just instal it and it works&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*[http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.lua ETProStuffPlug.lua] &#039;&#039;one lua mod to rules them all !&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.lua ETProStuffPlug] offers the following functions/commands:&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;etprostuffplug&#039;&#039;&#039; - C/S - Shows some info about ETProStuffPlug&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;cheaterdump&#039;&#039;&#039; &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; &#039;&#039;&amp;lt;file&amp;gt;&#039;&#039; - S - Will dump the IAC output code for &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; to &#039;&#039;&amp;lt;file&amp;gt;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;dumpuserid&#039;&#039;&#039; &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; - S - Will dump the userinfo of &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; instead of using a playername&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;iplist&#039;&#039;&#039; - S/C* - Prints out players whit thier ip&#039;s (handy for semiadmins)&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;statuslist&#039;&#039;&#039; - S/C* - Prints a players his abilties like Referee* , Schoutcaster* , Semiadmin*#*&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;referee&#039;&#039;&#039; / &#039;&#039;&#039;unreferee&#039;&#039;&#039; &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; - S - gives / removes referee status of &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;shoutcast&#039;&#039;&#039; / &#039;&#039;&#039;unshoutcast&#039;&#039;&#039; &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; - S - gives / removes shoutcast status of &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;semiadmin&#039;&#039;&#039; / &#039;&#039;&#039;unsemiadmin&#039;&#039;&#039; &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; &#039;&#039;&amp;lt;level&amp;gt;&#039;&#039; &#039;hidden&#039; - S - gives / removes semiadmin status of &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039;, the &#039;hidden&#039; paramter is optionaly to make the login not broadcast the logged in message&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;semiadminenable&#039;&#039;&#039; / &#039;&#039;&#039;semiadmindisable&#039;&#039;&#039; - S - enables or diesables the client semiadmin,sa,semiadminlogin,sal commands&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;revereeenable&#039;&#039;&#039; / &#039;&#039;&#039;revereedisable&#039;&#039;&#039; - S - enables or diesables the client ref command&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;semiadminlogout&#039;&#039;&#039; / &#039;&#039;&#039;salo&#039;&#039;&#039; - C - will log u out of semiadmin (handy if u let someone else play ay your pc&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;semiadminlogin&#039;&#039;&#039; / &#039;&#039;&#039;sal&#039;&#039;&#039; &#039;&#039;&amp;lt;password&amp;gt;&#039;&#039; &#039;hidden&#039;* - C - new optional parameter to login whitout the broadcast message&lt;br /&gt;
:*&#039;&#039;&#039;say&#039;&#039;&#039; / &#039;&#039;&#039;say_team&#039;&#039;&#039; / &#039;&#039;&#039;say_buddy&#039;&#039;&#039; / &#039;&#039;&#039;say_teamnl&#039;&#039;&#039; &#039;&#039;&amp;lt;message&amp;gt;&#039;&#039;* - C - new abilety type the %parameter and it gets repalced by your value, parameters are: %slot,%me,%health,%class,%team,%weapon,%altweapon,%respawnclass,%respawnweapon,%respawnaltweapon,%status&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;say_normal&#039;&#039;&#039; / &#039;&#039;&#039;say_team_normal&#039;&#039;&#039; / &#039;&#039;&#039;say_buddy_normal&#039;&#039;&#039; / &#039;&#039;&#039;say_teamnl_normal&#039;&#039;&#039; &#039;&#039;&amp;lt;message&amp;gt;&#039;&#039; - C - says &#039;&#039;&amp;lt;message&amp;gt;&#039;&#039; whitout advanced chat moddifications&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the items marked whit a * can be turned on or off by the configfile&lt;br /&gt;
[http://home.zonnet.nl/westhof99/lua/ETProStuffPlugConfig.cfg ETProStuffPlugConfig.cfg]&lt;br /&gt;
&lt;br /&gt;
to instal [http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.lua ETProStuffPlug.lua] simpely dl http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.zip ETProStuffPlug.zip] and unzip it in your /[[ETPro]]/ directory.&amp;lt;br&amp;gt; &lt;br /&gt;
Then add [http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.lua ETProStuffPlug.lua] to your lua_modules &amp;quot;&amp;quot; cvar&amp;lt;br&amp;gt;&lt;br /&gt;
also u might first wana config your [http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.lua ETProStuffPlug.lua] by editing your [http://home.zonnet.nl/westhof99/lua/ETProStuffPlugConfig.cfg ETProStuffPlugConfig.cfg]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTICE! [http://www.collectivecomputing.com/~reed/et/lua/etconst.lua etconst.lua] is required&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*[http://home.zonnet.nl/westhof99/lua/VarPrint.lua VarPrint.lua] A simple function that converts varialbes into strings so u can even print nils,booleans,functions and tables whitout getting an error&lt;br /&gt;
&#039;&#039;useage:&#039;&#039; &#039;&#039;&#039;string&#039;&#039;&#039; = VarPrint( &#039;&#039;&#039;(variable)&#039;&#039;&#039; )&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*[http://home.zonnet.nl/westhof99/lua/DebugLib.lua DebugLib.lua] A lua library that provides a special a debug print function. that can automagicly print the function - sub function - executing time - a message - and any variable u want (so even tables , functions , nils or true / false.&lt;br /&gt;
to implent http://home.zonnet.nl/westhof99/lua/DebugLib.lua DebugLib.lua] use &#039;&#039;&#039;require(&#039;DebugLib&#039;)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
then at the start of function do&amp;lt;br&amp;gt; &lt;br /&gt;
Debug.SetFunction(  &#039;&#039;&#039;fuctionname&#039;&#039;&#039;&#039;, &#039;&#039;&#039;true/false&#039;&#039;&#039;, &#039;&#039;&#039;timeroffset&#039;&#039;&#039;)&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;functionname&#039;&#039;&#039; is a string that will show up in the &#039;&#039;debug.Print&#039;&#039; this does not affect &#039;&#039;&#039;subfunctionname&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;true/false&#039;&#039;&#039; will start the timer or leave it at 0 &#039;&#039;this paremeter can de ignored&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;timeroffset&#039;&#039;&#039; this is the offset at witch the timer willstart &#039;&#039;this paremeter can de ignored&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
now when u enter special section if your code u can use&amp;lt;br&amp;gt;&lt;br /&gt;
Debug.SetSubFunction( &#039;&#039;&#039;subfuctionname&#039;&#039;&#039; )&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;subfunctionname&#039;&#039;&#039; is a string that will show up in the &#039;&#039;debug.Print&#039;&#039; this diesnt affect &#039;&#039;&#039;functionname&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
now when u wana print debugging info u would use&amp;lt;br&amp;gt;&lt;br /&gt;
Debug.Print( &#039;&#039;&#039;message&#039;&#039;&#039; , &#039;&#039;&#039;vars...&#039;&#039;&#039; )&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;message&#039;&#039;&#039; is a string that can be anything u want&lt;br /&gt;
&#039;&#039;&#039;vars&#039;&#039;&#039; are a list of variables seperated by a , &#039;&#039;they can be of any type whitout giving an error&#039;&#039;&lt;br /&gt;
&#039;&#039;Debug.Print()&#039;&#039; also print the time in ms (if timwer was started)&lt;br /&gt;
&lt;br /&gt;
other Debug.funcions / variables&lt;br /&gt;
Debug.TimerStart( &#039;&#039;&#039;timeroffset&#039;&#039;&#039; )&amp;lt;br&amp;gt;&lt;br /&gt;
this works like true,&#039;&#039;&#039;timeroffset&#039;&#039;&#039; in &#039;&#039;Debug.SetFunction()&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
it stats the timer whit an starting offset of &#039;&#039;&#039;timeroffset&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*Debug.TimerGet()&amp;lt;br&amp;gt;&lt;br /&gt;
:this will print out the timer aswel as the &#039;&#039;other stuff&#039;&#039; as decribed in &#039;&#039;Debug.Print()&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*Debug.Starttime = &amp;lt;br&amp;gt;&lt;br /&gt;
:the gametime in ms at witch the timer was started&lt;br /&gt;
&lt;br /&gt;
:*Debug.Function = &amp;lt;br&amp;gt;&lt;br /&gt;
:the &#039;&#039;&#039;functionname&#039;&#039;&#039; as set by &#039;&#039;Debug.SetFunction&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*Debug.SubFunction = &amp;lt;br&amp;gt;&lt;br /&gt;
:the &#039;&#039;&#039;subfunctionname&#039;&#039;&#039; as set by &#039;&#039;Debug.SetSubFunction&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*Debug.Version = &amp;lt;br&amp;gt;&lt;br /&gt;
:the version of [http://home.zonnet.nl/westhof99/lua/DebugLib.lua DebugLib.lua]&lt;br /&gt;
&lt;br /&gt;
[http://home.zonnet.nl/westhof99/lua/DebugLib.lua DebugLib] has the abilety to simpely disable all debug by including [http://home.zonnet.nl/westhof99/lua/DebugLibDisabled.lua DebugLibDisabled.lua]. this has the same function only they dont do anything&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=User:%3DFF%3Dim2good4u&amp;diff=2089</id>
		<title>User:=FF=im2good4u</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=User:%3DFF%3Dim2good4u&amp;diff=2089"/>
		<updated>2006-03-07T09:37:53Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: page style fixes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;table witdh=100% height=100&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td width=400 align=center valign=center&amp;gt;http://news.bbc.co.uk/olmedia/1750000/images/_1752807_wolfen-activi150.jpg&amp;lt;/td&amp;gt;&amp;lt;td width=100% align=left valign=center&amp;gt;&lt;br /&gt;
== Contact ==&lt;br /&gt;
* &#039;&#039;&#039;Clan Homepage&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;[http://www.ffclan.net www.ffclan.net]&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Email&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;Hidden&lt;br /&gt;
* &#039;&#039;&#039;[[IRC]]&#039;&#039;&#039;&lt;br /&gt;
**&#039;&#039;#etpro&#039;&#039; - [[ETPro]] channel on freenode&amp;lt;br&amp;gt;[[irc://irc.freenode.net:6667/etpro]]&lt;br /&gt;
**&#039;&#039;#etpro&#039;&#039; - [[ETPro]] support channel on quakenet&amp;lt;br&amp;gt;[[irc://irc.quakenet.org:6667/etpro]]&lt;br /&gt;
**&#039;&#039;#=FF=Clan&#039;&#039; - [http://www.ffclan.net =FF=Clan] Clan channel on quakenet&amp;lt;br&amp;gt;[[irc://irc.quakenet.org:6667/=FF=Clan]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==ETPro/Lua libraries, modules and examples==&lt;br /&gt;
;Follow the link to the source code for more detailed information about each item.&lt;br /&gt;
&lt;br /&gt;
*[http://home.zonnet.nl/westhof99/lua/noweapon.lua nowepaon.lua] &#039;&#039;disables all weapon exept engineer tool and knife&#039;&amp;quot;&lt;br /&gt;
: just instal it and it works&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*[http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.lua ETProStuffPlug.lua] &#039;&#039;one lua mod to rules them all !&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.lua ETProStuffPlug] offers the following functions/commands:&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;etprostuffplug&#039;&#039;&#039; - C/S - Shows some info about ETProStuffPlug&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;cheaterdump&#039;&#039;&#039; &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; &#039;&#039;&amp;lt;file&amp;gt;&#039;&#039; - S - Will dump the IAC output code for &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; to &#039;&#039;&amp;lt;file&amp;gt;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;dumpuserid&#039;&#039;&#039; &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; - S - Will dump the userinfo of &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; instead of using a playername&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;iplist&#039;&#039;&#039; - S/C* - Prints out players whit thier ip&#039;s (handy for semiadmins)&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;statuslist&#039;&#039;&#039; - S/C* - Prints a players his abilties like Referee* , Schoutcaster* , Semiadmin*#*&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;referee&#039;&#039;&#039; / &#039;&#039;&#039;unreferee&#039;&#039;&#039; &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; - S - gives / removes referee status of &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;shoutcast&#039;&#039;&#039; / &#039;&#039;&#039;unshoutcast&#039;&#039;&#039; &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; - S - gives / removes shoutcast status of &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;semiadmin&#039;&#039;&#039; / &#039;&#039;&#039;unsemiadmin&#039;&#039;&#039; &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; &#039;&#039;&amp;lt;level&amp;gt;&#039;&#039; &#039;hidden&#039; - S - gives / removes semiadmin status of &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039;, the &#039;hidden&#039; paramter is optionaly to make the login not broadcast the logged in message&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;semiadminenable&#039;&#039;&#039; / &#039;&#039;&#039;semiadmindisable&#039;&#039;&#039; - S - enables or diesables the client semiadmin,sa,semiadminlogin,sal commands&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;revereeenable&#039;&#039;&#039; / &#039;&#039;&#039;revereedisable&#039;&#039;&#039; - S - enables or diesables the client ref command&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;semiadminlogout&#039;&#039;&#039; / &#039;&#039;&#039;salo&#039;&#039;&#039; - C - will log u out of semiadmin (handy if u let someone else play ay your pc&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;semiadminlogin&#039;&#039;&#039; / &#039;&#039;&#039;sal&#039;&#039;&#039; &#039;&#039;&amp;lt;password&amp;gt;&#039;&#039; &#039;hidden&#039;* - C - new optional parameter to login whitout the broadcast message&lt;br /&gt;
:*&#039;&#039;&#039;say&#039;&#039;&#039; / &#039;&#039;&#039;say_team&#039;&#039;&#039; / &#039;&#039;&#039;say_buddy&#039;&#039;&#039; / &#039;&#039;&#039;say_teamnl&#039;&#039;&#039; &#039;&#039;&amp;lt;message&amp;gt;&#039;&#039;* - C - new abilety type the %parameter and it gets repalced by your value, parameters are: %slot,%me,%health,%class,%team,%weapon,%altweapon,%respawnclass,%respawnweapon,%respawnaltweapon,%status&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;say_normal&#039;&#039;&#039; / &#039;&#039;&#039;say_team_normal&#039;&#039;&#039; / &#039;&#039;&#039;say_buddy_normal&#039;&#039;&#039; / &#039;&#039;&#039;say_teamnl_normal&#039;&#039;&#039; &#039;&#039;&amp;lt;message&amp;gt;&#039;&#039; - C - says &#039;&#039;&amp;lt;message&amp;gt;&#039;&#039; whitout advanced chat moddifications&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the items marked whit a * can be turned on or off by the configfile&lt;br /&gt;
[http://home.zonnet.nl/westhof99/lua/ETProStuffPlugConfig.cfg ETProStuffPlugConfig.cfg]&lt;br /&gt;
&lt;br /&gt;
to instal [http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.lua ETProStuffPlug.lua] simpely dl http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.zip ETProStuffPlug.zip] and unzip it in your /[[ETPro]]/ directory.&amp;lt;br&amp;gt; &lt;br /&gt;
Then add [http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.lua ETProStuffPlug.lua] to your lua_modules &amp;quot;&amp;quot; cvar&amp;lt;br&amp;gt;&lt;br /&gt;
also u might first wana config your [http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.lua ETProStuffPlug.lua] by editing your [http://home.zonnet.nl/westhof99/lua/ETProStuffPlugConfig.cfg ETProStuffPlugConfig.cfg]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTICE! [http://www.collectivecomputing.com/~reed/et/lua/etconst.lua etconst.lua] is required&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*[http://home.zonnet.nl/westhof99/lua/VarPrint.lua VarPrint.lua] A simple function that converts varialbes into strings so u can even print nils,booleans,functions and tables whitout getting an error&lt;br /&gt;
&#039;&#039;useage:&#039;&#039; &#039;&#039;&#039;string&#039;&#039;&#039; = VarPrint( &#039;&#039;&#039;(variable)&#039;&#039;&#039; )&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*[http://home.zonnet.nl/westhof99/lua/DebugLib.lua DebugLib.lua] A lua library that provides a special a debug print function. that can automagicly print the function - sub function - executing time - a message - and any variable u want (so even tables , functions , nils or true / false.&lt;br /&gt;
to implent http://home.zonnet.nl/westhof99/lua/DebugLib.lua DebugLib.lua] use &#039;&#039;&#039;require(&#039;DebugLib&#039;)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
then at the start of function do&amp;lt;br&amp;gt; &lt;br /&gt;
Debug.SetFunction(  &#039;&#039;&#039;fuctionname&#039;&#039;&#039;&#039;, &#039;&#039;&#039;true/false&#039;&#039;&#039;, &#039;&#039;&#039;timeroffset&#039;&#039;&#039;)&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;functionname&#039;&#039;&#039; is a string that will show up in the &#039;&#039;debug.Print&#039;&#039; this does not affect &#039;&#039;&#039;subfunctionname&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;true/false&#039;&#039;&#039; will start the timer or leave it at 0 &#039;&#039;this paremeter can de ignored&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;timeroffset&#039;&#039;&#039; this is the offset at witch the timer willstart &#039;&#039;this paremeter can de ignored&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
now when u enter special section if your code u can use&amp;lt;br&amp;gt;&lt;br /&gt;
Debug.SetSubFunction( &#039;&#039;&#039;subfuctionname&#039;&#039;&#039; )&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;subfunctionname&#039;&#039;&#039; is a string that will show up in the &#039;&#039;debug.Print&#039;&#039; this diesnt affect &#039;&#039;&#039;functionname&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
now when u wana print debugging info u would use&amp;lt;br&amp;gt;&lt;br /&gt;
Debug.Print( &#039;&#039;&#039;message&#039;&#039;&#039; , &#039;&#039;&#039;vars...&#039;&#039;&#039; )&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;message&#039;&#039;&#039; is a string that can be anything u want&lt;br /&gt;
&#039;&#039;&#039;vars&#039;&#039;&#039; are a list of variables seperated by a , &#039;&#039;they can be of any type whitout giving an error&#039;&#039;&lt;br /&gt;
&#039;&#039;Debug.Print()&#039;&#039; also print the time in ms (if timwer was started)&lt;br /&gt;
&lt;br /&gt;
other Debug.funcions / variables&lt;br /&gt;
Debug.TimerStart( &#039;&#039;&#039;timeroffset&#039;&#039;&#039; )&amp;lt;br&amp;gt;&lt;br /&gt;
this works like true,&#039;&#039;&#039;timeroffset&#039;&#039;&#039; in &#039;&#039;Debug.SetFunction()&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
it stats the timer whit an starting offset of &#039;&#039;&#039;timeroffset&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*Debug.TimerGet()&amp;lt;br&amp;gt;&lt;br /&gt;
:this will print out the timer aswel as the &#039;&#039;other stuff&#039;&#039; as decribed in &#039;&#039;Debug.Print()&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*Debug.Starttime = &amp;lt;br&amp;gt;&lt;br /&gt;
:the gametime in ms at witch the timer was started&lt;br /&gt;
&lt;br /&gt;
:*Debug.Function = &amp;lt;br&amp;gt;&lt;br /&gt;
:the &#039;&#039;&#039;functionname&#039;&#039;&#039; as set by &#039;&#039;Debug.SetFunction&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*Debug.SubFunction = &amp;lt;br&amp;gt;&lt;br /&gt;
:the &#039;&#039;&#039;subfunctionname&#039;&#039;&#039; as set by &#039;&#039;Debug.SetSubFunction&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*Debug.Version = &amp;lt;br&amp;gt;&lt;br /&gt;
:the version of [http://home.zonnet.nl/westhof99/lua/DebugLib.lua DebugLib.lua]&lt;br /&gt;
&lt;br /&gt;
[http://home.zonnet.nl/westhof99/lua/DebugLib.lua DebugLib] has the abilety to simpely disable all debug by including [http://home.zonnet.nl/westhof99/lua/DebugLibDisabled.lua DebugLibDisabled.lua]. this has the same function only they dont do anything&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=User:%3DFF%3Dim2good4u&amp;diff=2088</id>
		<title>User:=FF=im2good4u</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=User:%3DFF%3Dim2good4u&amp;diff=2088"/>
		<updated>2006-03-07T09:36:44Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: added noweapon.lua&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;table witdh=100% height=100&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td width=400 align=center valign=center&amp;gt;http://news.bbc.co.uk/olmedia/1750000/images/_1752807_wolfen-activi150.jpg&amp;lt;/td&amp;gt;&amp;lt;td width=100% align=left valign=center&amp;gt;&lt;br /&gt;
== Contact ==&lt;br /&gt;
* &#039;&#039;&#039;Clan Homepage&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;[http://www.ffclan.net www.ffclan.net]&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Email&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;Hidden&lt;br /&gt;
* &#039;&#039;&#039;[[IRC]]&#039;&#039;&#039;&lt;br /&gt;
**&#039;&#039;#etpro&#039;&#039; - [[ETPro]] channel on freenode&amp;lt;br&amp;gt;[[irc://irc.freenode.net:6667/etpro]]&lt;br /&gt;
**&#039;&#039;#etpro&#039;&#039; - [[ETPro]] support channel on quakenet&amp;lt;br&amp;gt;[[irc://irc.quakenet.org:6667/etpro]]&lt;br /&gt;
**&#039;&#039;#=FF=Clan&#039;&#039; - [http://www.ffclan.net =FF=Clan] Clan channel on quakenet&amp;lt;br&amp;gt;[[irc://irc.quakenet.org:6667/=FF=Clan]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==ETPro/Lua libraries, modules and examples==&lt;br /&gt;
;Follow the link to the source code for more detailed information about each item.&lt;br /&gt;
&lt;br /&gt;
*[http://home.zonnet.nl/westhof99/lua/noweapon.lua nowepaon.lua] &#039;&#039;disables all weapon exept engineer tool and knife&#039;&amp;quot;&lt;br /&gt;
: just instal it and it works&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*[http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.lua ETProStuffPlug.lua] &#039;&#039;one lua mod to rules them all !&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.lua ETProStuffPlug] offers the following functions/commands:&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;etprostuffplug&#039;&#039;&#039; - C/S - Shows some info about ETProStuffPlug&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;cheaterdump&#039;&#039;&#039; &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; &#039;&#039;&amp;lt;file&amp;gt;&#039;&#039; - S - Will dump the IAC output code for &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; to &#039;&#039;&amp;lt;file&amp;gt;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;dumpuserid&#039;&#039;&#039; &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; - S - Will dump the userinfo of &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; instead of using a playername&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;iplist&#039;&#039;&#039; - S/C* - Prints out players whit thier ip&#039;s (handy for semiadmins)&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;statuslist&#039;&#039;&#039; - S/C* - Prints a players his abilties like Referee* , Schoutcaster* , Semiadmin*#*&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;referee&#039;&#039;&#039; / &#039;&#039;&#039;unreferee&#039;&#039;&#039; &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; - S - gives / removes referee status of &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;shoutcast&#039;&#039;&#039; / &#039;&#039;&#039;unshoutcast&#039;&#039;&#039; &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; - S - gives / removes shoutcast status of &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;semiadmin&#039;&#039;&#039; / &#039;&#039;&#039;unsemiadmin&#039;&#039;&#039; &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039; &#039;&#039;&amp;lt;level&amp;gt;&#039;&#039; &#039;hidden&#039; - S - gives / removes semiadmin status of &#039;&#039;&amp;lt;player id&amp;gt;&#039;&#039;, the &#039;hidden&#039; paramter is optionaly to make the login not broadcast the logged in message&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;semiadminenable&#039;&#039;&#039; / &#039;&#039;&#039;semiadmindisable&#039;&#039;&#039; - S - enables or diesables the client semiadmin,sa,semiadminlogin,sal commands&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;revereeenable&#039;&#039;&#039; / &#039;&#039;&#039;revereedisable&#039;&#039;&#039; - S - enables or diesables the client ref command&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;semiadminlogout&#039;&#039;&#039; / &#039;&#039;&#039;salo&#039;&#039;&#039; - C - will log u out of semiadmin (handy if u let someone else play ay your pc&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;semiadminlogin&#039;&#039;&#039; / &#039;&#039;&#039;sal&#039;&#039;&#039; &#039;&#039;&amp;lt;password&amp;gt;&#039;&#039; &#039;hidden&#039;* - C - new optional parameter to login whitout the broadcast message&lt;br /&gt;
:*&#039;&#039;&#039;say&#039;&#039;&#039; / &#039;&#039;&#039;say_team&#039;&#039;&#039; / &#039;&#039;&#039;say_buddy&#039;&#039;&#039; / &#039;&#039;&#039;say_teamnl&#039;&#039;&#039; &#039;&#039;&amp;lt;message&amp;gt;&#039;&#039;* - C - new abilety type the %parameter and it gets repalced by your value, parameters are: %slot,%me,%health,%class,%team,%weapon,%altweapon,%respawnclass,%respawnweapon,%respawnaltweapon,%status&amp;lt;br&amp;gt;&lt;br /&gt;
:*&#039;&#039;&#039;say_normal&#039;&#039;&#039; / &#039;&#039;&#039;say_team_normal&#039;&#039;&#039; / &#039;&#039;&#039;say_buddy_normal&#039;&#039;&#039; / &#039;&#039;&#039;say_teamnl_normal&#039;&#039;&#039; &#039;&#039;&amp;lt;message&amp;gt;&#039;&#039; - C - says &#039;&#039;&amp;lt;message&amp;gt;&#039;&#039; whitout advanced chat moddifications&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the items marked whit a * can be turned on or off by the configfile&lt;br /&gt;
[http://home.zonnet.nl/westhof99/lua/ETProStuffPlugConfig.cfg ETProStuffPlugConfig.cfg]&lt;br /&gt;
&lt;br /&gt;
to instal [http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.lua ETProStuffPlug.lua] simpely dl http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.zip ETProStuffPlug.zip] and unzip it in your /[[ETPro]]/ directory.&amp;lt;br&amp;gt; &lt;br /&gt;
Then add [http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.lua ETProStuffPlug.lua] to your lua_modules &amp;quot;&amp;quot; cvar&amp;lt;br&amp;gt;&lt;br /&gt;
also u might first wana config your [http://home.zonnet.nl/westhof99/lua/ETProStuffPlug.lua ETProStuffPlug.lua] by editing your [http://home.zonnet.nl/westhof99/lua/ETProStuffPlugConfig.cfg ETProStuffPlugConfig.cfg]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTICE! [http://www.collectivecomputing.com/~reed/et/lua/etconst.lua etconst.lua] is required&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*[http://home.zonnet.nl/westhof99/lua/VarPrint.lua VarPrint.lua] A simple function that converts varialbes into strings so u can even print nils,booleans,functions and tables whitout getting an error&lt;br /&gt;
&#039;&#039;useage:&#039;&#039; &#039;&#039;&#039;string&#039;&#039;&#039; = VarPrint( &#039;&#039;&#039;(variable)&#039;&#039;&#039; )&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*[http://home.zonnet.nl/westhof99/lua/DebugLib.lua DebugLib.lua] A lua library that provides a special a debug print function. that can automagicly print the function - sub function - executing time - a message - and any variable u want (so even tables , functions , nils or true / false.&lt;br /&gt;
to implent http://home.zonnet.nl/westhof99/lua/DebugLib.lua DebugLib.lua] use &#039;&#039;&#039;require(&#039;DebugLib&#039;)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
then at the start of function do&amp;lt;br&amp;gt; &lt;br /&gt;
Debug.SetFunction(  &#039;&#039;&#039;fuctionname&#039;&#039;&#039;&#039;, &#039;&#039;&#039;true/false&#039;&#039;&#039;, &#039;&#039;&#039;timeroffset&#039;&#039;&#039;)&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;functionname&#039;&#039;&#039; is a string that will show up in the &#039;&#039;debug.Print&#039;&#039; this does not affect &#039;&#039;&#039;subfunctionname&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;true/false&#039;&#039;&#039; will start the timer or leave it at 0 &#039;&#039;this paremeter can de ignored&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;timeroffset&#039;&#039;&#039; this is the offset at witch the timer willstart &#039;&#039;this paremeter can de ignored&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
now when u enter special section if your code u can use&amp;lt;br&amp;gt;&lt;br /&gt;
Debug.SetSubFunction( &#039;&#039;&#039;subfuctionname&#039;&#039;&#039; )&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;subfunctionname&#039;&#039;&#039; is a string that will show up in the &#039;&#039;debug.Print&#039;&#039; this diesnt affect &#039;&#039;&#039;functionname&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
now when u wana print debugging info u would use&amp;lt;br&amp;gt;&lt;br /&gt;
Debug.Print( &#039;&#039;&#039;message&#039;&#039;&#039; , &#039;&#039;&#039;vars...&#039;&#039;&#039; )&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;message&#039;&#039;&#039; is a string that can be anything u want&lt;br /&gt;
&#039;&#039;&#039;vars&#039;&#039;&#039; are a list of variables seperated by a , &#039;&#039;they can be of any type whitout giving an error&#039;&#039;&lt;br /&gt;
&#039;&#039;Debug.Print()&#039;&#039; also print the time in ms (if timwer was started)&lt;br /&gt;
&lt;br /&gt;
other Debug.funcions / variables&lt;br /&gt;
Debug.TimerStart( &#039;&#039;&#039;timeroffset&#039;&#039;&#039; )&amp;lt;br&amp;gt;&lt;br /&gt;
this works like true,&#039;&#039;&#039;timeroffset&#039;&#039;&#039; in &#039;&#039;Debug.SetFunction()&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
it stats the timer whit an starting offset of &#039;&#039;&#039;timeroffset&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*Debug.TimerGet()&amp;lt;br&amp;gt;&lt;br /&gt;
this will print out the timer aswel as the &#039;&#039;other stuff&#039;&#039; as decribed in &#039;&#039;Debug.Print()&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*Debug.Starttime = &amp;lt;br&amp;gt;&lt;br /&gt;
the gametime in ms at witch the timer was started&lt;br /&gt;
&lt;br /&gt;
:*Debug.Function = &amp;lt;br&amp;gt;&lt;br /&gt;
the &#039;&#039;&#039;functionname&#039;&#039;&#039; as set by &#039;&#039;Debug.SetFunction&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*Debug.SubFunction = &amp;lt;br&amp;gt;&lt;br /&gt;
the &#039;&#039;&#039;subfunctionname&#039;&#039;&#039; as set by &#039;&#039;Debug.SetSubFunction&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*Debug.Version = &amp;lt;br&amp;gt;&lt;br /&gt;
the version of [http://home.zonnet.nl/westhof99/lua/DebugLib.lua DebugLib.lua]&lt;br /&gt;
&lt;br /&gt;
[http://home.zonnet.nl/westhof99/lua/DebugLib.lua DebugLib] has the abilety to simpely disable all debug by including [http://home.zonnet.nl/westhof99/lua/DebugLibDisabled.lua DebugLibDisabled.lua]. this has the same function only they dont do anything&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Etdamage&amp;diff=2087</id>
		<title>Etdamage</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Etdamage&amp;diff=2087"/>
		<updated>2006-03-07T09:31:17Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: added catorgry&amp;#039;s&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;comming soon.&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2086</id>
		<title>Fieldname</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2086"/>
		<updated>2006-03-07T09:26:46Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: snapshot 3 fields&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;List of fields supported by [[ETPro:Lua Mod API#entities|et.gentity_get() and et.gentity_set()]] functions&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;field;type;access&amp;quot; widths=&amp;quot;180;120;60&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
activator;entity;RO;&lt;br /&gt;
chain;entity;RW;&lt;br /&gt;
classname;string;RW;&lt;br /&gt;
client.inactivityTime;integer;RW;&lt;br /&gt;
client.inactivityWarning;qboolean;RW;&lt;br /&gt;
clipmask;integer;?;&lt;br /&gt;
closespeed;float;RW;&lt;br /&gt;
count;integer;RW;&lt;br /&gt;
count2;integer;RW;&lt;br /&gt;
damage;integer;RW;&lt;br /&gt;
deathType;meansOfDeath_t;RW;&lt;br /&gt;
delay;float;RW;&lt;br /&gt;
dl_atten;integer;RW;&lt;br /&gt;
dl_color;vec3;RW;&lt;br /&gt;
dl_shader;string;RO;&lt;br /&gt;
dl_stylestring;string;RO;&lt;br /&gt;
duration;float;RW;&lt;br /&gt;
end_size;integer;RW;&lt;br /&gt;
enemy;entity;RW;&lt;br /&gt;
flags;bitflag;RO;&lt;br /&gt;
harc;float;RW;&lt;br /&gt;
health;integer;RW;&lt;br /&gt;
inuse;qboolean;RO;&lt;br /&gt;
isProp;qboolean;RO;&lt;br /&gt;
item;string;RW;&lt;br /&gt;
key;integer;RW;&lt;br /&gt;
message;string;RW;&lt;br /&gt;
methodOfDeath;integer;RW;&lt;br /&gt;
mg42BaseEnt;integer;RW;&lt;br /&gt;
missionLevel;integer;RW;&lt;br /&gt;
model;string;RO;&lt;br /&gt;
model2;string;RO;&lt;br /&gt;
nextTrain;entity;RW;&lt;br /&gt;
noise_index;integer;RW;&lt;br /&gt;
origin;vec3;RW;&lt;br /&gt;
pers.connected;connected_t;?;&lt;br /&gt;
pers.netname;string;?;&lt;br /&gt;
pers.localClient;qboolean;?;&lt;br /&gt;
pers.initialSpawn;qboolean;?; &lt;br /&gt;
pers.enterTime;integer;?;&lt;br /&gt;
pers.connectTime;integer;?; &lt;br /&gt;
pers.teamState.state;teamstatestate_t;?;&lt;br /&gt;
pers.voteCount;integer;?;&lt;br /&gt;
pers.teamVoteCount;integer;?; &lt;br /&gt;
pers.complaints;integer;?; &lt;br /&gt;
pers.complaintClient;integer;?; &lt;br /&gt;
pers.complaintEndTime;integer;?; &lt;br /&gt;
pers.lastReinforceTime;integer;?; &lt;br /&gt;
pers.applicationClient;integer;?; &lt;br /&gt;
pers.applicationEndTime;integer;?; &lt;br /&gt;
pers.invitationClient;integer;?; &lt;br /&gt;
pers.invitationEndTime;integer;?; &lt;br /&gt;
pers.propositionClient;integer;?; &lt;br /&gt;
pers.propositionClient2;integer;?; &lt;br /&gt;
pers.propositionEndTime;integer;?; &lt;br /&gt;
pers.autofireteamEndTime;integer;?; &lt;br /&gt;
pers.autofireteamCreateEndTime;integer;?; &lt;br /&gt;
pers.autofireteamJoinEndTime;integer;?; &lt;br /&gt;
pers.lastSpawnTime;integer;?;&lt;br /&gt;
pers.ready;qboolean;?;&lt;br /&gt;
prevTrain;entity;RW;&lt;br /&gt;
props_frame_state;integer;RO;&lt;br /&gt;
ps.stats;integer array;RW; &lt;br /&gt;
ps.persistant;integer array;RW;&lt;br /&gt;
ps.ping;integer;?;&lt;br /&gt;
ps.powerups;integer array;RW;&lt;br /&gt;
ps.ammo;integer array;RW; &lt;br /&gt;
ps.ammoclip;integer array;RW;&lt;br /&gt;
r.absmax;vec3;RO;&lt;br /&gt;
r.absmin;vec3;RO;&lt;br /&gt;
r.bmodel;qboolean;RO;&lt;br /&gt;
r.contents;integer;RW;&lt;br /&gt;
r.currentAngles;vec3;RW;&lt;br /&gt;
r.currentOrigin;vec3;RW;&lt;br /&gt;
r.eventTime;integer;RW;&lt;br /&gt;
r.linkcount;integer;RO;&lt;br /&gt;
r.linked;qboolean;RO;&lt;br /&gt;
r.maxs;vec3;RW;&lt;br /&gt;
r.mins;vec3;RW;&lt;br /&gt;
r.ownerNum;integer;RW;&lt;br /&gt;
r.singleClient;integer;RW;&lt;br /&gt;
r.svFlags;integer;RW;&lt;br /&gt;
r.worldflags;integer;RO;&lt;br /&gt;
radius;integer;RW;&lt;br /&gt;
random;float;RW;&lt;br /&gt;
rotate;vec3;RW;&lt;br /&gt;
s.angles;vec3;RW;&lt;br /&gt;
s.angles2;vec3;RW;&lt;br /&gt;
s.apos;trajectory;RW;&lt;br /&gt;
s.clientNum;integer;RW;&lt;br /&gt;
s.constantLight;integer;RW;&lt;br /&gt;
s.density;integer;RW;&lt;br /&gt;
s.dl_intensity;integer;RW;&lt;br /&gt;
s.dmgFlags;integer;RW;&lt;br /&gt;
s.eFlags;integer;RW;&lt;br /&gt;
s.eType;integer;?;&lt;br /&gt;
s.effect1Time;integer;RW;&lt;br /&gt;
s.effect2Time;integer;RW;&lt;br /&gt;
s.effect3Time;integer;RW;&lt;br /&gt;
s.frame;integer;RW;&lt;br /&gt;
s.groundEntityNum;integer;RO;&lt;br /&gt;
s.loopSound;integer;RW;&lt;br /&gt;
s.modelindex;integer;RW;&lt;br /&gt;
s.modelindex2;integer;RW;&lt;br /&gt;
s.number;integer;RO;&lt;br /&gt;
s.onFireEnd;integer;RW;&lt;br /&gt;
s.onFireStart;integer;RW;&lt;br /&gt;
s.origin;vec3;?;&lt;br /&gt;
s.origin2;vec3;?;&lt;br /&gt;
s.pos;trajectory;RW;&lt;br /&gt;
s.powerups;integer;RO;&lt;br /&gt;
s.solid;integer;RW;&lt;br /&gt;
s.teamNum;integer;RW;&lt;br /&gt;
s.time;integer;RW;&lt;br /&gt;
s.time2;integer;RW;&lt;br /&gt;
s.weapon;integer;RO;&lt;br /&gt;
scriptName;string;RO;&lt;br /&gt;
sess.sessionTeam;team_t;RW;&lt;br /&gt;
sess.spectatorTime;integer;RW;&lt;br /&gt;
sess.spectatorState;spectatorState_t;RW;&lt;br /&gt;
sess.spectatorClient;integer;RW;&lt;br /&gt;
sess.latchSpectatorClient;integer;RW;&lt;br /&gt;
sess.playerType;integer;RW;&lt;br /&gt;
sess.playerWeapon;integer;RW;&lt;br /&gt;
sess.playerWeapon2;integer;RW;&lt;br /&gt;
sess.spawnObjectiveIndex;integer;RW;&lt;br /&gt;
sess.latchPlayerType;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon2;integer;RW;&lt;br /&gt;
sess.damage_given;integer;RW;&lt;br /&gt;
sess.damage_received;integer;RW;&lt;br /&gt;
sess.deaths;integer;RW;&lt;br /&gt;
sess.game_points;integer;RW;&lt;br /&gt;
sess.gibs;integer;RW;&lt;br /&gt;
sess.kills;integer;RW;&lt;br /&gt;
sess.medals;integer array;RW;&lt;br /&gt;
sess.muted;qboolean;RW;&lt;br /&gt;
sess.rank;integer;RW;&lt;br /&gt;
sess.referee;integer;RW;&lt;br /&gt;
sess.rounds;integer;RW;&lt;br /&gt;
sess.semiadmin;integer;RW;&lt;br /&gt;
sess.skill;integer array;RW;&lt;br /&gt;
sess.spec_invite;integer;RW;&lt;br /&gt;
sess.spec_team;integer;RW;&lt;br /&gt;
sess.suicides;integer;RW;&lt;br /&gt;
sess.team_damage;integer;RW;&lt;br /&gt;
sess.team_kills;integer;RW;&lt;br /&gt;
sess.team_received;integer;RW;&lt;br /&gt;
sess.aWeaponStats;weapon_stat_t;RW;&lt;br /&gt;
spawnflags;integer;RO;&lt;br /&gt;
spawnitem;string;RO;&lt;br /&gt;
speed;float;RW;&lt;br /&gt;
splashDamage;integer;RW;&lt;br /&gt;
splashMethodOfDeath;integer;RW;&lt;br /&gt;
splashRadius;integer;RW;&lt;br /&gt;
start_size;integer;RW;&lt;br /&gt;
tagName;string;RO;&lt;br /&gt;
tagParent;entity;RW;&lt;br /&gt;
takedamage;boolean;RW;&lt;br /&gt;
tankLink;entity;RW;&lt;br /&gt;
target;string;RW;&lt;br /&gt;
TargetAngles;vec3;RW;&lt;br /&gt;
TargetFlag;integer;RO;&lt;br /&gt;
targetname;string;RO;&lt;br /&gt;
teamchain;entity;RW;&lt;br /&gt;
teammaster;entity;RW;&lt;br /&gt;
track;string;RO;&lt;br /&gt;
varc;float;RW;&lt;br /&gt;
wait;float;RW;&lt;br /&gt;
waterlevel;integer;RO;&lt;br /&gt;
watertype;integer;RO;&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
:&#039;&#039;note&#039;&#039;: all the sess.* fields will return nil unless the entity is associated with client slot &amp;lt; sv_maxclients.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ET variable types&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;vec3&#039;&#039;&#039;: a &#039;&#039;&#039;vec3&#039;&#039;&#039; is a 3-element array of numbers (C definition: &amp;lt;tt&amp;gt;typedef float vec3_t[3];&lt;br /&gt;
&amp;lt;/tt&amp;gt;). It is usually used to store and process coordinates in 3D space.&amp;lt;br&amp;gt;&lt;br /&gt;
In etpro-lua a vector is an array (table indexed by integers) containing 3 numbers. It can be accessed by&lt;br /&gt;
doing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
origin = et.gentity_get(entNum,&amp;quot;r.currentOrigin&amp;quot;) --a vec3 value&lt;br /&gt;
x,y,z = origin[1],origin[2],origin[3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;trajectory&#039;&#039;&#039;: a &#039;&#039;&#039;trajectory&#039;&#039;&#039; is returned as a lua table described below&lt;br /&gt;
 {&lt;br /&gt;
  trDuration = &amp;lt;number&amp;gt;, --- int&lt;br /&gt;
  trTime = &amp;lt;number&amp;gt;, -- int&lt;br /&gt;
  trType = &amp;lt;number&amp;gt;, -- see below for allowed values&lt;br /&gt;
  trBase { -- this is a vec3, as described above&lt;br /&gt;
    [1] = &amp;lt;number&amp;gt;&lt;br /&gt;
    [2] = &amp;lt;number&amp;gt;&lt;br /&gt;
    [3] = &amp;lt;number&amp;gt;&lt;br /&gt;
  },&lt;br /&gt;
  trDelta { -- also a vec3&lt;br /&gt;
   [1] = &amp;lt;number&amp;gt;&lt;br /&gt;
   [2] = &amp;lt;number&amp;gt;&lt;br /&gt;
   [3] = &amp;lt;number&amp;gt;&lt;br /&gt;
  },&lt;br /&gt;
 }&lt;br /&gt;
: the allowed values for trType (along with the enum names and original comments from the ET source), are as follows. Note &lt;br /&gt;
: that not all values make sense for all entity types &amp;lt;tt&amp;gt;&lt;br /&gt;
&amp;lt;ol start=0&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_STATIONARY&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_INTERPOLATE	// non-parametric, but interpolate between snapshots&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; TR_LINEAR&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_LINEAR_STOP&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_LINEAR_STOP_BACK //----(SA) added.  so reverse movement can be different than forward&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_SINE // value = base + sin( time / duration ) * delta&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY_LOW&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY_FLOAT // super low grav with no gravity acceleration (floating feathers/fabric/leaves/...)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY_PAUSED //----(SA) has stopped, but will still do a short trace to see if it should be switched back to TR_GRAVITY&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_ACCELERATE&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_DECCELERATE&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_SPLINE&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_LINEAR_PATH&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;entity&#039;&#039;&#039;: The fields listed as having type &#039;&#039;&#039;enitity&#039;&#039;&#039; return an entity number or nil. Entity numbers are integers from 0 through 1023. Some of the entity numbers have special meanings:&lt;br /&gt;
** 0 - (sv_privateclients - 1) are reserved for clients who connect with the private slot password&lt;br /&gt;
** 0 - 63 are reserved for clients. A client&#039;s entity number is also its client number (as shown by /players for example)&lt;br /&gt;
** 1022 is the &#039;&#039;&#039;worldspawn&#039;&#039;&#039; entity&lt;br /&gt;
** 1023 is &#039;&#039;&#039;ENTITYNUM_NONE&#039;&#039;&#039; which is used instead of null in C under some circumstances to indicate no entity. This is needed where an entity number will be passed over the network.&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some other fields not listed as type &#039;entity&#039; may take an entity number value. &#039;&#039;&#039;mg42BaseEnt&#039;&#039;&#039; and &#039;&#039;&#039;s.number&#039;&#039;&#039; are examples.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2085</id>
		<title>Fieldname</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2085"/>
		<updated>2006-03-07T09:19:45Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: snapshot 2 feilds&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;List of fields supported by [[ETPro:Lua Mod API#entities|et.gentity_get() and et.gentity_set()]] functions&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;field;type;access&amp;quot; widths=&amp;quot;180;120;60&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
activator;entity;RO;&lt;br /&gt;
chain;entity;RW;&lt;br /&gt;
classname;string;RW;&lt;br /&gt;
clipmask;integer;?;&lt;br /&gt;
closespeed;float;RW;&lt;br /&gt;
count;integer;RW;&lt;br /&gt;
count2;integer;RW;&lt;br /&gt;
damage;integer;RW;&lt;br /&gt;
deathType;meansOfDeath_t;RW;&lt;br /&gt;
delay;float;RW;&lt;br /&gt;
dl_atten;integer;RW;&lt;br /&gt;
dl_color;vec3;RW;&lt;br /&gt;
dl_shader;string;RO;&lt;br /&gt;
dl_stylestring;string;RO;&lt;br /&gt;
duration;float;RW;&lt;br /&gt;
end_size;integer;RW;&lt;br /&gt;
enemy;entity;RW;&lt;br /&gt;
flags;bitflag;RO;&lt;br /&gt;
harc;float;RW;&lt;br /&gt;
health;integer;RW;&lt;br /&gt;
inuse;qboolean;RO;&lt;br /&gt;
isProp;qboolean;RO;&lt;br /&gt;
item;string;RW;&lt;br /&gt;
key;integer;RW;&lt;br /&gt;
message;string;RW;&lt;br /&gt;
methodOfDeath;integer;RW;&lt;br /&gt;
mg42BaseEnt;integer;RW;&lt;br /&gt;
missionLevel;integer;RW;&lt;br /&gt;
model;string;RO;&lt;br /&gt;
model2;string;RO;&lt;br /&gt;
nextTrain;entity;RW;&lt;br /&gt;
noise_index;integer;RW;&lt;br /&gt;
origin;vec3;RW;&lt;br /&gt;
pers.connected;connected_t;?;&lt;br /&gt;
pers.netname;string;?;&lt;br /&gt;
pers.localClient;qboolean;?;&lt;br /&gt;
pers.initialSpawn;qboolean;?; &lt;br /&gt;
pers.enterTime;integer;?;&lt;br /&gt;
pers.connectTime;integer;?; &lt;br /&gt;
pers.teamState.state;teamstatestate_t;?;&lt;br /&gt;
pers.voteCount;integer;?;&lt;br /&gt;
pers.teamVoteCount;integer;?; &lt;br /&gt;
pers.complaints;integer;?; &lt;br /&gt;
pers.complaintClient;integer;?; &lt;br /&gt;
pers.complaintEndTime;integer;?; &lt;br /&gt;
pers.lastReinforceTime;integer;?; &lt;br /&gt;
pers.applicationClient;integer;?; &lt;br /&gt;
pers.applicationEndTime;integer;?; &lt;br /&gt;
pers.invitationClient;integer;?; &lt;br /&gt;
pers.invitationEndTime;integer;?; &lt;br /&gt;
pers.propositionClient;integer;?; &lt;br /&gt;
pers.propositionClient2;integer;?; &lt;br /&gt;
pers.propositionEndTime;integer;?; &lt;br /&gt;
pers.autofireteamEndTime;integer;?; &lt;br /&gt;
pers.autofireteamCreateEndTime;integer;?; &lt;br /&gt;
pers.autofireteamJoinEndTime;integer;?; &lt;br /&gt;
pers.lastSpawnTime;integer;?;&lt;br /&gt;
pers.ready;qboolean;?;&lt;br /&gt;
prevTrain;entity;RW;&lt;br /&gt;
props_frame_state;integer;RO;&lt;br /&gt;
ps.stats;integer array;RW; &lt;br /&gt;
ps.persistant;integer array;RW;&lt;br /&gt;
ps.ping;integer;?;&lt;br /&gt;
ps.powerups;integer array;RW;&lt;br /&gt;
ps.ammo;integer array;RW; &lt;br /&gt;
ps.ammoclip;integer array;RW;&lt;br /&gt;
r.absmax;vec3;RO;&lt;br /&gt;
r.absmin;vec3;RO;&lt;br /&gt;
r.bmodel;qboolean;RO;&lt;br /&gt;
r.contents;integer;RW;&lt;br /&gt;
r.currentAngles;vec3;RW;&lt;br /&gt;
r.currentOrigin;vec3;RW;&lt;br /&gt;
r.eventTime;integer;RW;&lt;br /&gt;
r.linkcount;integer;RO;&lt;br /&gt;
r.linked;qboolean;RO;&lt;br /&gt;
r.maxs;vec3;RW;&lt;br /&gt;
r.mins;vec3;RW;&lt;br /&gt;
r.ownerNum;integer;RW;&lt;br /&gt;
r.singleClient;integer;RW;&lt;br /&gt;
r.svFlags;integer;RW;&lt;br /&gt;
r.worldflags;integer;RO;&lt;br /&gt;
radius;integer;RW;&lt;br /&gt;
random;float;RW;&lt;br /&gt;
rotate;vec3;RW;&lt;br /&gt;
s.angles;vec3;RW;&lt;br /&gt;
s.angles2;vec3;RW;&lt;br /&gt;
s.apos;trajectory;RW;&lt;br /&gt;
s.clientNum;integer;RW;&lt;br /&gt;
s.constantLight;integer;RW;&lt;br /&gt;
s.density;integer;RW;&lt;br /&gt;
s.dl_intensity;integer;RW;&lt;br /&gt;
s.dmgFlags;integer;RW;&lt;br /&gt;
s.eFlags;integer;RW;&lt;br /&gt;
s.eType;integer;?;&lt;br /&gt;
s.effect1Time;integer;RW;&lt;br /&gt;
s.effect2Time;integer;RW;&lt;br /&gt;
s.effect3Time;integer;RW;&lt;br /&gt;
s.frame;integer;RW;&lt;br /&gt;
s.groundEntityNum;integer;RO;&lt;br /&gt;
s.loopSound;integer;RW;&lt;br /&gt;
s.modelindex;integer;RW;&lt;br /&gt;
s.modelindex2;integer;RW;&lt;br /&gt;
s.number;integer;RO;&lt;br /&gt;
s.onFireEnd;integer;RW;&lt;br /&gt;
s.onFireStart;integer;RW;&lt;br /&gt;
s.origin;vec3;?;&lt;br /&gt;
s.origin2;vec3;?;&lt;br /&gt;
s.pos;trajectory;RW;&lt;br /&gt;
s.powerups;integer;RO;&lt;br /&gt;
s.solid;integer;RW;&lt;br /&gt;
s.teamNum;integer;RW;&lt;br /&gt;
s.time;integer;RW;&lt;br /&gt;
s.time2;integer;RW;&lt;br /&gt;
s.weapon;integer;RO;&lt;br /&gt;
scriptName;string;RO;&lt;br /&gt;
sess.sessionTeam;team_t;RW;&lt;br /&gt;
sess.spectatorTime;integer;RW;&lt;br /&gt;
sess.spectatorState;spectatorState_t;RW;&lt;br /&gt;
sess.spectatorClient;integer;RW;&lt;br /&gt;
sess.latchSpectatorClient;integer;RW;&lt;br /&gt;
sess.playerType;integer;RW;&lt;br /&gt;
sess.playerWeapon;integer;RW;&lt;br /&gt;
sess.playerWeapon2;integer;RW;&lt;br /&gt;
sess.spawnObjectiveIndex;integer;RW;&lt;br /&gt;
sess.latchPlayerType;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon2;integer;RW;&lt;br /&gt;
sess.damage_given;integer;RW;&lt;br /&gt;
sess.damage_received;integer;RW;&lt;br /&gt;
sess.deaths;integer;RW;&lt;br /&gt;
sess.game_points;integer;RW;&lt;br /&gt;
sess.gibs;integer;RW;&lt;br /&gt;
sess.kills;integer;RW;&lt;br /&gt;
sess.muted;qboolean;RW;&lt;br /&gt;
sess.referee;integer;RW;&lt;br /&gt;
sess.rounds;integer;RW;&lt;br /&gt;
sess.semiadmin;integer;RW;&lt;br /&gt;
sess.spec_invite;integer;RW;&lt;br /&gt;
sess.spec_team;integer;RW;&lt;br /&gt;
sess.suicides;integer;RW;&lt;br /&gt;
sess.team_damage;integer;RW;&lt;br /&gt;
sess.team_kills;integer;RW;&lt;br /&gt;
sess.team_received;integer;RW;&lt;br /&gt;
sess.aWeaponStats;weapon_stat_t;RW;&lt;br /&gt;
spawnflags;integer;RO;&lt;br /&gt;
spawnitem;string;RO;&lt;br /&gt;
speed;float;RW;&lt;br /&gt;
splashDamage;integer;RW;&lt;br /&gt;
splashMethodOfDeath;integer;RW;&lt;br /&gt;
splashRadius;integer;RW;&lt;br /&gt;
start_size;integer;RW;&lt;br /&gt;
tagName;string;RO;&lt;br /&gt;
tagParent;entity;RW;&lt;br /&gt;
takedamage;boolean;RW;&lt;br /&gt;
tankLink;entity;RW;&lt;br /&gt;
target;string;RW;&lt;br /&gt;
TargetAngles;vec3;RW;&lt;br /&gt;
TargetFlag;integer;RO;&lt;br /&gt;
targetname;string;RO;&lt;br /&gt;
teamchain;entity;RW;&lt;br /&gt;
teammaster;entity;RW;&lt;br /&gt;
track;string;RO;&lt;br /&gt;
varc;float;RW;&lt;br /&gt;
wait;float;RW;&lt;br /&gt;
waterlevel;integer;RO;&lt;br /&gt;
watertype;integer;RO;&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
:&#039;&#039;note&#039;&#039;: all the sess.* fields will return nil unless the entity is associated with client slot &amp;lt; sv_maxclients.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ET variable types&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;vec3&#039;&#039;&#039;: a &#039;&#039;&#039;vec3&#039;&#039;&#039; is a 3-element array of numbers (C definition: &amp;lt;tt&amp;gt;typedef float vec3_t[3];&lt;br /&gt;
&amp;lt;/tt&amp;gt;). It is usually used to store and process coordinates in 3D space.&amp;lt;br&amp;gt;&lt;br /&gt;
In etpro-lua a vector is an array (table indexed by integers) containing 3 numbers. It can be accessed by&lt;br /&gt;
doing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
origin = et.gentity_get(entNum,&amp;quot;r.currentOrigin&amp;quot;) --a vec3 value&lt;br /&gt;
x,y,z = origin[1],origin[2],origin[3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;trajectory&#039;&#039;&#039;: a &#039;&#039;&#039;trajectory&#039;&#039;&#039; is returned as a lua table described below&lt;br /&gt;
 {&lt;br /&gt;
  trDuration = &amp;lt;number&amp;gt;, --- int&lt;br /&gt;
  trTime = &amp;lt;number&amp;gt;, -- int&lt;br /&gt;
  trType = &amp;lt;number&amp;gt;, -- see below for allowed values&lt;br /&gt;
  trBase { -- this is a vec3, as described above&lt;br /&gt;
    [1] = &amp;lt;number&amp;gt;&lt;br /&gt;
    [2] = &amp;lt;number&amp;gt;&lt;br /&gt;
    [3] = &amp;lt;number&amp;gt;&lt;br /&gt;
  },&lt;br /&gt;
  trDelta { -- also a vec3&lt;br /&gt;
   [1] = &amp;lt;number&amp;gt;&lt;br /&gt;
   [2] = &amp;lt;number&amp;gt;&lt;br /&gt;
   [3] = &amp;lt;number&amp;gt;&lt;br /&gt;
  },&lt;br /&gt;
 }&lt;br /&gt;
: the allowed values for trType (along with the enum names and original comments from the ET source), are as follows. Note &lt;br /&gt;
: that not all values make sense for all entity types &amp;lt;tt&amp;gt;&lt;br /&gt;
&amp;lt;ol start=0&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_STATIONARY&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_INTERPOLATE	// non-parametric, but interpolate between snapshots&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; TR_LINEAR&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_LINEAR_STOP&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_LINEAR_STOP_BACK //----(SA) added.  so reverse movement can be different than forward&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_SINE // value = base + sin( time / duration ) * delta&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY_LOW&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY_FLOAT // super low grav with no gravity acceleration (floating feathers/fabric/leaves/...)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY_PAUSED //----(SA) has stopped, but will still do a short trace to see if it should be switched back to TR_GRAVITY&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_ACCELERATE&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_DECCELERATE&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_SPLINE&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_LINEAR_PATH&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;entity&#039;&#039;&#039;: The fields listed as having type &#039;&#039;&#039;enitity&#039;&#039;&#039; return an entity number or nil. Entity numbers are integers from 0 through 1023. Some of the entity numbers have special meanings:&lt;br /&gt;
** 0 - (sv_privateclients - 1) are reserved for clients who connect with the private slot password&lt;br /&gt;
** 0 - 63 are reserved for clients. A client&#039;s entity number is also its client number (as shown by /players for example)&lt;br /&gt;
** 1022 is the &#039;&#039;&#039;worldspawn&#039;&#039;&#039; entity&lt;br /&gt;
** 1023 is &#039;&#039;&#039;ENTITYNUM_NONE&#039;&#039;&#039; which is used instead of null in C under some circumstances to indicate no entity. This is needed where an entity number will be passed over the network.&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some other fields not listed as type &#039;entity&#039; may take an entity number value. &#039;&#039;&#039;mg42BaseEnt&#039;&#039;&#039; and &#039;&#039;&#039;s.number&#039;&#039;&#039; are examples.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Mod_API&amp;diff=2084</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=2084"/>
		<updated>2006-03-07T09:13:53Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: fixors 2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
ETPro now supports serverside 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. ETPro also provides an &amp;quot;et&amp;quot; library of function calls for lua to access the server engine, and provides callbacks so a serverside 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;
API Requests can be discussed [http://wolfwiki.anime.net/index.php/Talk:ETPro:Lua_Mod_API here].&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;,arraynumber&#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;arraynumber&#039;&#039; is an optional parameter to use when working whit array fields. In that case it represents the position in the array&lt;br /&gt;
et.gentity_set( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039;, &#039;&#039;arraynumber,&#039;&#039; &#039;&#039;&#039;(variable)&#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;(variable)&#039;&#039;&#039;&lt;br /&gt;
:&#039;&#039;arraynumber&#039;&#039; is an optional parameter to use when working whit array fields. In that case it represents the position in the array&amp;lt;br&amp;gt;&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;
===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 re-load my lua file without restarting the whole server ?&amp;lt;br&amp;gt;&lt;br /&gt;
A: change maps or map_restart&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]]&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;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Mod_API&amp;diff=2083</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=2083"/>
		<updated>2006-03-07T09:13:11Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: fixors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
ETPro now supports serverside 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. ETPro also provides an &amp;quot;et&amp;quot; library of function calls for lua to access the server engine, and provides callbacks so a serverside 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;
API Requests can be discussed [http://wolfwiki.anime.net/index.php/Talk:ETPro:Lua_Mod_API here].&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;,arraynumber&#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;arraynumber&#039;&#039; is an optional parameter to use when working whit array fields. In that case it represents the position in the array&lt;br /&gt;
et.gentity_set( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039;, &#039;&#039;arraynumber,&#039;&#039; &#039;&#039;&#039;(variable)&#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;(variable)&#039;&#039;&#039;&lt;br /&gt;
:&#039;&#039;arraynumber&#039;&#039; is an optional parameter to use when working whit array fields. In that case it represents the position in the array&amp;lt;br&amp;gt;&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;
===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 re-load my lua file without restarting the whole server ?&amp;lt;br&amp;gt;&lt;br /&gt;
A: change maps or map_restart&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]]&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;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Mod_API&amp;diff=2082</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=2082"/>
		<updated>2006-03-07T09:11:56Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: added et.gentity_get and et.gentity_set arrays&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
ETPro now supports serverside 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. ETPro also provides an &amp;quot;et&amp;quot; library of function calls for lua to access the server engine, and provides callbacks so a serverside 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;
API Requests can be discussed [http://wolfwiki.anime.net/index.php/Talk:ETPro:Lua_Mod_API here].&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;,arraynumber&#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;arraynumber&#039;&#039; is an optional parameter to use when working whit array fields. In that case &#039;&#039;arraynumber&#039;&#039; is position in the array&lt;br /&gt;
et.gentity_set( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039;, &#039;&#039;arraynumber,&#039;&#039; &#039;&#039;&#039;(variable)&#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;(variable)&#039;&#039;&#039;&lt;br /&gt;
:&#039;&#039;arraynumber&#039;&#039; is an optional parameter to use when working whit array fields. In that case &#039;&#039;arraynumber&#039;&#039; is position in the array&amp;lt;br&amp;gt;&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;
===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 re-load my lua file without restarting the whole server ?&amp;lt;br&amp;gt;&lt;br /&gt;
A: change maps or map_restart&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]]&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;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Mod_API&amp;diff=2081</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=2081"/>
		<updated>2006-03-07T09:07:25Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: snapshot 2 functions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
ETPro now supports serverside 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. ETPro also provides an &amp;quot;et&amp;quot; library of function calls for lua to access the server engine, and provides callbacks so a serverside 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;
API Requests can be discussed [http://wolfwiki.anime.net/index.php/Talk:ETPro:Lua_Mod_API here].&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; )&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;
et.gentity_set( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039;, &#039;&#039;&#039;(variable)&#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;(variable)&#039;&#039;&#039;&amp;lt;br&amp;gt;&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;
===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 re-load my lua file without restarting the whole server ?&amp;lt;br&amp;gt;&lt;br /&gt;
A: change maps or map_restart&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]]&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;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2080</id>
		<title>Fieldname</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2080"/>
		<updated>2006-03-07T08:23:04Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: snapshot 1 fields&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;List of fields supported by [[ETPro:Lua Mod API#entities|et.gentity_get() and et.gentity_set()]] functions&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;field;type;access&amp;quot; widths=&amp;quot;180;120;60&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
activator;entity;RO;&lt;br /&gt;
chain;entity;RW;&lt;br /&gt;
classname;string;RW;&lt;br /&gt;
clipmask;integer;?;&lt;br /&gt;
closespeed;float;RW;&lt;br /&gt;
count;integer;RW;&lt;br /&gt;
count2;integer;RW;&lt;br /&gt;
damage;integer;RW;&lt;br /&gt;
deathType;meansOfDeath_t;RW;&lt;br /&gt;
delay;float;RW;&lt;br /&gt;
dl_atten;integer;RW;&lt;br /&gt;
dl_color;vec3;RW;&lt;br /&gt;
dl_shader;string;RO;&lt;br /&gt;
dl_stylestring;string;RO;&lt;br /&gt;
duration;float;RW;&lt;br /&gt;
end_size;integer;RW;&lt;br /&gt;
enemy;entity;RW;&lt;br /&gt;
flags;bitflag;RO;&lt;br /&gt;
harc;float;RW;&lt;br /&gt;
health;integer;RW;&lt;br /&gt;
inuse;qboolean;RO;&lt;br /&gt;
isProp;qboolean;RO;&lt;br /&gt;
item;string;RW;&lt;br /&gt;
key;integer;RW;&lt;br /&gt;
message;string;RW;&lt;br /&gt;
methodOfDeath;integer;RW;&lt;br /&gt;
mg42BaseEnt;integer;RW;&lt;br /&gt;
missionLevel;integer;RW;&lt;br /&gt;
model;string;RO;&lt;br /&gt;
model2;string;RO;&lt;br /&gt;
nextTrain;entity;RW;&lt;br /&gt;
noise_index;integer;RW;&lt;br /&gt;
origin;vec3;RW;&lt;br /&gt;
pers.connected;connected_t;?;&lt;br /&gt;
pers.netname;string;?;&lt;br /&gt;
pers.localClient;qboolean;?;&lt;br /&gt;
pers.initialSpawn;qboolean;?; &lt;br /&gt;
pers.enterTime;integer;?;&lt;br /&gt;
pers.connectTime;integer;?; &lt;br /&gt;
pers.teamState;teamState_t;?;&lt;br /&gt;
pers.voteCount;integer;?;&lt;br /&gt;
pers.teamVoteCount;integer;?; &lt;br /&gt;
pers.complaints;integer;?; &lt;br /&gt;
pers.complaintClient;integer;?; &lt;br /&gt;
pers.complaintEndTime;integer;?; &lt;br /&gt;
pers.lastReinforceTime;integer;?; &lt;br /&gt;
pers.applicationClient;integer;?; &lt;br /&gt;
pers.applicationEndTime;integer;?; &lt;br /&gt;
pers.invitationClient;integer;?; &lt;br /&gt;
pers.invitationEndTime;integer;?; &lt;br /&gt;
pers.propositionClient;integer;?; &lt;br /&gt;
pers.propositionClient2;integer;?; &lt;br /&gt;
pers.propositionEndTime;integer;?; &lt;br /&gt;
pers.autofireteamEndTime;integer;?; &lt;br /&gt;
pers.autofireteamCreateEndTime;integer;?; &lt;br /&gt;
pers.autofireteamJoinEndTime;integer;?; &lt;br /&gt;
pers.lastSpawnTime;integer;?;&lt;br /&gt;
pers.ready;qboolean;?;&lt;br /&gt;
prevTrain;entity;RW;&lt;br /&gt;
props_frame_state;integer;RO;&lt;br /&gt;
ps.stats;integer array;RW; &lt;br /&gt;
ps.persistant;integer array;RW;&lt;br /&gt;
ps.powerups;integer array;RW;&lt;br /&gt;
ps.ammo;integer array;RW; &lt;br /&gt;
ps.ammoclip;integer array;RW;&lt;br /&gt;
r.absmax;vec3;RO;&lt;br /&gt;
r.absmin;vec3;RO;&lt;br /&gt;
r.bmodel;qboolean;RO;&lt;br /&gt;
r.contents;integer;RW;&lt;br /&gt;
r.currentAngles;vec3;RW;&lt;br /&gt;
r.currentOrigin;vec3;RW;&lt;br /&gt;
r.eventTime;integer;RW;&lt;br /&gt;
r.linkcount;integer;RO;&lt;br /&gt;
r.linked;qboolean;RO;&lt;br /&gt;
r.maxs;vec3;RW;&lt;br /&gt;
r.mins;vec3;RW;&lt;br /&gt;
r.ownerNum;integer;RW;&lt;br /&gt;
r.singleClient;integer;RW;&lt;br /&gt;
r.svFlags;integer;RW;&lt;br /&gt;
r.worldflags;integer;RO;&lt;br /&gt;
radius;integer;RW;&lt;br /&gt;
random;float;RW;&lt;br /&gt;
rotate;vec3;RW;&lt;br /&gt;
s.angles;vec3;RW;&lt;br /&gt;
s.angles2;vec3;RW;&lt;br /&gt;
s.apos;trajectory;RW;&lt;br /&gt;
s.clientNum;integer;RW;&lt;br /&gt;
s.constantLight;integer;RW;&lt;br /&gt;
s.density;integer;RW;&lt;br /&gt;
s.dl_intensity;integer;RW;&lt;br /&gt;
s.dmgFlags;integer;RW;&lt;br /&gt;
s.eFlags;integer;RW;&lt;br /&gt;
s.eType;integer;?;&lt;br /&gt;
s.effect1Time;integer;RW;&lt;br /&gt;
s.effect2Time;integer;RW;&lt;br /&gt;
s.effect3Time;integer;RW;&lt;br /&gt;
s.frame;integer;RW;&lt;br /&gt;
s.groundEntityNum;integer;RO;&lt;br /&gt;
s.loopSound;integer;RW;&lt;br /&gt;
s.modelindex;integer;RW;&lt;br /&gt;
s.modelindex2;integer;RW;&lt;br /&gt;
s.number;integer;RO;&lt;br /&gt;
s.onFireEnd;integer;RW;&lt;br /&gt;
s.onFireStart;integer;RW;&lt;br /&gt;
s.origin;vec3;?;&lt;br /&gt;
s.origin2;vec3;?;&lt;br /&gt;
s.pos;trajectory;RW;&lt;br /&gt;
s.powerups;integer;RO;&lt;br /&gt;
s.solid;integer;RW;&lt;br /&gt;
s.teamNum;integer;RW;&lt;br /&gt;
s.time;integer;RW;&lt;br /&gt;
s.time2;integer;RW;&lt;br /&gt;
s.weapon;integer;RO;&lt;br /&gt;
scriptName;string;RO;&lt;br /&gt;
sess.sessionTeam;team_t;RW;&lt;br /&gt;
sess.spectatorTime;integer;RW;&lt;br /&gt;
sess.spectatorState;spectatorState_t;RW;&lt;br /&gt;
sess.spectatorClient;integer;RW;&lt;br /&gt;
sess.latchSpectatorClient;integer;RW;&lt;br /&gt;
sess.playerType;integer;RW;&lt;br /&gt;
sess.playerWeapon;integer;RW;&lt;br /&gt;
sess.playerWeapon2;integer;RW;&lt;br /&gt;
sess.spawnObjectiveIndex;integer;RW;&lt;br /&gt;
sess.latchPlayerType;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon2;integer;RW;&lt;br /&gt;
sess.damage_given;integer;RW;&lt;br /&gt;
sess.damage_received;integer;RW;&lt;br /&gt;
sess.deaths;integer;RW;&lt;br /&gt;
sess.game_points;integer;RW;&lt;br /&gt;
sess.gibs;integer;RW;&lt;br /&gt;
sess.kills;integer;RW;&lt;br /&gt;
sess.muted;qboolean;RW;&lt;br /&gt;
sess.referee;integer;RW;&lt;br /&gt;
sess.rounds;integer;RW;&lt;br /&gt;
sess.semiadmin;integer;RW;&lt;br /&gt;
sess.spec_invite;integer;RW;&lt;br /&gt;
sess.spec_team;integer;RW;&lt;br /&gt;
sess.suicides;integer;RW;&lt;br /&gt;
sess.team_damage;integer;RW;&lt;br /&gt;
sess.team_kills;integer;RW;&lt;br /&gt;
sess.team_received;integer;RW;&lt;br /&gt;
spawnflags;integer;RO;&lt;br /&gt;
spawnitem;string;RO;&lt;br /&gt;
speed;float;RW;&lt;br /&gt;
splashDamage;integer;RW;&lt;br /&gt;
splashMethodOfDeath;integer;RW;&lt;br /&gt;
splashRadius;integer;RW;&lt;br /&gt;
start_size;integer;RW;&lt;br /&gt;
tagName;string;RO;&lt;br /&gt;
tagParent;entity;RW;&lt;br /&gt;
takedamage;boolean;RW;&lt;br /&gt;
tankLink;entity;RW;&lt;br /&gt;
target;string;RW;&lt;br /&gt;
TargetAngles;vec3;RW;&lt;br /&gt;
TargetFlag;integer;RO;&lt;br /&gt;
targetname;string;RO;&lt;br /&gt;
teamchain;entity;RW;&lt;br /&gt;
teammaster;entity;RW;&lt;br /&gt;
track;string;RO;&lt;br /&gt;
varc;float;RW;&lt;br /&gt;
wait;float;RW;&lt;br /&gt;
waterlevel;integer;RO;&lt;br /&gt;
watertype;integer;RO;&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
:&#039;&#039;note&#039;&#039;: all the sess.* fields will return nil unless the entity is associated with client slot &amp;lt; sv_maxclients.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ET variable types&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;vec3&#039;&#039;&#039;: a &#039;&#039;&#039;vec3&#039;&#039;&#039; is a 3-element array of numbers (C definition: &amp;lt;tt&amp;gt;typedef float vec3_t[3];&lt;br /&gt;
&amp;lt;/tt&amp;gt;). It is usually used to store and process coordinates in 3D space.&amp;lt;br&amp;gt;&lt;br /&gt;
In etpro-lua a vector is an array (table indexed by integers) containing 3 numbers. It can be accessed by&lt;br /&gt;
doing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
origin = et.gentity_get(entNum,&amp;quot;r.currentOrigin&amp;quot;) --a vec3 value&lt;br /&gt;
x,y,z = origin[1],origin[2],origin[3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;trajectory&#039;&#039;&#039;: a &#039;&#039;&#039;trajectory&#039;&#039;&#039; is returned as a lua table described below&lt;br /&gt;
 {&lt;br /&gt;
  trDuration = &amp;lt;number&amp;gt;, --- int&lt;br /&gt;
  trTime = &amp;lt;number&amp;gt;, -- int&lt;br /&gt;
  trType = &amp;lt;number&amp;gt;, -- see below for allowed values&lt;br /&gt;
  trBase { -- this is a vec3, as described above&lt;br /&gt;
    [1] = &amp;lt;number&amp;gt;&lt;br /&gt;
    [2] = &amp;lt;number&amp;gt;&lt;br /&gt;
    [3] = &amp;lt;number&amp;gt;&lt;br /&gt;
  },&lt;br /&gt;
  trDelta { -- also a vec3&lt;br /&gt;
   [1] = &amp;lt;number&amp;gt;&lt;br /&gt;
   [2] = &amp;lt;number&amp;gt;&lt;br /&gt;
   [3] = &amp;lt;number&amp;gt;&lt;br /&gt;
  },&lt;br /&gt;
 }&lt;br /&gt;
: the allowed values for trType (along with the enum names and original comments from the ET source), are as follows. Note &lt;br /&gt;
: that not all values make sense for all entity types &amp;lt;tt&amp;gt;&lt;br /&gt;
&amp;lt;ol start=0&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_STATIONARY&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_INTERPOLATE	// non-parametric, but interpolate between snapshots&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; TR_LINEAR&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_LINEAR_STOP&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_LINEAR_STOP_BACK //----(SA) added.  so reverse movement can be different than forward&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_SINE // value = base + sin( time / duration ) * delta&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY_LOW&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY_FLOAT // super low grav with no gravity acceleration (floating feathers/fabric/leaves/...)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY_PAUSED //----(SA) has stopped, but will still do a short trace to see if it should be switched back to TR_GRAVITY&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_ACCELERATE&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_DECCELERATE&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_SPLINE&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_LINEAR_PATH&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;entity&#039;&#039;&#039;: The fields listed as having type &#039;&#039;&#039;enitity&#039;&#039;&#039; return an entity number or nil. Entity numbers are integers from 0 through 1023. Some of the entity numbers have special meanings:&lt;br /&gt;
** 0 - (sv_privateclients - 1) are reserved for clients who connect with the private slot password&lt;br /&gt;
** 0 - 63 are reserved for clients. A client&#039;s entity number is also its client number (as shown by /players for example)&lt;br /&gt;
** 1022 is the &#039;&#039;&#039;worldspawn&#039;&#039;&#039; entity&lt;br /&gt;
** 1023 is &#039;&#039;&#039;ENTITYNUM_NONE&#039;&#039;&#039; which is used instead of null in C under some circumstances to indicate no entity. This is needed where an entity number will be passed over the network.&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some other fields not listed as type &#039;entity&#039; may take an entity number value. &#039;&#039;&#039;mg42BaseEnt&#039;&#039;&#039; and &#039;&#039;&#039;s.number&#039;&#039;&#039; are examples.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2079</id>
		<title>Fieldname</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Fieldname&amp;diff=2079"/>
		<updated>2006-03-06T19:31:49Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: oops i got to go ill finish it tomorow&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;List of fields supported by [[ETPro:Lua Mod API#entities|et.gentity_get() and et.gentity_set()]] functions&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pitatable columns=3 headlines=&amp;quot;field;type;access&amp;quot; widths=&amp;quot;180;80;60&amp;quot; headerfontcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br /&gt;
activator;entity;RO;&lt;br /&gt;
chain;entity;RW;&lt;br /&gt;
classname;string;RW;&lt;br /&gt;
closespeed;float;RW;&lt;br /&gt;
count;integer;RW;&lt;br /&gt;
count2;integer;RW;&lt;br /&gt;
damage;integer;RW;&lt;br /&gt;
deathType;integer;RW;&lt;br /&gt;
delay;float;RW;&lt;br /&gt;
dl_atten;integer;RW;&lt;br /&gt;
dl_color;vec3;RW;&lt;br /&gt;
dl_shader;string;RO;&lt;br /&gt;
dl_stylestring;string;RO;&lt;br /&gt;
duration;float;RW;&lt;br /&gt;
end_size;integer;RW;&lt;br /&gt;
enemy;entity;RW;&lt;br /&gt;
flags;integer;RO;&lt;br /&gt;
harc;float;RW;&lt;br /&gt;
health;integer;RW;&lt;br /&gt;
inuse;boolean;RO;&lt;br /&gt;
isProp;boolean;RO;&lt;br /&gt;
item;string;RW;&lt;br /&gt;
key;integer;RW;&lt;br /&gt;
message;string;RW;&lt;br /&gt;
methodOfDeath;integer;RW;&lt;br /&gt;
mg42BaseEnt;integer;RW;&lt;br /&gt;
missionLevel;integer;RW;&lt;br /&gt;
model;string;RO;&lt;br /&gt;
model2;string;RO;&lt;br /&gt;
nextTrain;entity;RW;&lt;br /&gt;
noise_index;integer;RW;&lt;br /&gt;
origin;vec3;RW;&lt;br /&gt;
prevTrain;entity;RW;&lt;br /&gt;
props_frame_state;integer;RO;&lt;br /&gt;
r.absmax;vec3;RO;&lt;br /&gt;
r.absmin;vec3;RO;&lt;br /&gt;
r.bmodel;boolean;RO;&lt;br /&gt;
r.contents;integer;RW;&lt;br /&gt;
r.currentAngles;vec3;RW;&lt;br /&gt;
r.currentOrigin;vec3;RW;&lt;br /&gt;
r.eventTime;integer;RW;&lt;br /&gt;
r.linkcount;integer;RO;&lt;br /&gt;
r.linked;boolean;RO;&lt;br /&gt;
r.maxs;vec3;RW;&lt;br /&gt;
r.mins;vec3;RW;&lt;br /&gt;
r.ownerNum;integer;RW;&lt;br /&gt;
r.singleClient;integer;RW;&lt;br /&gt;
r.svFlags;integer;RW;&lt;br /&gt;
r.worldflags;integer;RO;&lt;br /&gt;
radius;integer;RW;&lt;br /&gt;
random;float;RW;&lt;br /&gt;
rotate;vec3;RW;&lt;br /&gt;
s.angles;vec3;RW;&lt;br /&gt;
s.angles2;vec3;RW;&lt;br /&gt;
s.apos;trajectory;RW;&lt;br /&gt;
s.clientNum;integer;RW;&lt;br /&gt;
s.constantLight;integer;RW;&lt;br /&gt;
s.density;integer;RW;&lt;br /&gt;
s.dl_intensity;integer;RW;&lt;br /&gt;
s.dmgFlags;integer;RW;&lt;br /&gt;
s.eFlags;integer;RW;&lt;br /&gt;
s.effect1Time;integer;RW;&lt;br /&gt;
s.effect2Time;integer;RW;&lt;br /&gt;
s.effect3Time;integer;RW;&lt;br /&gt;
s.frame;integer;RW;&lt;br /&gt;
s.groundEntityNum;integer;RO;&lt;br /&gt;
s.loopSound;integer;RW;&lt;br /&gt;
s.modelindex;integer;RW;&lt;br /&gt;
s.modelindex2;integer;RW;&lt;br /&gt;
s.number;integer;RO;&lt;br /&gt;
s.onFireEnd;integer;RW;&lt;br /&gt;
s.onFireStart;integer;RW;&lt;br /&gt;
s.pos;trajectory;RW;&lt;br /&gt;
s.powerups;integer;RO;&lt;br /&gt;
s.solid;integer;RW;&lt;br /&gt;
s.teamNum;integer;RW;&lt;br /&gt;
s.time;integer;RW;&lt;br /&gt;
s.time2;integer;RW;&lt;br /&gt;
s.weapon;integer;RO;&lt;br /&gt;
scriptName;string;RO;&lt;br /&gt;
sess.sessionTeam;integer;RW;&lt;br /&gt;
sess.spectatorTime;integer;RW;&lt;br /&gt;
sess.spectatorState;integer;RW;&lt;br /&gt;
sess.spectatorClient;integer;RW;&lt;br /&gt;
sess.latchSpectatorClient;integer;RW;&lt;br /&gt;
sess.playerType;integer;RW;&lt;br /&gt;
sess.playerWeapon;integer;RW;&lt;br /&gt;
sess.playerWeapon2;integer;RW;&lt;br /&gt;
sess.spawnObjectiveIndex;integer;RW;&lt;br /&gt;
sess.latchPlayerType;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon;integer;RW;&lt;br /&gt;
sess.latchPlayerWeapon2;integer;RW;&lt;br /&gt;
sess.damage_given;integer;RW;&lt;br /&gt;
sess.damage_received;integer;RW;&lt;br /&gt;
sess.deaths;integer;RW;&lt;br /&gt;
sess.game_points;integer;RW;&lt;br /&gt;
sess.gibs;integer;RW;&lt;br /&gt;
sess.kills;integer;RW;&lt;br /&gt;
sess.muted;integer;RW;&lt;br /&gt;
sess.referee;integer;RW;&lt;br /&gt;
sess.rounds;integer;RW;&lt;br /&gt;
sess.semiadmin;integer;RW;&lt;br /&gt;
sess.spec_invite;integer;RW;&lt;br /&gt;
sess.spec_team;integer;RW;&lt;br /&gt;
sess.suicides;integer;RW;&lt;br /&gt;
sess.team_damage;integer;RW;&lt;br /&gt;
sess.team_kills;integer;RW;&lt;br /&gt;
sess.team_received;integer;RW;&lt;br /&gt;
spawnflags;integer;RO;&lt;br /&gt;
spawnitem;string;RO;&lt;br /&gt;
speed;float;RW;&lt;br /&gt;
splashDamage;integer;RW;&lt;br /&gt;
splashMethodOfDeath;integer;RW;&lt;br /&gt;
splashRadius;integer;RW;&lt;br /&gt;
start_size;integer;RW;&lt;br /&gt;
tagName;string;RO;&lt;br /&gt;
tagParent;entity;RW;&lt;br /&gt;
takedamage;boolean;RW;&lt;br /&gt;
tankLink;entity;RW;&lt;br /&gt;
target;string;RW;&lt;br /&gt;
TargetAngles;vec3;RW;&lt;br /&gt;
TargetFlag;integer;RO;&lt;br /&gt;
targetname;string;RO;&lt;br /&gt;
teamchain;entity;RW;&lt;br /&gt;
teammaster;entity;RW;&lt;br /&gt;
track;string;RO;&lt;br /&gt;
varc;float;RW;&lt;br /&gt;
wait;float;RW;&lt;br /&gt;
waterlevel;integer;RO;&lt;br /&gt;
watertype;integer;RO;&lt;br /&gt;
clipmask;integer;RW;&lt;br /&gt;
s.eType;integer;RW;&lt;br /&gt;
s.origin;vec3;RW;&lt;br /&gt;
s.origin2;vec3;RW;&lt;br /&gt;
pers.connected&lt;br /&gt;
pers.netname &lt;br /&gt;
pers.localClient &lt;br /&gt;
pers.initialSpawn &lt;br /&gt;
pers.enterTime &lt;br /&gt;
pers.connectTime &lt;br /&gt;
pers.teamState &lt;br /&gt;
pers.voteCount &lt;br /&gt;
pers.teamVoteCount &lt;br /&gt;
pers.complaints &lt;br /&gt;
pers.complaintClient &lt;br /&gt;
pers.complaintEndTime &lt;br /&gt;
pers.lastReinforceTime &lt;br /&gt;
pers.applicationClient &lt;br /&gt;
pers.applicationEndTime &lt;br /&gt;
pers.invitationClient &lt;br /&gt;
pers.invitationEndTime &lt;br /&gt;
pers.propositionClient &lt;br /&gt;
pers.propositionClient2 &lt;br /&gt;
pers.propositionEndTime &lt;br /&gt;
pers.autofireteamEndTime &lt;br /&gt;
pers.autofireteamCreateEndTime &lt;br /&gt;
pers.autofireteamJoinEndTime &lt;br /&gt;
pers.lastSpawnTime &lt;br /&gt;
pers.ready &lt;br /&gt;
ps.stats &lt;br /&gt;
ps.persistant &lt;br /&gt;
ps.powerups &lt;br /&gt;
ps.ammo &lt;br /&gt;
ps.ammoclip&lt;br /&gt;
&amp;lt;/pitatable&amp;gt;&lt;br /&gt;
:&#039;&#039;note&#039;&#039;: all the sess.* fields will return nil unless the entity is associated with client slot &amp;lt; sv_maxclients.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ET variable types&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;vec3&#039;&#039;&#039;: a &#039;&#039;&#039;vec3&#039;&#039;&#039; is a 3-element array of numbers (C definition: &amp;lt;tt&amp;gt;typedef float vec3_t[3];&lt;br /&gt;
&amp;lt;/tt&amp;gt;). It is usually used to store and process coordinates in 3D space.&amp;lt;br&amp;gt;&lt;br /&gt;
In etpro-lua a vector is an array (table indexed by integers) containing 3 numbers. It can be accessed by&lt;br /&gt;
doing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
origin = et.gentity_get(entNum,&amp;quot;r.currentOrigin&amp;quot;) --a vec3 value&lt;br /&gt;
x,y,z = origin[1],origin[2],origin[3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;trajectory&#039;&#039;&#039;: a &#039;&#039;&#039;trajectory&#039;&#039;&#039; is returned as a lua table described below&lt;br /&gt;
 {&lt;br /&gt;
  trDuration = &amp;lt;number&amp;gt;, --- int&lt;br /&gt;
  trTime = &amp;lt;number&amp;gt;, -- int&lt;br /&gt;
  trType = &amp;lt;number&amp;gt;, -- see below for allowed values&lt;br /&gt;
  trBase { -- this is a vec3, as described above&lt;br /&gt;
    [1] = &amp;lt;number&amp;gt;&lt;br /&gt;
    [2] = &amp;lt;number&amp;gt;&lt;br /&gt;
    [3] = &amp;lt;number&amp;gt;&lt;br /&gt;
  },&lt;br /&gt;
  trDelta { -- also a vec3&lt;br /&gt;
   [1] = &amp;lt;number&amp;gt;&lt;br /&gt;
   [2] = &amp;lt;number&amp;gt;&lt;br /&gt;
   [3] = &amp;lt;number&amp;gt;&lt;br /&gt;
  },&lt;br /&gt;
 }&lt;br /&gt;
: the allowed values for trType (along with the enum names and original comments from the ET source), are as follows. Note &lt;br /&gt;
: that not all values make sense for all entity types &amp;lt;tt&amp;gt;&lt;br /&gt;
&amp;lt;ol start=0&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_STATIONARY&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_INTERPOLATE	// non-parametric, but interpolate between snapshots&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; TR_LINEAR&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_LINEAR_STOP&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_LINEAR_STOP_BACK //----(SA) added.  so reverse movement can be different than forward&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_SINE // value = base + sin( time / duration ) * delta&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY_LOW&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY_FLOAT // super low grav with no gravity acceleration (floating feathers/fabric/leaves/...)&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_GRAVITY_PAUSED //----(SA) has stopped, but will still do a short trace to see if it should be switched back to TR_GRAVITY&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_ACCELERATE&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_DECCELERATE&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_SPLINE&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;TR_LINEAR_PATH&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;entity&#039;&#039;&#039;: The fields listed as having type &#039;&#039;&#039;enitity&#039;&#039;&#039; return an entity number or nil. Entity numbers are integers from 0 through 1023. Some of the entity numbers have special meanings:&lt;br /&gt;
** 0 - (sv_privateclients - 1) are reserved for clients who connect with the private slot password&lt;br /&gt;
** 0 - 63 are reserved for clients. A client&#039;s entity number is also its client number (as shown by /players for example)&lt;br /&gt;
** 1022 is the &#039;&#039;&#039;worldspawn&#039;&#039;&#039; entity&lt;br /&gt;
** 1023 is &#039;&#039;&#039;ENTITYNUM_NONE&#039;&#039;&#039; which is used instead of null in C under some circumstances to indicate no entity. This is needed where an entity number will be passed over the network.&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some other fields not listed as type &#039;entity&#039; may take an entity number value. &#039;&#039;&#039;mg42BaseEnt&#039;&#039;&#039; and &#039;&#039;&#039;s.number&#039;&#039;&#039; are examples.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Mod_API&amp;diff=2078</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=2078"/>
		<updated>2006-03-06T19:15:45Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: fixed revived since it apears tobe a number&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
ETPro now supports serverside 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. ETPro also provides an &amp;quot;et&amp;quot; library of function calls for lua to access the server engine, and provides callbacks so a serverside 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;
API Requests can be discussed [http://wolfwiki.anime.net/index.php/Talk:ETPro:Lua_Mod_API here].&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; )&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;
et.gentity_set( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039;, &#039;&#039;&#039;(variable)&#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;(variable)&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&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;
===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 re-load my lua file without restarting the whole server ?&amp;lt;br&amp;gt;&lt;br /&gt;
A: change maps or map_restart&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]]&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;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Mod_API&amp;diff=2077</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=2077"/>
		<updated>2006-03-06T18:58:45Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: made bitflag a link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
ETPro now supports serverside 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. ETPro also provides an &amp;quot;et&amp;quot; library of function calls for lua to access the server engine, and provides callbacks so a serverside 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;
API Requests can be discussed [http://wolfwiki.anime.net/index.php/Talk:ETPro:Lua_Mod_API here].&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; )&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;
et.gentity_set( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039;, &#039;&#039;&#039;(variable)&#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;(variable)&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&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 &#039;&#039;true&#039;&#039; 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;
===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 re-load my lua file without restarting the whole server ?&amp;lt;br&amp;gt;&lt;br /&gt;
A: change maps or map_restart&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]]&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;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Mod_API&amp;diff=2076</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=2076"/>
		<updated>2006-03-06T18:51:54Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: snapshot 1 callbacks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
ETPro now supports serverside 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. ETPro also provides an &amp;quot;et&amp;quot; library of function calls for lua to access the server engine, and provides callbacks so a serverside 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;
API Requests can be discussed [http://wolfwiki.anime.net/index.php/Talk:ETPro:Lua_Mod_API here].&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 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; )&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;
et.gentity_set( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039;, &#039;&#039;&#039;(variable)&#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;(variable)&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&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 &#039;&#039;true&#039;&#039; 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;
===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 re-load my lua file without restarting the whole server ?&amp;lt;br&amp;gt;&lt;br /&gt;
A: change maps or map_restart&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]]&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;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Etdamage&amp;diff=2075</id>
		<title>Etdamage</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Etdamage&amp;diff=2075"/>
		<updated>2006-03-06T18:47:10Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: page started&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;comming soon.&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Lua_Mod_API&amp;diff=2074</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=2074"/>
		<updated>2006-03-06T18:46:06Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: snapshot 1 functions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
ETPro now supports serverside 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. ETPro also provides an &amp;quot;et&amp;quot; library of function calls for lua to access the server engine, and provides callbacks so a serverside 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;
API Requests can be discussed [http://wolfwiki.anime.net/index.php/Talk:ETPro:Lua_Mod_API here].&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 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; )&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;
et.gentity_set( &#039;&#039;&#039;entnum&#039;&#039;&#039;, &#039;&#039;&#039;[[Fieldname]]&#039;&#039;&#039;, &#039;&#039;&#039;(variable)&#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;(variable)&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&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;
&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;
===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 re-load my lua file without restarting the whole server ?&amp;lt;br&amp;gt;&lt;br /&gt;
A: change maps or map_restart&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]]&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;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Talk:Lua_Mod_API&amp;diff=2072</id>
		<title>Talk:Lua Mod API</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Talk:Lua_Mod_API&amp;diff=2072"/>
		<updated>2006-02-15T13:16:10Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: LoadLib&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;- et.G_SlotSound( slotnum, soundindex ) -&amp;gt;  Plays the sound soundindex at for the player @ slotnum only. --[[User:RoadKillPuppy|RoadKillPuppy]] 14:17, 16 December 2005 (PST)&lt;br /&gt;
:you can do this with tempentities and SVF_SINGLECLIENT ...&lt;br /&gt;
:--[[User:Bani|Bani]] 17:32, 16 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
some of this can be done via function et_Print(text).. but this would greatly simplify life,&amp;lt;br&amp;gt;&lt;br /&gt;
my wish list for christmas:&amp;lt;br&amp;gt;&lt;br /&gt;
- getUserEguid(cno) - get a client&#039;s etpro guid?&amp;lt;br&amp;gt;&lt;br /&gt;
- repair gentity_set for vec3 - scotty fix the transporter please&amp;lt;br&amp;gt;&lt;br /&gt;
:[http://bani.anime.net/banimod/forums/viewtopic.php?t=6279 fixed.]--[[User:Bani|Bani]] 17:56, 22 December 2005 (PST)&lt;br /&gt;
- et.trap_SendServerCommand(cno, &amp;quot;kill&amp;quot;) - punish client as alternative to setting health&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Hadr0|Hadr0]] 02:10, 20 December 2005 (PST)&amp;lt;br&amp;gt;&lt;br /&gt;
:You can use et.G_Damage() in the new test version to do that.--[[User:Bani|Bani]] 01:38, 23 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
trap sen server cmd is a ET engine trap the comand u send it send to the client and recived as a server command no a client command&lt;br /&gt;
&lt;br /&gt;
to add ill well that would be al ot of coding for not much [[User:=FF=im2good4u|=FF=Im2good4u]] 12:12, 20 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
aight thnx.&amp;lt;br&amp;gt;&lt;br /&gt;
heres another api request, i&#039;d like to be able to get a clients xp directly. et.gentity_get(cno, &amp;quot;sess.game_points&amp;quot;) seems to return 0 always (?)&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Hadr0|Hadr0]] 15:38, 21 December 2005 (PST)&lt;br /&gt;
:oh nevermind, i see this can be done now with xp = et.gentity_get(cno, &amp;quot;ps.stats&amp;quot;, 8)&lt;br /&gt;
:nice... --[[User:Hadr0|Hadr0]] 16:58, 23 December 2005 (PST)&lt;br /&gt;
--------&lt;br /&gt;
add a way to determine if a client is 999, and if possible why he&#039;s 999 (loading, connecting, loosing packets, etc)&amp;lt;br&amp;gt;&lt;br /&gt;
--Gotenks&lt;br /&gt;
&lt;br /&gt;
999 means: server has not been sent data from client for &amp;gt; 1000 ms. So there is no way to certainly tell why.&lt;br /&gt;
The timeoutflag is stored in the pmflags IIRC. Don&#039;t know if lua can read them right now. --[[User:Deus|Deus]] 23:12, 22 December 2005 (PST)&amp;lt;br&amp;gt;&lt;br /&gt;
Still would like access to the ping, or a dummy variable if they are 999, but also the ammount of time they are inactive.&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Gotenks|Gotenks]] (Sorry for double post) 1:53, 31 December 2005 (CST)&lt;br /&gt;
:[http://bani.anime.net/banimod/forums/viewtopic.php?t=6291 fixed].--[[User:Bani|Bani]] 02:40, 7 February 2006 (PST)&lt;br /&gt;
----&lt;br /&gt;
Access to weapon stats during game similar to end of round stats that are displayed.&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:LethalInjection|LethalInjection]] 23:52, 22 December 2005 (PST)&lt;br /&gt;
:[http://bani.anime.net/banimod/forums/viewtopic.php?t=6291 fixed].--[[User:Bani|Bani]] 02:40, 7 February 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== IPC stuff ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
i would like a et_IPCReceive whit an return value so u can send info back on a request&lt;br /&gt;
&lt;br /&gt;
i would like a et_IPCSend that can send to all lua mods then them mods can decide if the wana use that message or not&lt;br /&gt;
[[User:=FF=im2good4u|=FF=Im2good4u]] 12:35, 8 January 2006 (PST)&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
  et_IPCReceive wouldn&#039;t send it to the other mod... afaik... so just use another send&lt;br /&gt;
  just et_IPCSend to all modules (afaik, you can even send to ones not there), simple loop function&lt;br /&gt;
[[User:gotenks|gotenks]] 20:04, 8 January 2006 (CST)&lt;br /&gt;
&lt;br /&gt;
yeh probely but its not verry handy its better to get the good vmnumber or to e able to send on mod filenames&lt;br /&gt;
&lt;br /&gt;
apart from that returning a value will be more handy since tnhe u cna contine in 1 funtion else u got to reacise it in the recieve funtion [[User:=FF=im2good4u|=FF=Im2good4u]] 10:45, 9 January 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
bani i need a console print function on the client that does sepport ascii plz [[User:=FF=im2good4u|=FF=Im2good4u]] 12:49, 12 January 2006 (PST)&lt;br /&gt;
:et.trap_SendServerCommand( clientnum, &amp;quot;print \&amp;quot;hello ascii console on the client\n\&amp;quot; ) ) --[[User:Bani|Bani]] 22:33, 15 January 2006 (PST)&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
bani: how about a et_sound(id, sound) event? [[User:gotenks|gotenks]] 20:45, 17 January 2006 (CST)&lt;br /&gt;
:[http://wolfwiki.anime.net/index.php/ETPro:Lua_Mod_API#sound et.G_Sound( entnum, soundindex )] --[[User:Bani|Bani]] 22:07, 18 January 2006 (PST)&lt;br /&gt;
:bani, i was referring to an on event call, so when a sound is played et_sound(id,sound) would be called.[[User:gotenks|gotenks]] 21:45, 20 January 2006 (CST)&lt;br /&gt;
::most sounds are clientside... this would not be of much use. --[[User:Bani|Bani]] 04:42, 22 January 2006 (PST)&lt;br /&gt;
:::except for checking when something like a killing spree sound is activated--[[User:gotenks|gotenks]] 07:54, 23 January 2006 (CST)&lt;br /&gt;
:::::There would be no way for you to know what sound was activated. You can&#039;t get a filename from the soundindex.--[[User:Bani|Bani]] 10:19, 24 January 2006 (PST)&lt;br /&gt;
:::::This is a case where IPCSend/IPCReceive would be useful, so mods can notify each other of specific events.--[[User:Bani|Bani]] 02:40, 7 February 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Is it possible to get a player&#039;s live angles? Fieldname &amp;quot;s.angles&amp;quot; only gives the spawn angles. Tried &amp;quot;rotate&amp;quot;, &amp;quot;s.angles2&amp;quot;, &amp;quot;TargetAngles&amp;quot;, &amp;quot;r.currentAngles&amp;quot; as well but they just give 0.000000 for each element. thanks for any help --[[User:Hadr0|Hadr0]] 01:35, 25 January 2006 (PST)&lt;br /&gt;
:This will be fixed in the next release, where you will get access to ps.viewangles--[[User:Bani|Bani]] 02:33, 7 February 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
== LoadLib ==&lt;br /&gt;
&lt;br /&gt;
Add loadlib ppl it says u have lua basic included but not loadlib !!&lt;br /&gt;
&lt;br /&gt;
(on windows it gives an error attept to call global load lin a nil valua)[[User:=FF=im2good4u|=FF=Im2good4u]] 05:16, 15 February 2006 (PST)&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=SendServerCommand&amp;diff=2067</id>
		<title>SendServerCommand</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=SendServerCommand&amp;diff=2067"/>
		<updated>2006-01-26T15:32:18Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: fixored the locations for voicechats&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
et.trap_SendServerCommand() is used to send a command from the server to one or more clients. The first argument is the slot number of the client the command will be sent to. If it&#039;s equal to -1, the command will be broadcast to all clients.&lt;br /&gt;
&lt;br /&gt;
The following commands can be issued with this function:&lt;br /&gt;
&lt;br /&gt;
==Prining==&lt;br /&gt;
===Print===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;print&#039;&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\n\&amp;quot;&amp;quot;&lt;br /&gt;
:&#039;&#039;&#039;print&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; to the client&#039;s console.&lt;br /&gt;
&lt;br /&gt;
===Center Print MoO=== &lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;cpm&#039;&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\n\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;cpm&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; to the client&#039;s annoucement area and console.&lt;br /&gt;
&lt;br /&gt;
===Center Print===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;cp&#039;&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\n\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;cp&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; to the center of the client&#039;s screen.&lt;br /&gt;
&lt;br /&gt;
===Banner Print===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;b&#039;&#039;&#039; &#039;&#039;locations&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\n\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;b&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; to the client&#039;s banner &#039;&#039;locations&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
:the &#039;&#039;locations&#039;&#039; can be a number from 0 to 248&lt;br /&gt;
:For compatibility, the old-style locations (from 0-4) are also supported.&amp;lt;br&amp;gt;&lt;br /&gt;
:8 - player chat area&amp;lt;br&amp;gt;                &lt;br /&gt;
:16 - left popup area (not recommended)&amp;lt;br&amp;gt;&lt;br /&gt;
:32 - centered above the chat area&amp;lt;br&amp;gt;&lt;br /&gt;
:64 - console only&amp;lt;br&amp;gt;&lt;br /&gt;
:128 - banner area (recommended)(top of screen)&lt;br /&gt;
&lt;br /&gt;
===Scores Print===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;sc&#039;&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\n\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;sc&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; to the client&#039;s console and writes it to the statsdump file.&lt;br /&gt;
&lt;br /&gt;
==Chatting==&lt;br /&gt;
===Chat===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;c&#039;&#039;&#039; &#039;&#039;ClientNum&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;c&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; as a global chat message on behalf of the client specified by &#039;&#039;ClientNum&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Team Chat===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;tc&#039;&#039;&#039; &#039;&#039;ClientNum&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\&amp;quot; &#039;&#039;X-Location&#039;&#039; &#039;&#039;Y-Location&#039;&#039; &#039;&#039;Z-Location&#039;&#039;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;tc&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; as a team chat message on behalf of the client specified by &#039;&#039;ClientNum&#039;&#039;,&amp;lt;br&amp;gt;&lt;br /&gt;
:the &#039;&#039;X,Y,Z-Location&#039;s&#039;&#039; are optional parematers that represent the client&#039;s location,&amp;lt;br&amp;gt;&lt;br /&gt;
:if the &#039;&#039;X,Y,Z-Location&#039;s&#039;&#039; are left out then the message will be printed without a location.&lt;br /&gt;
&lt;br /&gt;
===Fireteam Chat===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;bc&#039;&#039;&#039; &#039;&#039;ClientNum&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\&amp;quot; &#039;&#039;X-Location&#039;&#039; &#039;&#039;Y-Location&#039;&#039; &#039;&#039;Z-Location&#039;&#039;&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;bc&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; as a fireteam chat message on behalf of the client specified by &#039;&#039;ClientNum&#039;&#039;,&amp;lt;br&amp;gt;&lt;br /&gt;
:the &#039;&#039;X,Y,Z-Location&#039;s&#039;&#039; are parematers that represent the client&#039;s location.&lt;br /&gt;
&lt;br /&gt;
==Voice Chat==&lt;br /&gt;
===Global Voice Chat===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;vchat&#039;&#039;&#039; &#039;&#039;VoiceOnly&#039;&#039; &#039;&#039;ClientNum&#039;&#039; 50 &#039;&#039;Vsay-String&#039;&#039; &#039;&#039;Vsay-Number&#039;&#039; \&amp;quot;&#039;&#039;Custom-Message&#039;&#039;\&amp;quot;&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;vchat&#039;&#039;&#039; sends a global voice chat &#039;&#039;Vsay-String&#039;&#039; on behalf of the client specified by &#039;&#039;ClientNum&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;Vsay-Number&#039;&#039; is by default random, however, it can be set by the player by passing parameters to the vsay command (/vsay &amp;lt;&#039;&#039;Vsay-Number&#039;&#039;&amp;gt; &amp;lt;&#039;&#039;Vsay-String&#039;&#039;&amp;gt;),&amp;lt;br&amp;gt; &#039;&#039;Vsay-Number&#039;&#039; represents the vsay number of Vsay as listed in the .voice files.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;Custom-Message&#039;&#039; is by default \&amp;quot;\&amp;quot; (empty), otherwise it&#039;s the message that gets printed in the chat area.&lt;br /&gt;
:if &#039;&#039;VoiceOnly&#039;&#039; is 0 it will print a chat message on behalf of &#039;&#039;ClientNum&#039;&#039; contaning the message&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;VoiceOnly&#039;&#039; is 1 it will only do the sound but not the message&lt;br /&gt;
&lt;br /&gt;
===Team Voice Chat===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;vtchat&#039;&#039;&#039; &#039;&#039;VoiceOnly&#039;&#039; &#039;&#039;ClientNum&#039;&#039; 50 &#039;&#039;Vsay-String&#039;&#039; &#039;&#039;Vsay-Number&#039;&#039; &#039;&#039;X-Location&#039;&#039; &#039;&#039;Y-Location&#039;&#039; &#039;&#039;Z-Location&#039;&#039; \&amp;quot;&#039;&#039;Custom-Message&#039;&#039;\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;vchat&#039;&#039;&#039; sends a team voice chat &#039;&#039;Vsay-String&#039;&#039; a on behalf of client &#039;&#039;ClienNtum&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;Vsay-Number&#039;&#039; is by default random, however, it can be set by the player by passing parameters to the vsay command (/vsay &amp;lt;&#039;&#039;Vsay-Number&#039;&#039;&amp;gt; &amp;lt;&#039;&#039;Vsay-String&#039;&#039;&amp;gt;),&amp;lt;br&amp;gt; &#039;&#039;Vsay-Number&#039;&#039; represents the vsay number of Vsay as listed in the .voice files.&amp;lt;br&amp;gt;&lt;br /&gt;
:the &#039;&#039;X,Y,Z-Location&#039;s&#039;&#039; parematers the represent the clients location.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;Custom-Message&#039;&#039; is by default \&amp;quot;\&amp;quot; (empty), otherwise it&#039;s the message that gets printed in the chat area.&lt;br /&gt;
:if &#039;&#039;VoiceOnly&#039;&#039; is 0 it will print a chat message on behalf of &#039;&#039;ClientNum&#039;&#039; contaning the message&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;VoiceOnly&#039;&#039; is 1 it will only do the sound but not the message&lt;br /&gt;
&lt;br /&gt;
===Fireteam Voice Chat===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;vtchat&#039;&#039;&#039; &#039;&#039;VoiceOnly&#039;&#039; &#039;&#039;ClientNum&#039;&#039; 50 &#039;&#039;Fireteam-String&#039;&#039; &#039;&#039;Vsay-Number&#039;&#039; &#039;&#039;X-Location&#039;&#039; &#039;&#039;Y-Location&#039;&#039; &#039;&#039;Z-Location&#039;&#039; \&amp;quot;&#039;&#039;Custom-Message&#039;&#039;\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;vchat&#039;&#039;&#039; will team voice chat &#039;&#039;Vsay-String&#039;&#039; on behalf of client &#039;&#039;ClienNum&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;Vsay-Number&#039;&#039; is by default random, however, it can be set by the player by passing parameters to the vsay command (/vsay &amp;lt;&#039;&#039;Vsay-Number&#039;&#039;&amp;gt; &amp;lt;&#039;&#039;Vsay-String&#039;&#039;&amp;gt;),&amp;lt;br&amp;gt; &#039;&#039;Vsay-Number&#039;&#039; represents the vsay number of Vsay as listed in the .voice files.&amp;lt;br&amp;gt;&lt;br /&gt;
:the &#039;&#039;X,Y,Z-Location&#039;s&#039;&#039; parematers the represent the clients location.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;Custom-Message&#039;&#039; is by default \&amp;quot;\&amp;quot; (empty), otherwise it&#039;s the message that gets printed in the chat area.&lt;br /&gt;
:if &#039;&#039;VoiceOnly&#039;&#039; is 0 it will print a chat message on behalf of &#039;&#039;ClientNum&#039;&#039; contaning the message&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;VoiceOnly&#039;&#039; is 1 it will only do the sound but not the message&lt;br /&gt;
&lt;br /&gt;
==Fireteam==&lt;br /&gt;
===Application===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;application&#039;&#039;&#039; &#039;&#039;Number&#039;&#039;&amp;quot;&lt;br /&gt;
:&#039;&#039;&#039;application&#039;&#039;&#039; shows a fireteam invation message to the client.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; &amp;gt; -1 - the &amp;quot;accept ... application to join your fireteam&amp;quot; message shows up. In this case &#039;&#039;Number&#039;&#039; is the ClientNum of the applying client.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -1 - the &amp;quot;your aplication has been submitted&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -2 - the &amp;quot;your aplication failed&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -3 - the &amp;quot;your aplication has been approved&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -4 - the &amp;quot;your aplication reply has been sent&amp;quot; message shows up.&lt;br /&gt;
&lt;br /&gt;
===Proposition===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;proposition&#039;&#039;&#039; &#039;&#039;Number&#039;&#039; &#039;&#039;Number2&#039;&#039;&amp;quot;&lt;br /&gt;
:&#039;&#039;&#039;proposition&#039;&#039;&#039; shows a fireteam proposition message to the client.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; &amp;gt; -1 - the &amp;quot;accept ... proposition to invite ... to your fireteam&amp;quot; message shows up. In this case &#039;&#039;Number&#039;&#039; is the ClientNum of the proposed client, and &#039;&#039;Number2&#039;&#039; is the ClientNum of the proposing player.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -1 - the &amp;quot;your proposition has been submitted&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -2 - the &amp;quot;your proposition was rejected&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -3 - the &amp;quot;your proposition was accepted&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -4 - the &amp;quot;your proposition reply has been sent&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;Number2&#039;&#039; is an optional paramater only used when &#039;&#039;Number&#039;&#039; &amp;gt; -1.&lt;br /&gt;
&lt;br /&gt;
===Invitation===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;invitation&#039;&#039;&#039; &#039;&#039;Number&#039;&#039;&amp;quot;&lt;br /&gt;
:&#039;&#039;&#039;invitation&#039;&#039;&#039; shows the fireteam invation message to the client.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; &amp;gt; -1 - the &amp;quot;accept .. invitation to join your fireteam&amp;quot; message shows up. In this case &#039;&#039;Number&#039;&#039; is the ClientNum of the applying client.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -1 - the &amp;quot;your invitation has been submitted&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -2 - the &amp;quot;your invitation rejected&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -3 - the &amp;quot;your invitation was accepted&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -4 - the &amp;quot;your invitation reply has been sent&amp;quot; message shows up.&lt;br /&gt;
&lt;br /&gt;
==Others== &lt;br /&gt;
===Complaining===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;complaint&#039;&#039;&#039; &#039;&#039;Number&#039;&#039;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;complaint&#039;&#039;&#039; shows the complaint vote message to the client.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; &amp;gt; 1 - the vote shows up. In this case &#039;&#039;Number&#039;&#039; is the ClientNum of the teamkilling player.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -1 - the &amp;quot;complaint filed&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -2 - the &amp;quot;complaint dismissed&amp;quot; message shows up.&lt;br /&gt;
&lt;br /&gt;
===Spawning===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;setspawnpt&#039;&#039;&#039; &#039;&#039;Number&#039;&#039;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;setspawnpt&#039;&#039;&#039; sets the client game selected spawnpoint to number &#039;&#039;number&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===kicking===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;disconnect&#039;&#039;&#039; \&amp;quot;&#039;&#039;reason&#039;&#039;\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;disconnect&#039;&#039;&#039; will disconnect the client it has been send with a &amp;quot;Server disconnected&amp;quot; message&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;reason&#039;&#039; is an optialnal parameter to show a reason after &amp;quot;Server disconnected&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Configstrings===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;cs&#039;&#039;&#039; &#039;&#039;Number&#039;&#039; \&amp;quot;&#039;&#039;String&#039;&#039;\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;cs&#039;&#039;&#039; will set the clients configstringnumber &#039;&#039;Number&#039;&#039; to the &#039;&#039;String&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Shaders===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;remapShader&#039;&#039;&#039; \&amp;quot;&#039;&#039;OldShader&#039;&#039;\&amp;quot; \&amp;quot;&#039;&#039;NewShader&#039;&#039;\&amp;quot; &#039;&#039;0&#039;&#039;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;remapShader&#039;&#039;&#039; remaps the &#039;&#039;OldShader&#039;&#039; whit &#039;&#039;NewShader&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
: &#039;&#039;0&#039;&#039; is the Timeoffset, i have no idea wut it means so better leave it 0&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=SendServerCommand&amp;diff=2066</id>
		<title>SendServerCommand</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=SendServerCommand&amp;diff=2066"/>
		<updated>2006-01-26T15:30:27Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: updaed voicechats&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__&lt;br /&gt;
et.trap_SendServerCommand() is used to send a command from the server to one or more clients. The first argument is the slot number of the client the command will be sent to. If it&#039;s equal to -1, the command will be broadcast to all clients.&lt;br /&gt;
&lt;br /&gt;
The following commands can be issued with this function:&lt;br /&gt;
&lt;br /&gt;
==Prining==&lt;br /&gt;
===Print===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;print&#039;&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\n\&amp;quot;&amp;quot;&lt;br /&gt;
:&#039;&#039;&#039;print&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; to the client&#039;s console.&lt;br /&gt;
&lt;br /&gt;
===Center Print MoO=== &lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;cpm&#039;&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\n\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;cpm&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; to the client&#039;s annoucement area and console.&lt;br /&gt;
&lt;br /&gt;
===Center Print===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;cp&#039;&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\n\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;cp&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; to the center of the client&#039;s screen.&lt;br /&gt;
&lt;br /&gt;
===Banner Print===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;b&#039;&#039;&#039; &#039;&#039;locations&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\n\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;b&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; to the client&#039;s banner &#039;&#039;locations&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
:the &#039;&#039;locations&#039;&#039; can be a number from 0 to 248&lt;br /&gt;
:For compatibility, the old-style locations (from 0-4) are also supported.&amp;lt;br&amp;gt;&lt;br /&gt;
:8 - player chat area&amp;lt;br&amp;gt;                &lt;br /&gt;
:16 - left popup area (not recommended)&amp;lt;br&amp;gt;&lt;br /&gt;
:32 - centered above the chat area&amp;lt;br&amp;gt;&lt;br /&gt;
:64 - console only&amp;lt;br&amp;gt;&lt;br /&gt;
:128 - banner area (recommended)(top of screen)&lt;br /&gt;
&lt;br /&gt;
===Scores Print===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;sc&#039;&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\n\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;sc&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; to the client&#039;s console and writes it to the statsdump file.&lt;br /&gt;
&lt;br /&gt;
==Chatting==&lt;br /&gt;
===Chat===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;c&#039;&#039;&#039; &#039;&#039;ClientNum&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;c&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; as a global chat message on behalf of the client specified by &#039;&#039;ClientNum&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Team Chat===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;tc&#039;&#039;&#039; &#039;&#039;ClientNum&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\&amp;quot; &#039;&#039;X-Location&#039;&#039; &#039;&#039;Y-Location&#039;&#039; &#039;&#039;Z-Location&#039;&#039;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;tc&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; as a team chat message on behalf of the client specified by &#039;&#039;ClientNum&#039;&#039;,&amp;lt;br&amp;gt;&lt;br /&gt;
:the &#039;&#039;X,Y,Z-Location&#039;s&#039;&#039; are optional parematers that represent the client&#039;s location,&amp;lt;br&amp;gt;&lt;br /&gt;
:if the &#039;&#039;X,Y,Z-Location&#039;s&#039;&#039; are left out then the message will be printed without a location.&lt;br /&gt;
&lt;br /&gt;
===Fireteam Chat===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;bc&#039;&#039;&#039; &#039;&#039;ClientNum&#039;&#039; \&amp;quot;&#039;&#039;Message&#039;&#039;\&amp;quot; &#039;&#039;X-Location&#039;&#039; &#039;&#039;Y-Location&#039;&#039; &#039;&#039;Z-Location&#039;&#039;&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;bc&#039;&#039;&#039; prints &#039;&#039;Message&#039;&#039; as a fireteam chat message on behalf of the client specified by &#039;&#039;ClientNum&#039;&#039;,&amp;lt;br&amp;gt;&lt;br /&gt;
:the &#039;&#039;X,Y,Z-Location&#039;s&#039;&#039; are parematers that represent the client&#039;s location.&lt;br /&gt;
&lt;br /&gt;
==Voice Chat==&lt;br /&gt;
===Global Voice Chat===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;vchat&#039;&#039;&#039; &#039;&#039;VoiceOnly&#039;&#039; &#039;&#039;ClientNum&#039;&#039; 50 &#039;&#039;Vsay-String&#039;&#039; &#039;&#039;Vsay-Number&#039;&#039; \&amp;quot;&#039;&#039;Custom-Message&#039;&#039;\&amp;quot;&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;vchat&#039;&#039;&#039; sends a global voice chat &#039;&#039;Vsay-String&#039;&#039; on behalf of the client specified by &#039;&#039;ClientNum&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;Vsay-Number&#039;&#039; is by default random, however, it can be set by the player by passing parameters to the vsay command (/vsay &amp;lt;&#039;&#039;Vsay-Number&#039;&#039;&amp;gt; &amp;lt;&#039;&#039;Vsay-String&#039;&#039;&amp;gt;),&amp;lt;br&amp;gt; &#039;&#039;Vsay-Number&#039;&#039; represents the vsay number of Vsay as listed in the .voice files.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;Custom-Message&#039;&#039; is by default \&amp;quot;\&amp;quot; (empty), otherwise it&#039;s the message that gets printed in the chat area.&lt;br /&gt;
:if &#039;&#039;VoiceOnly&#039;&#039; is 0 it will print a chat message on behalf of &#039;&#039;ClientNum&#039;&#039; contaning the message&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;VoiceOnly&#039;&#039; is 1 it will only do the sound but not the message&lt;br /&gt;
&lt;br /&gt;
===Team Voice Chat===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;vtchat&#039;&#039;&#039; &#039;&#039;VoiceOnly&#039;&#039; &#039;&#039;ClientNum&#039;&#039; 50 &#039;&#039;Vsay-String&#039;&#039; &#039;&#039;Vsay-Number&#039;&#039; &#039;&#039;Y-Location&#039;&#039; &#039;&#039;Y-Location&#039;&#039; &#039;&#039;Z-Location&#039;&#039; \&amp;quot;&#039;&#039;Custom-Message&#039;&#039;\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;vchat&#039;&#039;&#039; sends a team voice chat &#039;&#039;Vsay-String&#039;&#039; a on behalf of client &#039;&#039;ClienNtum&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;Vsay-Number&#039;&#039; is by default random, however, it can be set by the player by passing parameters to the vsay command (/vsay &amp;lt;&#039;&#039;Vsay-Number&#039;&#039;&amp;gt; &amp;lt;&#039;&#039;Vsay-String&#039;&#039;&amp;gt;),&amp;lt;br&amp;gt; &#039;&#039;Vsay-Number&#039;&#039; represents the vsay number of Vsay as listed in the .voice files.&amp;lt;br&amp;gt;&lt;br /&gt;
:the &#039;&#039;X,Y,Z-Location&#039;s&#039;&#039; parematers the represent the clients location.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;Custom-Message&#039;&#039; is by default \&amp;quot;\&amp;quot; (empty), otherwise it&#039;s the message that gets printed in the chat area.&lt;br /&gt;
:if &#039;&#039;VoiceOnly&#039;&#039; is 0 it will print a chat message on behalf of &#039;&#039;ClientNum&#039;&#039; contaning the message&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;VoiceOnly&#039;&#039; is 1 it will only do the sound but not the message&lt;br /&gt;
&lt;br /&gt;
===Fireteam Voice Chat===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;vtchat&#039;&#039;&#039; &#039;&#039;VoiceOnly&#039;&#039; &#039;&#039;ClientNum&#039;&#039; 50 &#039;&#039;Fireteam-String&#039;&#039; &#039;&#039;Vsay-Number&#039;&#039; &#039;&#039;Y-Location&#039;&#039; &#039;&#039;Y-Location&#039;&#039; &#039;&#039;Z-Location&#039;&#039; \&amp;quot;&#039;&#039;Custom-Message&#039;&#039;\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;vchat&#039;&#039;&#039; will team voice chat &#039;&#039;Vsay-String&#039;&#039; on behalf of client &#039;&#039;ClienNum&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;Vsay-Number&#039;&#039; is by default random, however, it can be set by the player by passing parameters to the vsay command (/vsay &amp;lt;&#039;&#039;Vsay-Number&#039;&#039;&amp;gt; &amp;lt;&#039;&#039;Vsay-String&#039;&#039;&amp;gt;),&amp;lt;br&amp;gt; &#039;&#039;Vsay-Number&#039;&#039; represents the vsay number of Vsay as listed in the .voice files.&amp;lt;br&amp;gt;&lt;br /&gt;
:the &#039;&#039;X,Y,Z-Location&#039;s&#039;&#039; parematers the represent the clients location.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;Custom-Message&#039;&#039; is by default \&amp;quot;\&amp;quot; (empty), otherwise it&#039;s the message that gets printed in the chat area.&lt;br /&gt;
:if &#039;&#039;VoiceOnly&#039;&#039; is 0 it will print a chat message on behalf of &#039;&#039;ClientNum&#039;&#039; contaning the message&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;VoiceOnly&#039;&#039; is 1 it will only do the sound but not the message&lt;br /&gt;
&lt;br /&gt;
==Fireteam==&lt;br /&gt;
===Application===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;application&#039;&#039;&#039; &#039;&#039;Number&#039;&#039;&amp;quot;&lt;br /&gt;
:&#039;&#039;&#039;application&#039;&#039;&#039; shows a fireteam invation message to the client.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; &amp;gt; -1 - the &amp;quot;accept ... application to join your fireteam&amp;quot; message shows up. In this case &#039;&#039;Number&#039;&#039; is the ClientNum of the applying client.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -1 - the &amp;quot;your aplication has been submitted&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -2 - the &amp;quot;your aplication failed&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -3 - the &amp;quot;your aplication has been approved&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -4 - the &amp;quot;your aplication reply has been sent&amp;quot; message shows up.&lt;br /&gt;
&lt;br /&gt;
===Proposition===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;proposition&#039;&#039;&#039; &#039;&#039;Number&#039;&#039; &#039;&#039;Number2&#039;&#039;&amp;quot;&lt;br /&gt;
:&#039;&#039;&#039;proposition&#039;&#039;&#039; shows a fireteam proposition message to the client.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; &amp;gt; -1 - the &amp;quot;accept ... proposition to invite ... to your fireteam&amp;quot; message shows up. In this case &#039;&#039;Number&#039;&#039; is the ClientNum of the proposed client, and &#039;&#039;Number2&#039;&#039; is the ClientNum of the proposing player.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -1 - the &amp;quot;your proposition has been submitted&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -2 - the &amp;quot;your proposition was rejected&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -3 - the &amp;quot;your proposition was accepted&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -4 - the &amp;quot;your proposition reply has been sent&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;Number2&#039;&#039; is an optional paramater only used when &#039;&#039;Number&#039;&#039; &amp;gt; -1.&lt;br /&gt;
&lt;br /&gt;
===Invitation===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;invitation&#039;&#039;&#039; &#039;&#039;Number&#039;&#039;&amp;quot;&lt;br /&gt;
:&#039;&#039;&#039;invitation&#039;&#039;&#039; shows the fireteam invation message to the client.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; &amp;gt; -1 - the &amp;quot;accept .. invitation to join your fireteam&amp;quot; message shows up. In this case &#039;&#039;Number&#039;&#039; is the ClientNum of the applying client.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -1 - the &amp;quot;your invitation has been submitted&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -2 - the &amp;quot;your invitation rejected&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -3 - the &amp;quot;your invitation was accepted&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -4 - the &amp;quot;your invitation reply has been sent&amp;quot; message shows up.&lt;br /&gt;
&lt;br /&gt;
==Others== &lt;br /&gt;
===Complaining===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;complaint&#039;&#039;&#039; &#039;&#039;Number&#039;&#039;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;complaint&#039;&#039;&#039; shows the complaint vote message to the client.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; &amp;gt; 1 - the vote shows up. In this case &#039;&#039;Number&#039;&#039; is the ClientNum of the teamkilling player.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -1 - the &amp;quot;complaint filed&amp;quot; message shows up.&amp;lt;br&amp;gt;&lt;br /&gt;
:if &#039;&#039;Number&#039;&#039; == -2 - the &amp;quot;complaint dismissed&amp;quot; message shows up.&lt;br /&gt;
&lt;br /&gt;
===Spawning===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;setspawnpt&#039;&#039;&#039; &#039;&#039;Number&#039;&#039;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;setspawnpt&#039;&#039;&#039; sets the client game selected spawnpoint to number &#039;&#039;number&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===kicking===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;disconnect&#039;&#039;&#039; \&amp;quot;&#039;&#039;reason&#039;&#039;\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;disconnect&#039;&#039;&#039; will disconnect the client it has been send with a &amp;quot;Server disconnected&amp;quot; message&amp;lt;br&amp;gt;&lt;br /&gt;
:&#039;&#039;reason&#039;&#039; is an optialnal parameter to show a reason after &amp;quot;Server disconnected&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Configstrings===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;cs&#039;&#039;&#039; &#039;&#039;Number&#039;&#039; \&amp;quot;&#039;&#039;String&#039;&#039;\&amp;quot;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;cs&#039;&#039;&#039; will set the clients configstringnumber &#039;&#039;Number&#039;&#039; to the &#039;&#039;String&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Shaders===&lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;remapShader&#039;&#039;&#039; \&amp;quot;&#039;&#039;OldShader&#039;&#039;\&amp;quot; \&amp;quot;&#039;&#039;NewShader&#039;&#039;\&amp;quot; &#039;&#039;0&#039;&#039;&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;remapShader&#039;&#039;&#039; remaps the &#039;&#039;OldShader&#039;&#039; whit &#039;&#039;NewShader&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
: &#039;&#039;0&#039;&#039; is the Timeoffset, i have no idea wut it means so better leave it 0&lt;br /&gt;
&lt;br /&gt;
[[Category:ETPro]]&lt;br /&gt;
[[Category:ETPro:Mods]]&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Talk:Lua_Mod_API&amp;diff=2045</id>
		<title>Talk:Lua Mod API</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Talk:Lua_Mod_API&amp;diff=2045"/>
		<updated>2006-01-12T20:49:27Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;- et.G_SlotSound( slotnum, soundindex ) -&amp;gt;  Plays the sound soundindex at for the player @ slotnum only. --[[User:RoadKillPuppy|RoadKillPuppy]] 14:17, 16 December 2005 (PST)&lt;br /&gt;
:you can do this with tempentities and SVF_SINGLECLIENT ...&lt;br /&gt;
:--[[User:Bani|Bani]] 17:32, 16 December 2005 (PST)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
some of this can be done via function et_Print(text).. but this would greatly simplify life,&amp;lt;br&amp;gt;&lt;br /&gt;
my wish list for christmas:&amp;lt;br&amp;gt;&lt;br /&gt;
- eguid = getUserIAC(cno) - get a clients etpro guid - if consolecommand &amp;quot;guids&amp;quot; can do it, why not Lua&amp;lt;br&amp;gt;&lt;br /&gt;
- repair gentity_set for vec3 - scotty fix the transporter please&amp;lt;br&amp;gt;&lt;br /&gt;
:[http://bani.anime.net/banimod/forums/viewtopic.php?t=6279 fixed.]--[[User:Bani|Bani]] 17:56, 22 December 2005 (PST)&lt;br /&gt;
- et.trap_SendServerCommand(cno, &amp;quot;kill&amp;quot;) - punish client as alternative to setting health&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Hadr0|Hadr0]] 02:10, 20 December 2005 (PST)&amp;lt;br&amp;gt;&lt;br /&gt;
:You can use et.G_Damage() in the new test version to do that.--[[User:Bani|Bani]] 01:38, 23 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
trap sen server cmd is a ET engine trap the comand u send it send to the client and recived as a server command no a client command&lt;br /&gt;
&lt;br /&gt;
to add ill well that would be al ot of coding for not much [[User:=FF=im2good4u|=FF=Im2good4u]] 12:12, 20 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
aight thnx.&amp;lt;br&amp;gt;&lt;br /&gt;
heres another api request, i&#039;d like to be able to get a clients xp directly. et.gentity_get(cno, &amp;quot;sess.game_points&amp;quot;) seems to return 0 always (?)&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Hadr0|Hadr0]] 15:38, 21 December 2005 (PST)&lt;br /&gt;
:oh nevermind, i see this can be done now with xp = et.gentity_get(cno, &amp;quot;ps.stats&amp;quot;, 8)&lt;br /&gt;
:nice. . . --[[User:Hadr0|Hadr0]] 16:58, 23 December 2005 (PST)&lt;br /&gt;
--------&lt;br /&gt;
add a way to determine if a client is 999, and if possible why he&#039;s 999 (loading, connecting, loosing packets, etc)&amp;lt;br&amp;gt;&lt;br /&gt;
--Gotenks&lt;br /&gt;
&lt;br /&gt;
999 means: server has not been sent data from client for &amp;gt; 1000 ms. So there is no way to certainly tell why.&lt;br /&gt;
The timeoutflag is stored in the pmflags IIRC. Don&#039;t know if lua can read them right now. --[[User:Deus|Deus]] 23:12, 22 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Access to weapon stats during game similar to end of round stats that are displayed.&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:LethalInjection|LethalInjection]] 23:52, 22 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Still would like access to the ping, or a dummy variable if they are 999, but also the ammount of time they are inactive.&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Gotenks|Gotenks]] (Sorry for double post) 1:53, 31 December 2005 (CST)&lt;br /&gt;
&lt;br /&gt;
== IPC stuff ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
i would like a et_IPCReceive whit an return value so u can send info back on a request&lt;br /&gt;
&lt;br /&gt;
i would like a et_IPCSend that can send to all lua mods then them mods can decide if the wana use that message or not&lt;br /&gt;
[[User:=FF=im2good4u|=FF=Im2good4u]] 12:35, 8 January 2006 (PST)&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
  et_IPCReceive wouldn&#039;t send it to the other mod... afaik... so just use another send&lt;br /&gt;
  just et_IPCSend to all modules (afaik, you can even send to ones not there), simple loop function&lt;br /&gt;
[[User:gotenks|gotenks]] 20:04, 8 January 2006 (CST)&lt;br /&gt;
&lt;br /&gt;
yeh probely but its not verry handy its better to get the good vmnumber or to e able to send on mod filenames&lt;br /&gt;
&lt;br /&gt;
apart from that returning a value will be more handy since tnhe u cna contine in 1 funtion else u got to reacise it in the recieve funtion [[User:=FF=im2good4u|=FF=Im2good4u]] 10:45, 9 January 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
bani i need a console print function on the client that does sepport ascii plz [[User:=FF=im2good4u|=FF=Im2good4u]] 12:49, 12 January 2006 (PST)&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Talk:Lua_Mod_API&amp;diff=2044</id>
		<title>Talk:Lua Mod API</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Talk:Lua_Mod_API&amp;diff=2044"/>
		<updated>2006-01-12T20:49:05Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;- et.G_SlotSound( slotnum, soundindex ) -&amp;gt;  Plays the sound soundindex at for the player @ slotnum only. --[[User:RoadKillPuppy|RoadKillPuppy]] 14:17, 16 December 2005 (PST)&lt;br /&gt;
:you can do this with tempentities and SVF_SINGLECLIENT ...&lt;br /&gt;
:--[[User:Bani|Bani]] 17:32, 16 December 2005 (PST)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
some of this can be done via function et_Print(text).. but this would greatly simplify life,&amp;lt;br&amp;gt;&lt;br /&gt;
my wish list for christmas:&amp;lt;br&amp;gt;&lt;br /&gt;
- eguid = getUserIAC(cno) - get a clients etpro guid - if consolecommand &amp;quot;guids&amp;quot; can do it, why not Lua&amp;lt;br&amp;gt;&lt;br /&gt;
- repair gentity_set for vec3 - scotty fix the transporter please&amp;lt;br&amp;gt;&lt;br /&gt;
:[http://bani.anime.net/banimod/forums/viewtopic.php?t=6279 fixed.]--[[User:Bani|Bani]] 17:56, 22 December 2005 (PST)&lt;br /&gt;
- et.trap_SendServerCommand(cno, &amp;quot;kill&amp;quot;) - punish client as alternative to setting health&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Hadr0|Hadr0]] 02:10, 20 December 2005 (PST)&amp;lt;br&amp;gt;&lt;br /&gt;
:You can use et.G_Damage() in the new test version to do that.--[[User:Bani|Bani]] 01:38, 23 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
trap sen server cmd is a ET engine trap the comand u send it send to the client and recived as a server command no a client command&lt;br /&gt;
&lt;br /&gt;
to add ill well that would be al ot of coding for not much [[User:=FF=im2good4u|=FF=Im2good4u]] 12:12, 20 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
aight thnx.&amp;lt;br&amp;gt;&lt;br /&gt;
heres another api request, i&#039;d like to be able to get a clients xp directly. et.gentity_get(cno, &amp;quot;sess.game_points&amp;quot;) seems to return 0 always (?)&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Hadr0|Hadr0]] 15:38, 21 December 2005 (PST)&lt;br /&gt;
:oh nevermind, i see this can be done now with xp = et.gentity_get(cno, &amp;quot;ps.stats&amp;quot;, 8)&lt;br /&gt;
:nice. . . --[[User:Hadr0|Hadr0]] 16:58, 23 December 2005 (PST)&lt;br /&gt;
--------&lt;br /&gt;
add a way to determine if a client is 999, and if possible why he&#039;s 999 (loading, connecting, loosing packets, etc)&amp;lt;br&amp;gt;&lt;br /&gt;
--Gotenks&lt;br /&gt;
&lt;br /&gt;
999 means: server has not been sent data from client for &amp;gt; 1000 ms. So there is no way to certainly tell why.&lt;br /&gt;
The timeoutflag is stored in the pmflags IIRC. Don&#039;t know if lua can read them right now. --[[User:Deus|Deus]] 23:12, 22 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Access to weapon stats during game similar to end of round stats that are displayed.&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:LethalInjection|LethalInjection]] 23:52, 22 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Still would like access to the ping, or a dummy variable if they are 999, but also the ammount of time they are inactive.&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Gotenks|Gotenks]] (Sorry for double post) 1:53, 31 December 2005 (CST)&lt;br /&gt;
&lt;br /&gt;
== IPC stuff ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
i would like a et_IPCReceive whit an return value so u can send info back on a request&lt;br /&gt;
&lt;br /&gt;
i would like a et_IPCSend that can send to all lua mods then them mods can decide if the wana use that message or not&lt;br /&gt;
[[User:=FF=im2good4u|=FF=Im2good4u]] 12:35, 8 January 2006 (PST)&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
  et_IPCReceive wouldn&#039;t send it to the other mod... afaik... so just use another send&lt;br /&gt;
  just et_IPCSend to all modules (afaik, you can even send to ones not there), simple loop function&lt;br /&gt;
[[User:gotenks|gotenks]] 20:04, 8 January 2006 (CST)&lt;br /&gt;
&lt;br /&gt;
yeh probely but its not verry handy its better to get the good vmnumber or to e able to send on mod filenames&lt;br /&gt;
&lt;br /&gt;
apart from that returning a value will be more handy since tnhe u cna contine in 1 funtion else u got to reacise it in the recieve funtion [[User:=FF=im2good4u|=FF=Im2good4u]] 10:45, 9 January 2006 (PST)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
bani i need a console print function on the client that does sepport ascii plz&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
	<entry>
		<id>https://wolfwiki.anime.net/index.php?title=Talk:Lua_Mod_API&amp;diff=2043</id>
		<title>Talk:Lua Mod API</title>
		<link rel="alternate" type="text/html" href="https://wolfwiki.anime.net/index.php?title=Talk:Lua_Mod_API&amp;diff=2043"/>
		<updated>2006-01-09T18:45:43Z</updated>

		<summary type="html">&lt;p&gt;=FF=im2good4u: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;- et.G_SlotSound( slotnum, soundindex ) -&amp;gt;  Plays the sound soundindex at for the player @ slotnum only. --[[User:RoadKillPuppy|RoadKillPuppy]] 14:17, 16 December 2005 (PST)&lt;br /&gt;
:you can do this with tempentities and SVF_SINGLECLIENT ...&lt;br /&gt;
:--[[User:Bani|Bani]] 17:32, 16 December 2005 (PST)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
some of this can be done via function et_Print(text).. but this would greatly simplify life,&amp;lt;br&amp;gt;&lt;br /&gt;
my wish list for christmas:&amp;lt;br&amp;gt;&lt;br /&gt;
- eguid = getUserIAC(cno) - get a clients etpro guid - if consolecommand &amp;quot;guids&amp;quot; can do it, why not Lua&amp;lt;br&amp;gt;&lt;br /&gt;
- repair gentity_set for vec3 - scotty fix the transporter please&amp;lt;br&amp;gt;&lt;br /&gt;
:[http://bani.anime.net/banimod/forums/viewtopic.php?t=6279 fixed.]--[[User:Bani|Bani]] 17:56, 22 December 2005 (PST)&lt;br /&gt;
- et.trap_SendServerCommand(cno, &amp;quot;kill&amp;quot;) - punish client as alternative to setting health&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Hadr0|Hadr0]] 02:10, 20 December 2005 (PST)&amp;lt;br&amp;gt;&lt;br /&gt;
:You can use et.G_Damage() in the new test version to do that.--[[User:Bani|Bani]] 01:38, 23 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
trap sen server cmd is a ET engine trap the comand u send it send to the client and recived as a server command no a client command&lt;br /&gt;
&lt;br /&gt;
to add ill well that would be al ot of coding for not much [[User:=FF=im2good4u|=FF=Im2good4u]] 12:12, 20 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
aight thnx.&amp;lt;br&amp;gt;&lt;br /&gt;
heres another api request, i&#039;d like to be able to get a clients xp directly. et.gentity_get(cno, &amp;quot;sess.game_points&amp;quot;) seems to return 0 always (?)&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Hadr0|Hadr0]] 15:38, 21 December 2005 (PST)&lt;br /&gt;
:oh nevermind, i see this can be done now with xp = et.gentity_get(cno, &amp;quot;ps.stats&amp;quot;, 8)&lt;br /&gt;
:nice. . . --[[User:Hadr0|Hadr0]] 16:58, 23 December 2005 (PST)&lt;br /&gt;
--------&lt;br /&gt;
add a way to determine if a client is 999, and if possible why he&#039;s 999 (loading, connecting, loosing packets, etc)&amp;lt;br&amp;gt;&lt;br /&gt;
--Gotenks&lt;br /&gt;
&lt;br /&gt;
999 means: server has not been sent data from client for &amp;gt; 1000 ms. So there is no way to certainly tell why.&lt;br /&gt;
The timeoutflag is stored in the pmflags IIRC. Don&#039;t know if lua can read them right now. --[[User:Deus|Deus]] 23:12, 22 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Access to weapon stats during game similar to end of round stats that are displayed.&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:LethalInjection|LethalInjection]] 23:52, 22 December 2005 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Still would like access to the ping, or a dummy variable if they are 999, but also the ammount of time they are inactive.&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Gotenks|Gotenks]] (Sorry for double post) 1:53, 31 December 2005 (CST)&lt;br /&gt;
&lt;br /&gt;
== IPC stuff ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
i would like a et_IPCReceive whit an return value so u can send info back on a request&lt;br /&gt;
&lt;br /&gt;
i would like a et_IPCSend that can send to all lua mods then them mods can decide if the wana use that message or not&lt;br /&gt;
[[User:=FF=im2good4u|=FF=Im2good4u]] 12:35, 8 January 2006 (PST)&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
  et_IPCReceive wouldn&#039;t send it to the other mod... afaik... so just use another send&lt;br /&gt;
  just et_IPCSend to all modules (afaik, you can even send to ones not there), simple loop function&lt;br /&gt;
[[User:gotenks|gotenks]] 20:04, 8 January 2006 (CST)&lt;br /&gt;
&lt;br /&gt;
yeh probely but its not verry handy its better to get the good vmnumber or to e able to send on mod filenames&lt;br /&gt;
&lt;br /&gt;
apart from that returning a value will be more handy since tnhe u cna contine in 1 funtion else u got to reacise it in the recieve funtion [[User:=FF=im2good4u|=FF=Im2good4u]] 10:45, 9 January 2006 (PST)&lt;/div&gt;</summary>
		<author><name>=FF=im2good4u</name></author>
	</entry>
</feed>