• 0
Sign in to follow this  
NexuS

Control trade with GM

Question

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?

Share this post


Link to post
Share on other sites

10 answers to this question

  • 0

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.

  • Like 3

Share this post


Link to post
Share on other sites
  • 0

 

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

Share this post


Link to post
Share on other sites
  • 0

 

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

 

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

creating a new function will be better

IsLowGM as an example

it will return a boolean value

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

Edited by metin2team

Share this post


Link to post
Share on other sites
  • 0

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 ?

Share this post


Link to post
Share on other sites
  • 0

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

 

Share this post


Link to post
Share on other sites
  • 0

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 ?

DRY.

Share this post


Link to post
Share on other sites
  • 0

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) 

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.