Jump to content
  • We need you!

    You must register to discover all the features of our community!

GameMaster restriction[no sql query]


Recommended Posts

  • VIP
Posted (edited)

First u need the IsLowGM function.

//char.cpp
add under
BOOL CHARACTER::IsGM() const

this
BOOL CHARACTER::IsLowGM() const
{
	return m_pointsInstant.gm_level > GM_PLAYER && m_pointsInstant.gm_level > GM_HIGH_WIZARD && m_pointsInstant.gm_level < GM_IMPLEMENTOR;
}

//char.h
add under
BOOL 			IsGM() const;

this
BOOL			IsLowGM() const;

now let's restrict some actions for GM

//char.cpp
void CHARACTER::PartyInvite(LPCHARACTER pchInvitee)
 add under
 	else if (pchInvitee->IsBlockMode(BLOCK_PARTY_INVITE))
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<ÆÄƼ> %s ´ÔÀÌ ÆÄƼ °ÅºÎ »óÅÂÀÔ´Ï´Ù."), pchInvitee->GetName());
		return;
	}
	
this

	else if (IsLowGM() == true && pchInvitee->IsLowGM() == false)
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<Party> You cannot send a party invitation to a player!"));
		return;
	}
	else if (IsLowGM() == false && pchInvitee->IsLowGM() == true)
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<Party> You cannot send a party invitation to a GameMaster!"));
		return;
	}

void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, BYTE bItemCount)
add
	if (IsLowGM())
	{
		ChatPacket(CHAT_TYPE_INFO, "You can't open shop! You are GM!");
		return;
	}
//end char.cpp

//exchange.cpp
bool CHARACTER::ExchangeStart(LPCHARACTER victim)
add
	if (!IsLowGM() && victim->IsLowGM())
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot trade items with a Game Master."));
		return false;
	}
	if (IsLowGM() && !victim->IsLowGM())
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Game Masters cannot trade items with players."));
		return false;
	}
//end exchange.cpp

//shop_manager.cpp
void CShopManager::Buy(LPCHARACTER ch, BYTE pos)
add
	if (ch->IsLowGM() && pkShop->IsPCShop())
	{
		ch->ChatPacket(CHAT_TYPE_INFO, "GameMasters cannot buy items from players' shops.");
		return;
	}
//end shop_manager.cpp

and for offlineshop
//offlineshop_manager.cpp
void COfflineShopManager::Buy(LPCHARACTER ch, BYTE pos)
add
	if (ch->IsLowGM())
	{
		ch->ChatPacket(CHAT_TYPE_INFO, "GameMasters cannot buy items from players' shops.");
		return;
	}
//end offlineshop_manager.cpp

GL ✌?️

Edited by ⚡FlasH⚡ (see edit history)
  • Love 3
  • Think 2
Link to post

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


  • Current Donation Goals

  • Activity

    1. 11

      Mysql56 to Mysql8

    2. 0

      Does anyone have Kami-Sama's Contact?

    3. 1

      [Trailer][1/3]NerviL2 The return of the Legend

    4. 0

      Won " price" change

    5. 10

      Inferna - The new "metin3"?

    6. 6

      We need you!

    7. 2

      Highlight system bug

  • Recently Browsing

    No registered users viewing this page.

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