===== Create a new Script File =====
To add a new command you must create a text file and name it without violating specific rules. The filename is parsed and decides what the command name is and what restrictions are on the command. This file must also be created within a certain directory or subdirectory. Browse to the following directory and create a new text file:

  GameServer/Data/Scripts/Console

Follow the following syntax when naming the file.

  <Command Name>[<Restricted><Context>].gws

^ Property ^ Values ^ Explanation ^
| <Command Name> | Cannot be: all, none, or any hard coded command name. | The name of the command. /age would be age |
| <Restricted> | 0 = Not Restricted, 1 = Restricted | If not restricted anyone can use this command. If it is, this command follows rules in the group permissions. |
| <Context> | 0 = In-game Only, 1 = Admin Console Only, 2 = Both | This specifies where this command can be executed from. If in-game only, the command can only be executed by a logged in player that is using the in-game chat. A good example is /jump. While on the other hand, Admin console only, only allows those with access to the admin console to execute the command. |

Example command filename
  spam[00].gws

Note: The entire filename should be lowercase.

===== Function Declaration =====
Next your file needs script. In order for the server to correctly execute your script, your function declaration must following certain naming rules. Your function name should be your <Command Name> preceded by "console_" 

Example
  console_spam

Parameters sent to the script occur in the following order. 
  -Command arguments. Arg zero is the command. Up to 8 of them. Access each one by: args[X] where X is a number.
  -NetworkID, the network ID of the client. Don't mess with this. However, some functions require it.
  -Admin console is an int specifying where this is being called from. 0=in-game console  1=admin console

Example of a proper function declaration:

<code c++>
//This is a comment
global console_spam=function(args,NetworkID,adminConsole)
{
     //Script code goes here
};
</code>

That's it. Review the game server log files to make sure it is registered properly. Otherwise, have fun scripting.
