Jump to content

How can I ask whether item is equipped or not?


Recommended Posts

  • Premium
bool CHARACTER::EquipItem([...])
{
    [...]
    if (item->GetType() == ITEM_COSTUME && item->GetSubType() >= COSTUME_BELL)
	{
		if (!GetWear(WEAR_WEAPON))
		{
			return false;
		}
	}
}

 

 

Doesn't work.

 

function: disable equipping costume weapons, when weapons aren't worn.

Edited by .Avenue™
Link to comment
Share on other sites

  • Premium

try this

 

	...
	
	
	if (item->GetType() == ITEM_COSTUME && item->GetSubType() >= COSTUME_BELL && item->GetSubType() <= COSTUME_TWO_HANDED)
	{
		LPITEM lpWeapon = GetWear(WEAR_WEAPON);
		if (lpWeapon == NULL)
			return false;
		
	...

 

I've already fixed it. I pasted the code on wrong place.

Can you add me please in Skype? (mravenue.epvp) I've got a question

Link to comment
Share on other sites

try this

 

	...
	
	
	if (item->GetType() == ITEM_COSTUME && item->GetSubType() >= COSTUME_BELL && item->GetSubType() <= COSTUME_TWO_HANDED)
	{
		LPITEM lpWeapon = GetWear(WEAR_WEAPON);
		if (lpWeapon == NULL)
			return false;
		
	...

 

I've already fixed it. I pasted the code on wrong place.

Can you add me please in Skype? (mravenue.epvp) I've got a question


Another problem fix


 

bool CHARACTER::UnequipItem(LPITEM item)
{

    [...]
    if (item->GetType() == ITEM_WEAPON)
	{
		if (GetWear(WEAR_COSTUME_WEAPON))
		{
			ChatPacket(CHAT_TYPE_INFO, "Remove the first costume weapons");
			return false;
		}
	}
}

 

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.