Countdown
#11
(01-13-2014, 02:40 AM)xoft Wrote: You know, you don't need to quote everything when it's right above your post, the forum then becomes a chaos of quotes inside quotes inside quotes. Consider this a conversation, and only quote if you want to react to something very specific and older in the conversation.

I modified the last post. Sorry.
Reply
Thanks given by:
#12
Old habits die hard Smile

I don't quite understand your question. What with blocks with unknown type? You can just compare block types to numbers directly; but I believe we have (almost) all vanilla blocks defined - have a look at the $/src/BlockID.h file, there's a list of block types that the server understands in the Lua scripts.
Reply
Thanks given by:
#13
@xoft
Yes Smile.

I made that when i break a block in the chat will be writed the id.
But when i break a cake or fire it says the id 0.

For leaves i use this:
function OnPlayerBreakingBlock(Player, BlockX, BlockY, BlockZ, BlockFace, BlockType, BlockMeta)
	if (BlockType == 18) then --Leaves
		return false;
	end
Reply
Thanks given by:
#14
Cake and fire blocks need special handling, which is not yet implemented by MCServer. So the client sends a "break block" packet that specifies "interacting with the fire's north side", for example, and MCServer's default action to "breaking while interacting with the block's north side" is "dig the block north of the interacted blocks". Which means MCServer will actually try to dig the air block next to the fire - that's why you're getting "air" for the block's type. Cake is probably similar.

I don't think there's an easy way to fix this in a plugin. Should you wish to, you can add the proper handling to the fire block handler, thus eliminating this bug altogether.
Reply
Thanks given by:
#15
@xoft
Thanks maybe i will try it later for that.

I did't find any Player:SetLevel or Player:SetXPLevel method in the documentation. How can i set the level?
Reply
Thanks given by:
#16
You can use "DeltaExperience" for that
Reply
Thanks given by:
#17
(01-13-2014, 04:27 AM)STR_Warrior Wrote: You can use "DeltaExperience" for that

How can i change between removing or adding experience?
So to delete all levels:
Player:DeltaExperience(Player:GetXpLevel());

And how can i create a item with a custom name to add this in the player inventory?
Reply
Thanks given by:
#18
I think if you want to delete everything you have to use
Player:DeltaExperience(-Player:GetCurrentXp())
(not completely sure though)
Reply
Thanks given by: daniel0916
#19
Do you know to edit the Item's name?
I saw the example code on the cItem site.
Reply
Thanks given by:
#20
You mean custom names for items? No MCServer doesn't support that yet.
Reply
Thanks given by:




Users browsing this thread: 5 Guest(s)