Jump to content

Control trade with GM


Recommended Posts

Hi!

I want disable trading with GMs

well its looks like:

exchange.cpp (def. line 61)

	if(strstr(victim->GetName(), "["))
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't trade with admins"));
		return false;
	}

Yes thats right, but if GM isn't the victim it doesn't works.
 

Modify like this:

if(strstr(victim->GetName(), "[") || strstr(pOwner->GetName(), "["))

But the pOwner is not declared yet.

How can i solve this?

Link to comment
Share on other sites

 

Open exchange.cpp

Search:

 

bool CHARACTER::ExchangeStart(LPCHARACTER victim)
{


Add:

 

	if (GetGMLevel() > GM_PLAYER)
	{
		ChatPacket(CHAT_TYPE_INFO, "Simple text");
		return false;
	}
	
	if (victim->GetGMLevel() > GM_PLAYER)
	{
		ChatPacket(CHAT_TYPE_INFO, "Simple text");
		return false;
	}


Best Regards Rideas.

 

Could i disabled Trade,drop items,open safebox,open privateshop etc.. but only  for low GM.If i am IMPLEMENTOR(FULL_GM_RIGHTS) enabled trade,safebox etc...

 

sorry for my english

Edited by CloseSource
Link to comment
Share on other sites

 

Open exchange.cpp

Search:

 

bool CHARACTER::ExchangeStart(LPCHARACTER victim)
{


Add:

 

	if (GetGMLevel() > GM_PLAYER)
	{
		ChatPacket(CHAT_TYPE_INFO, "Simple text");
		return false;
	}
	
	if (victim->GetGMLevel() > GM_PLAYER)
	{
		ChatPacket(CHAT_TYPE_INFO, "Simple text");
		return false;
	}


Best Regards Rideas.

 

Could i disabled Trade,drop items,open safebox,open privateshop etc.. but only  for low GM.If i am IMPLEMENTOR(FULL_GM_RIGHTS) enabled trade,safebox etc...

 

sorry for my english

open input_main.cpp

Search:


 

void CInputMain::SafeboxCheckout(LPCHARACTER ch, const char * c_pData, bool bMall)
{
	TPacketCGSafeboxCheckout * p = (TPacketCGSafeboxCheckout *) c_pData;

	if (!ch->CanHandleItem())
		return;

	CSafebox * pkSafebox;

	if (bMall)
		pkSafebox = ch->GetMall();
	else
		pkSafebox = ch->GetSafebox();

	if (!pkSafebox)
		return;

	LPITEM pkItem = pkSafebox->Get(p->bSafePos);

	if (!pkItem)
		return;
	
	if (!ch->IsEmptyItemGrid(p->ItemPos, pkItem->GetSize()))
		return;


Add:

 

	if (ch->GetGMLevel() > GM_PLAYER)
	{
			ch->ChatPacket(CHAT_TYPE_INFO, "Simple text");
			return;
	}


open char_item.cpp

Search:

 

bool CHARACTER::DropItem(TItemPos Cell, BYTE bCount)
{
	LPITEM item = NULL; 

Add:

 

	if (GetGMLevel() > GM_PLAYER)
	{
		ChatPacket(CHAT_TYPE_INFO, "|cFFff0000|H|h<GameMaster> GameMaster'lar ticaret yapamaz ve yere item atamazlar !");
		return false;
	}

Open char.cpp

Search:

 

void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, BYTE bItemCount)
{
	if (GetPart(PART_MAIN) > 2)
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("갑옷을 벗어야 개인 상점을 열 수 있습니다."));
		return;
	}


Add:

 

	if (GetGMLevel() > GM_PLAYER)
	{
		ChatPacket(CHAT_TYPE_INFO, "Simple text");
		return;
	}
	

 

  • Love 1
Link to comment
Share on other sites

creating a new function will be better

IsLowGM as an example

it will return a boolean value

return (GetGMLevel() > GM_PLAYER && GetGMLevel() < GM_IMPLEMENTOR);

What is the point ?

qB5mLZp.thumb.png.68d82ab534985489957b2ai want LOW_WIZARD - Hight_WIZARD disabled trade,drop,safebox.... and IMPLEMENTOR Enabled

 

if (GetGMLevel() < GM_IMPLEMENTOR & & GetGMLevel() > GM_PLAYER) 

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

Announcements



×
×
  • 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.