From 3531bdb60b858a232f23bb8651b75afcd79e57e5 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 2 Aug 2013 08:44:06 +0200 Subject: Implemented OnPlayerRightClickingEntity() hook Fixes FS 425 --- MCServer/Plugins/Debuggers/Debuggers.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua index ab3397f74..f26b9a98d 100644 --- a/MCServer/Plugins/Debuggers/Debuggers.lua +++ b/MCServer/Plugins/Debuggers/Debuggers.lua @@ -21,7 +21,8 @@ function Initialize(Plugin) PluginManager:AddHook(Plugin, cPluginManager.HOOK_TAKE_DAMAGE); PluginManager:AddHook(Plugin, cPluginManager.HOOK_TICK); PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHAT); - + PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_RIGHT_CLICKING_ENTITY); + PluginManager:BindCommand("/le", "debuggers", HandleListEntitiesCmd, "Shows a list of all the loaded entities"); PluginManager:BindCommand("/ke", "debuggers", HandleKillEntitiesCmd, "Kills all the loaded entities"); PluginManager:BindCommand("/wool", "debuggers", HandleWoolCmd, "Sets all your armor to blue wool"); @@ -484,6 +485,15 @@ end +function OnPlayerRightClickingEntity(a_Player, a_Entity) + LOG("Player " .. a_Player:GetName() .. " right-clicking entity ID " .. a_Entity:GetUniqueID() .. ", a " .. a_Entity:GetClass()); + return false; +end + + + + + -- Function "round" copied from http://lua-users.org/wiki/SimpleRound function round(num, idp) local mult = 10^(idp or 0) -- cgit v1.2.3