Posts: 10
	Threads: 1
	Joined: Aug 2016
	
Thanks: 0 
	 
	
		
		
		08-29-2016, 10:25 PM 
(This post was last modified: 08-29-2016, 10:57 PM by xoft .) 
  
		
	 
	
		
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
 
(Edited by xoft to add formatting)
	
 
	
	
	
	
 
 
	
	
	
		
	Posts: 6,482
	Threads: 176
	Joined: Jan 2012
	
Thanks: 131 
	 
	
	
		Hello, welcome to the forum.
	
	
	
	
 
 
	
	
	
		
	Posts: 10
	Threads: 1
	Joined: Aug 2016
	
Thanks: 0 
	 
	
	
		 (08-29-2016, 10:56 PM) xoft Wrote:  
Callback is not executed
	
 
	
	
	
	
 
 
	
	
	
		
	Posts: 223
	Threads: 40
	Joined: Aug 2015
	
Thanks: 22 
	 
	
		
		
		08-30-2016, 01:23 AM 
(This post was last modified: 08-30-2016, 01:28 AM by DrMasik .) 
  
		
	 
	
		 (08-30-2016, 01:22 AM) as123456 Wrote:   (08-29-2016, 10:56 PM) xoft Wrote:  
You must register hook before use
cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_RIGHT_CLICK, MyOnPlayerRightClick);
And rename your function OnPlayerRightClick to 
My OnPlayerRightClick
	
 
	
	
	
	
 
 
	
	
	
		
	Posts: 10
	Threads: 1
	Joined: Aug 2016
	
Thanks: 0 
	 
	
	
		 (08-30-2016, 01:23 AM) DrMasik Wrote:   (08-30-2016, 01:22 AM) as123456 Wrote:   (08-29-2016, 10:56 PM) xoft Wrote:  I Register!
	
 
	
	
	
	
 
 
	
	
	
		
	Posts: 223
	Threads: 40
	Joined: Aug 2015
	
Thanks: 22 
	 
	
	
		 (08-30-2016, 01:27 AM) as123456 Wrote:  
Show all your code
	
 
	
	
	
	
 
 
	
	
	
		
	Posts: 10
	Threads: 1
	Joined: Aug 2016
	
Thanks: 0 
	 
	
		
		
		08-30-2016, 01:30 AM 
(This post was last modified: 08-30-2016, 01:31 AM by as123456 .) 
  
		
	 
	
		Code:
PLUGIN = {}    -- Reference to own plugin object
 
	
	
	
	
 
 
	
	
	
		
	Posts: 223
	Threads: 40
	Joined: Aug 2015
	
Thanks: 22 
	 
	
		
		
		08-30-2016, 01:38 AM 
(This post was last modified: 08-30-2016, 01:40 AM by DrMasik .) 
  
		
	 
	
		 (08-30-2016, 01:30 AM) as123456 Wrote:  Code:
PLUGIN = {}    -- Reference to own plugin object
Replace ":" to "."
cPluginManager
: AddHook(cPluginManager.HOOK_TAKE_DAMAGE, OnTakeDamage); => cPluginManager
. AddHook(cPluginManager.HOOK_TAKE_DAMAGE, OnTakeDamage);
It's not C++ 
 
	
	
	
	
 
 
	
	
	
		
	Posts: 10
	Threads: 1
	Joined: Aug 2016
	
Thanks: 0 
	 
	
		
		
		08-30-2016, 01:41 AM 
(This post was last modified: 08-30-2016, 01:42 AM by as123456 .) 
  
		
	 
	
		 (08-30-2016, 01:38 AM) DrMasik Wrote:   (08-30-2016, 01:30 AM) as123456 Wrote:  Code:
PLUGIN = {}    -- Reference to own plugin object
: .  
	
	
	
	
 
 
	
	
	
		
	Posts: 10
	Threads: 1
	Joined: Aug 2016
	
Thanks: 0 
	 
	
		
		
		08-30-2016, 01:43 AM 
(This post was last modified: 08-30-2016, 01:44 AM by as123456 .) 
  
		
	 
	
		Not the reason!
	
	
Attached Files Thumbnail(s)