Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

How to include a bool between 2 files?

Experienced Elementalist
Joined
Sep 14, 2011
Messages
265
Reaction score
6
So i tried to make /specialitem command which disable specialitems in wheel.
Its my first command so idk how to do that o_O
ZChat_cmds.cpp:
Code:
void ChatCmd_DisableSpecial(const char* line, const int argc, char **const argv)
{
bool bSpecialTrue = false;
if(bSpecialTrue = false)
{
	bSpecialTrue = true;
  ZChatOutput("^1Special item mode has been enabled.", ZChat::CMT_SYSTEM);
}
else
{
bSpecialTrue = false;
  ZChatOutput("^1Special item mode has been disabled.", ZChat::CMT_SYSTEM);
}
}

ZgameInterface.cpp:
Code:
	if(bSpecialTrue) {
		for(int i = MMCIP_MELEE; i < MMCIP_SECONDARY + 1; i++) {
			if (!pChar->GetItems()->GetItem((MMatchCharItemParts)i)->IsEmpty()) {
				if(pChar->GetItems()->GetSelectedWeaponParts() == i)
					nPos = nHasItemCount;
				ItemQueue[nHasItemCount++] = i;
			}
		}
	}
	else
	{
	
		for(int i = MMCIP_MELEE; i < MMCIP_CUSTOM2 + 1; i++)
		{
			if (!pChar->GetItems()->GetItem((MMatchCharItemParts)i)->IsEmpty())
			{
				if(pChar->GetItems()->GetSelectedWeaponParts() == i)
					nPos = nHasItemCount;

				ItemQueue[nHasItemCount++] = i;
			}
		}

	}

Errors :
c:\users\X\desktop\gunz pserver\perfectsource\gunz\ZGameInterface.cpp(3795): error C2065: 'bSpecialTrue' : undeclared identifier
c:\Users\X\Desktop\Gunz Pserver\PerfectSource\Gunz\ZGameInterface.cpp(3795): error C2065: 'bSpecialTrue' : undeclared identifier
 
Newbie Spellweaver
Joined
Sep 13, 2012
Messages
99
Reaction score
46
ZGameinterface.cpp
PHP:
extern bool bSpecialTrue = false;

And have others errors ;)
 
Upvote 0
Back
Top