Jump to content

Recommended Posts

  • Active+ Member

Hi devs, today I need a function that blocks GMs to join players' party and guild.

So a GM cannot invite a player to party, a player cannot invite a GM to a party, only player can invite player and GM can invite GM. Same goes for guild invitations.

Thanks in advance :)

Link to comment
https://metin2.dev/topic/12935-need-party-guild-inviting-block-functions/
Share on other sites

  • 2 weeks later...

 

[File: /src/Server/game/src/char.cpp]

..//1.) Search:

	else if (pchInvitee->IsBlockMode(BLOCK_PARTY_INVITE))
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<파티> %s 님이 파티 거부 상태입니다."), pchInvitee->GetName());
		return;
	}

..//2.) Add bellow:

#ifdef ENABLE_EXTRA_BLOCK_PARTY	
	#define ERROR_PARTY(argument)	ChatPacket(CHAT_TYPE_INFO, argument); //me_vegas_func183

	else if (GetGMLevel() > GM_PLAYER && pchInvitee->GetGMLevel() == GM_PLAYER) {
		ERROR_PARTY("<<Party>> You can not send a request to a player!");
		return;
	}	
	
	else if (GetGMLevel() == GM_PLAYER && pchInvitee->GetGMLevel() > GM_PLAYER) {
		ERROR_PARTY("<<Party>> You can not send a request to a staff member!");
		return;
	}	
#endif

 

 

[File: /src/Server/game/src/guild.cpp]

..//1.) Search:

	else if ( pchInvitee->GetEmpire() != pchInviter->GetEmpire() ) 
	{
		pchInviter->ChatPacket( CHAT_TYPE_INFO, LC_TEXT("<길드> 다른 제국 사람을 길드에 초대할 수 없습니다.") );
		return;
	}

..//2.) Add bellow:

#ifdef ENABLE_EXTRA_BLOCK_GUILD	
	#define ERROR_GUILD(argument)	 pchInviter->ChatPacket(CHAT_TYPE_INFO, argument); //me_vegas_func184

	else if (pchInviter->GetGMLevel() > GM_PLAYER && pchInvitee->GetGMLevel() == GM_PLAYER) {
		ERROR_GUILD("<<Party>> You can not send a request to a player!");
		return;
	}	
	
	else if (pchInviter->GetGMLevel() == GM_PLAYER && pchInvitee->GetGMLevel() > GM_PLAYER) {
		ERROR_GUILD("<<Party>> You can not send a request to a staff member!");
		return;
	}				
#endif

 

[File: /src/Server/game/common/service.h]

#define ENABLE_EXTRA_BLOCK_GUILD
#define ENABLE_EXTRA_BLOCK_PARTY

 

Edited by VegaS
fix
  • Love 3
  • Active+ Member
1 hour ago, VegaS said:

 

[File: /src/Server/game/src/char.cpp]

..//1.) Search:


	else if (pchInvitee->IsBlockMode(BLOCK_PARTY_INVITE))
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<파티> %s 님이 파티 거부 상태입니다."), pchInvitee->GetName());
		return;
	}

..//2.) Add bellow:


#ifdef ENABLE_EXTRA_BLOCK_PARTY	
	#define ERROR_PARTY(argument)	ChatPacket(CHAT_TYPE_INFO, argument); //me_vegas_func183

	else if (GetGMLevel() > GM_PLAYER && pchInvitee->GetGMLevel() == GM_PLAYER) {
		ERROR_PARTY("<<Party>> You can not send a request to a player!");
		return;
	}	
	
	else if (GetGMLevel() == GM_PLAYER && pchInvitee->GetGMLevel() > GM_PLAYER) {
		ERROR_PARTY("<<Party>> You can not send a request to a staff member!");
		return;
	}	
#endif

 

 

[File: /src/Server/game/src/guild.cpp]

..//1.) Search:


	else if ( pchInvitee->GetEmpire() != pchInviter->GetEmpire() ) 
	{
		pchInviter->ChatPacket( CHAT_TYPE_INFO, LC_TEXT("<길드> 다른 제국 사람을 길드에 초대할 수 없습니다.") );
		return;
	}

..//2.) Add bellow:


#ifdef ENABLE_EXTRA_BLOCK_GUILD	
	#define ERROR_GUILD(argument)	 pchInviter->ChatPacket(CHAT_TYPE_INFO, argument); //me_vegas_func184

	else if (pchInviter->GetGMLevel() > GM_PLAYER && pchInvitee->GetGMLevel() == GM_PLAYER) {
		ERROR_GUILD("<<Party>> You can not send a request to a player!");
		return;
	}	
	
	else if (pchInviter->GetGMLevel() == GM_PLAYER && pchInvitee->GetGMLevel() > GM_PLAYER) {
		ERROR_GUILD("<<Party>> You can not send a request to a staff member!");
		return;
	}				
#endif

 

[File: /src/Server/game/common/service.h]


#define ENABLE_EXTRA_BLOCK_GUILD
#define ENABLE_EXTRA_BLOCK_PARTY

 

Thank you so much, exactly what I needed :)

  • Love 1

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.