From d79f601d5a62f2291615955fac196dbab5caa15a Mon Sep 17 00:00:00 2001
From: Nounours Heureux
Date: Tue, 2 Jun 2015 17:06:18 +0200
Subject: Added HOOK_KILLED
---
MCServer/Plugins/APIDump/Hooks/OnKilling.lua | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
(limited to 'MCServer/Plugins/APIDump/Hooks')
diff --git a/MCServer/Plugins/APIDump/Hooks/OnKilling.lua b/MCServer/Plugins/APIDump/Hooks/OnKilling.lua
index 5e84009db..d2339e60b 100644
--- a/MCServer/Plugins/APIDump/Hooks/OnKilling.lua
+++ b/MCServer/Plugins/APIDump/Hooks/OnKilling.lua
@@ -7,11 +7,7 @@ return
Desc = [[
This hook is called whenever a {{cPawn|pawn}}'s (a player's or a mob's) health reaches zero. This
means that the pawn is about to be killed, unless a plugin "revives" them by setting their health
- back to a positive value.
-
- FIXME: There is no HOOK_KILLED notification hook yet; this is deliberate because HOOK_KILLED has
- been recently renamed to HOOK_KILLING, and plugins need to be updated. Once updated, the HOOK_KILLED
- notification will be implemented.
+ back to a positive value.
]],
Params =
{
--
cgit v1.2.3
From ee28d718392da59cfbd80a57271e62798ce01a12 Mon Sep 17 00:00:00 2001
From: Nounours Heureux
Date: Tue, 9 Jun 2015 17:37:59 +0200
Subject: Added documentation for HOOK_KILLED
---
MCServer/Plugins/APIDump/Hooks/OnKilled.lua | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 MCServer/Plugins/APIDump/Hooks/OnKilled.lua
(limited to 'MCServer/Plugins/APIDump/Hooks')
diff --git a/MCServer/Plugins/APIDump/Hooks/OnKilled.lua b/MCServer/Plugins/APIDump/Hooks/OnKilled.lua
new file mode 100644
index 000000000..2eaf23904
--- /dev/null
+++ b/MCServer/Plugins/APIDump/Hooks/OnKilled.lua
@@ -0,0 +1,22 @@
+return
+{
+ HOOK_KILLED =
+ {
+ CalledWhen = "A player or a mob died.",
+ DefaultFnName = "OnKilled",
+ Desc = [[
+ This hook is called whenever player or a mob dies. It can be used to change the death message.
+ ]]
+ Params =
+ {
+ { Name = "Victim", Type = "{{cEntity}}", Notes = "The player or mob that died" },
+ { Name = "TDI", Type = "{{TakeDamageInfo}}", Notes = "Informations about the death" },
+ { Name = "DeathMessage", Type = "string", Notes = "The default death message. An empty string if the victim is not a player" },
+ },
+ Returns = [[
+ The function may return two values. The first value is a boolean specifying whether other plugins should be called. If it is true, the other plugins won't get notified of the death. If it is false, the other plugins will get notified.
+ The second value is a string containing the death message. If the victim is a player, this death message is broadcasted instead of the default death message. If it is empty, no death message is broadcasted. If it is nil, the message is left unchanged. If the victim is not a player, the death message is never broadcasted.
+ In either case, the victim is dead.
+ ]],
+ }, -- HOOK_KILLED
+}
--
cgit v1.2.3