Converting cEntity to cPlayer
#1
Hey,

I am messing arount with your software as it seems pretty nice and powerful.

But I have one problem: How do I convert an entity from the hook to a player?

In Java I get an Entity object from the Event (PlayerInteractEntityEvent in this case).
And then I can convert that to a Player: (Player)event.getEntity()

How do I do that in Lua?
Code:
function PlayerInteract(Player, Entity)
  if Entity:GetEntityType() == cEntity.etPlayer and Player:GetInventory():GetEquippedItem().m_ItemType == 369 then
    Player:SendMessage("§a" .. "..Name of Entity")
  end
end

Sorry for my nooby questions, but I am new to Lua and MCServer :)
Reply
Thanks given by:


Messages In This Thread
Converting cEntity to cPlayer - by TuxGamer - 06-20-2014, 04:30 AM
RE: Converting cEntity to cPlayer - by bearbin - 06-20-2014, 04:33 AM
RE: Converting cEntity to cPlayer - by tigerw - 06-20-2014, 04:34 AM
RE: Converting cEntity to cPlayer - by TuxGamer - 06-20-2014, 04:38 AM



Users browsing this thread: 3 Guest(s)