Pages: 1 2 3 4 5 6 7 8 9 10 11
I'm currently working on enchanting for mcserver.
Working:
- opening window
- drop item in the slot 0 when the player close the window
Current Question: How can i send the three enchanting fields to the player?
(01-19-2014, 09:17 PM)STR_Warrior Wrote: [ -> ]Thugie is also working on this.
Ah yes i see now his thread.
(01-19-2014, 09:17 PM)STR_Warrior Wrote: [ -> ]It seems you have to use the cWindow:SetPropertie function.
Thanks.
SetProperty is working. Now the enchantments are available.
Now i must get if a item in the slot. I tried:
Code:
if (this->m_ParentWindow.GetSlot(a_Player, 0)->m_ItemType == -1)
But with this the slot is always empty.
Now I'm checking for items who can be enchanted.
Sometimes this isn't working:
Code:
if (this->m_ParentWindow.GetSlot(a_Player, 0)->m_ItemType == 268)
This check for a wooden sword. But sometimes it is the itemtype -1 and not 268..
Give it a other method for the checking?
itemtype -1 means there is no item there, it's empty.
Also, you should use E_ITEM_WOODEN_SWORD instead of 268
Instead of checking if m_ItemType is -1, you should use the IsEmpty() function. An empty item may be also one that has a valid m_ItemType, but the m_ItemCount is zero.
Okay, but when i click on the item in the console it comes the message that the item is a wooden sword but when i do the item in the enchant slot it is -1. But when i click on the item then it is a wooden sword. Have someone a idea why?
How can i get the item which is currently in the enchantment table?
There is a GetSlot() function.
(01-20-2014, 03:05 AM)tonibm19 Wrote: [ -> ]There is a GetSlot() function.
I use this. But often when i put a sword into the enchantment table it returns -1 and not the item..
Code:
this->m_ParentWindow.GetSlot(a_Player, 0)->m_ItemType
2. Question:
How can i delete the property? because when you put the item out the enchantments should be away.
I tried:
Code:
this->m_ParentWindow.SetProperty(0, NULL);
this->m_ParentWindow.SetProperty(1, NULL);
this->m_ParentWindow.SetProperty(2, NULL);
Enchanting Packet is also added to the 1.7 Protocol.
try
this->m_ParentWindow.SetProperty(0, nil);
this->m_ParentWindow.SetProperty(1, nil);
this->m_ParentWindow.SetProperty(2, nil);
Pages: 1 2 3 4 5 6 7 8 9 10 11