[Crossfire-wiki] [Crossfire DokuWiki] page changed: cfpython
no-reply_wiki at metalforge.org
no-reply_wiki at metalforge.org
Fri Nov 24 09:52:50 CST 2006
A page in your DokuWiki was added or changed. Here are the details:
Date : 2006/11/24 09:52
User : ryo
Edit Summary: link instead of list
@@ -24,31 +24,16 @@
Python plugin is a [[server plugin]], thus you need to insert in this object one of the //event_xxx// archetype (see ''arch/system'' directory). The fields to fill are:
* **title** : should be //Python// to call the Python plugin.
* **slaying** : contains the path to the Python script to execute. Root refers to the map directory.
+
===== How do I hook a script to a global event? =====
- Create a script, and put it in the ''/maps/trunk/python/events/xxx'' subdirectory, where ''xxx'' is the event's name. Existing events are:
- * born
- * clock
- * death
- * gkill
- * init
- * kick
- * login
- * logout
- * mapenter
- * mapleave
- * mapload
- * mapreset
- * mapunload
- * muzzle
- * remove
- * shout
- * tell
+ Create a script, and put it in the ''/python/events/xxx'' subdirectory or the ''maps'' directory, where ''xxx'' is the event's name. Existing 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:
IP-Address : 213.174.127.3
Old Revision: http://wiki.metalforge.net/doku.php/cfpython?rev=1164382430
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