Jump to content
×
×
  • Create New...
  • 0

How can I ask whether item is equipped or not?


.Avenue™

Question

  • 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

6 answers to this question

Recommended Posts

  • 0

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;
		
	...

 

Link to comment
Share on other sites

  • 0
  • 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

  • 0

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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.