callback DoWithBlockEntityAt why not work
#8
(08-30-2016, 01:30 AM)as123456 Wrote:
Code:
PLUGIN = {}    -- Reference to own plugin object
CHEST_WIDTH = 9
HANDY_VERSION = 1

function Initialize(Plugin)
PLUGIN = Plugin
PLUGIN:SetName("Reap")
PLUGIN:SetVersion(HANDY_VERSION)

cPluginManager:AddHook(cPluginManager.HOOK_TAKE_DAMAGE, OnTakeDamage);

--cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_RIGHT_CLICKING_ENTITY, OnPlayerRightClickingEntity);

cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_RIGHT_CLICK, OnPlayerRightClick);

-- Registers the commands found in Info.lua
--RegisterPluginInfoCommands()    

LOG("Initialized " .. PLUGIN:GetName() .. " v" .. PLUGIN:GetVersion())
return true
end

function OnDisable()
LOG(PLUGIN:GetName() .. " v" .. PLUGIN:GetVersion() .. " is shutting down...")
end
function OnPlayerRightClick(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ)

local world=Player:GetWorld()

world:DoWithBlockEntityAt(BlockX, BlockY, BlockZ,
function  (a_BlockEntity)
LOG(a_BlockEntity:GetBlockType())
end

)
LOG("End")
return false
end

Replace ":" to "."
cPluginManager:AddHook(cPluginManager.HOOK_TAKE_DAMAGE, OnTakeDamage); => cPluginManager.AddHook(cPluginManager.HOOK_TAKE_DAMAGE, OnTakeDamage);

It's not C++ Wink
Reply
Thanks given by:


Messages In This Thread
RE: callback DoWithBlockEntityAt why not work - by DrMasik - 08-30-2016, 01:38 AM



Users browsing this thread: 4 Guest(s)