This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
wiki:data:pages:server_plugin [2013/07/23 14:33] 127.0.0.1 external edit |
wiki:data:pages:server_plugin [2020/10/15 03:47] ryo [Hooking to global events] |
||
---|---|---|---|
Line 79: | Line 79: | ||
* bound to an arrow, it is triggered when the arrow hits something. "op" is the arrow, "activator" what really hits (arrow can have stuff inside), "third" is the victim. Returning a non-zero value cancels the attack | * bound to an arrow, it is triggered when the arrow hits something. "op" is the arrow, "activator" what really hits (arrow can have stuff inside), "third" is the victim. Returning a non-zero value cancels the attack | ||
+ | ==== Bought ==== | ||
+ | Archetype: event_bought | ||
+ | |||
+ | This event is triggered when the associated object was paid by a player, but not yet marked as paid. | ||
+ | |||
+ | "op" is the item being bought, "activator" is the player buying. | ||
+ | |||
+ | Returning a non-zero value leaves the item as unpaid and prevents the player from buying still unpaid items. | ||
==== Close ==== | ==== Close ==== | ||
Archetype: event_close | Archetype: event_close | ||
Line 89: | Line 97: | ||
Generated when the object dies. | Generated when the object dies. | ||
+ | ==== Destroy ==== | ||
+ | Archetype: event_destroy | ||
+ | |||
+ | Used when the object is totally destroyed, either by a map reset or destruction by another item. | ||
+ | |||
+ | "op" is the object being destroyed. | ||
+ | |||
+ | The return value is ignored. | ||
==== Drop ==== | ==== Drop ==== | ||
Archetype: event_drop | Archetype: event_drop | ||
Line 150: | Line 166: | ||
Generated when the timer connected triggered. | Generated when the timer connected triggered. | ||
+ | ==== User ==== | ||
+ | Archetype: event_user | ||
+ | |||
+ | Only triggered through a plugin call. This event can represent anything. | ||
+ | "op" is the object on which the event is triggered, other parameters are specific to the use-case. | ||
===== Hooking to global events ===== | ===== Hooking to global events ===== | ||
Line 161: | Line 182: | ||
| Clock | Generated at each game loop. | (none) | When no player is logged, the loop "stops", meaning that clock events are not generated anymore! | | | Clock | Generated at each game loop. | (none) | When no player is logged, the loop "stops", meaning that clock events are not generated anymore! | | ||
| Crash | Generated when a server crash does occur. It is not a recursive event, so if a crash occur from *inside* the crash event handling, it is not called a second time, preventing infinite loops to occur. | (none) | This event is not implemented for now. | | | Crash | Generated when a server crash does occur. It is not a recursive event, so if a crash occur from *inside* the crash event handling, it is not called a second time, preventing infinite loops to occur. | (none) | This event is not implemented for now. | | ||
- | | Gdeath | Generated whenever a player dies. | ''object*'' pointing to player, ''object*'' pointing to killer (can be NULL). | | | ||
| Gkill | Generated whenever something/someone is killed. | ''object*'' pointing to dead object, ''object*'' pointing to killer. | | | | Gkill | Generated whenever something/someone is killed. | ''object*'' pointing to dead object, ''object*'' pointing to killer. | | | ||
| Kick | Generated when a player was kicked by a DM. | ''object*'' pointing to kicked player, ''const char*'' containing the parameter the DM used to kick | | | | Kick | Generated when a player was kicked by a DM. | ''object*'' pointing to kicked player, ''const char*'' containing the parameter the DM used to kick | | | ||
Line 172: | Line 192: | ||
| Mapunload | Generated when a map is being unloaded from memory. | ''map*'' pointing to the map | | | | Mapunload | Generated when a map is being unloaded from memory. | ''map*'' pointing to the map | | | ||
| Muzzle | Generated when a player was muzzled by a DM. | ''object*'' pointing to muzzled player, ''const char*'' containing the parameter the DM used to muzzle | | | | Muzzle | Generated when a player was muzzled by a DM. | ''object*'' pointing to muzzled player, ''const char*'' containing the parameter the DM used to muzzle | | | ||
+ | | Playerdeath | Generated whenever a player dies. | ''object*'' pointing to player, ''object*'' pointing to killer (can be NULL). | | | ||
| Remove | Generated when a player character is removed from the game ("quit" command). | ''object*'' pointing to the player | | | | Remove | Generated when a player character is removed from the game ("quit" command). | ''object*'' pointing to the player | | | ||
| Shout | Generated whenever someone shouts something. | ''object*'' pointing to talking player, ''const char*'' containing the message, ''int'' containing the priority | | | | Shout | Generated whenever someone shouts something. | ''object*'' pointing to talking player, ''const char*'' containing the message, ''int'' containing the priority | | |