[Crossfire-wiki] [Crossfire DokuWiki] page changed: cfpython

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Fri Nov 24 10:51:19 CST 2006


A page in your DokuWiki was added or changed. Here are the details:

Date        : 2006/11/24 10:51
User        : ryo
Edit Summary: point to command instead of detailing here

@@ -33,25 +33,13 @@
  
  Create a script, and put it in the ''/python/events/xxx'' subdirectory or the ''maps'' directory, where ''xxx'' is the event's name in lowercase (create the directory if it doesn't exist). Available events are listed [[server_plugin#Hooking to global events|on the server_plugin page]].
  
  In addition, there is a special event, ''init'', which is called just after the plugin has been loaded. It behaves like other events in every aspect.
+ 
  
  ===== How do I register a custom command? =====
  
- To register a command, a script should call the ''Crossfire.RegisterCommand'' method, proving three arguments:
-   * command name
-   * script to execute for the command
-   * command speed (double value), which mustn't be negative
- 
- When a player issues the command, the script is called with the following arguments:
-   * ''WhoAmI'' contains the player
-   * ''ScriptName'' contains the currently executing script's name
-   * ''ScriptParameters'' contains any parameter the player added to the command. FIXME {can NULL be passed?}
- 
- It is possible to override a built-in server command by specifying an existing command name.
- FIXME {check that}
- 
- There is no way to unregister a command.
+ Check ''[[cfpython#RegisterCommand|Crossfire.RegisterCommand]]''.
  
  ===== Return value =====
  
  The return value of the script can manipulated through the ''GetReturnValue'' and ''SetReturnValue'' functions. Signification of this value depends on the event being handled.


IP-Address  : 213.174.127.3
Old Revision: http://wiki.metalforge.net/doku.php/cfpython?rev=1164386018
New Revision: http://wiki.metalforge.net/doku.php/cfpython

-- 
This mail was generated by DokuWiki at
http://wiki.metalforge.net/




More information about the crossfire-wiki mailing list