Jump to content

Recommended Posts

int len_global_ snprintf(chatbuf_global,  .........................

change with

		int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s",kingdoms[ch->GetEmpire()-1], chatbuf);
Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Love 1
Link to comment
https://metin2.dev/topic/884-global-chat/page/2/#findComment-18850
Share on other sites

  • 2 months later...
  • Premium

input_main.cpp: In member function 'int CInputMain::Chat(CHARACTER*, const char*, size_t)':
input_main.cpp:756: error: expected primary-expression before 'p'
input_main.cpp:758: error: 'p' was not declared in this scope

If you're going to do something, then do it right.

Link to comment
https://metin2.dev/topic/884-global-chat/page/2/#findComment-24661
Share on other sites

  • 3 weeks later...
  • Former Staff

thx :)

 

this code for the one who can't write all that code

	const char* kingdoms[3] = {"|cFFff000|h|h[Shinsoo]|cFFA7FFD4|H|h","|CFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h","|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h"};
        char chatbuf_global[CHAT_MAX_LEN + 1];
        int len_global_ = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s",kingdoms[ch->GetEmpire()-1], chatbuf);
 
        TPacketGGShout p;
 
        p.bHeader = HEADER_GG_SHOUT;
        p.bEmpire = ch->GetEmpire();
        strlcpy(p.szText, chatbuf_global, sizeof(p.szText));
 
        P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout));
 
        SendShout(chatbuf_global, ch->GetEmpire());
  • Love 1
Link to comment
https://metin2.dev/topic/884-global-chat/page/2/#findComment-25838
Share on other sites

  • 2 weeks later...

For sure it is orginal code

	if (pinfo->type == CHAT_TYPE_SHOUT)
	{
		const int SHOUT_LIMIT_LEVEL = g_iUseLocale ? 15 : 3;

		if (ch->GetLevel() < SHOUT_LIMIT_LEVEL)
		{
			ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¿ÜÄ¡±â´Â ·¹º§ %d ÀÌ»ó¸¸ »ç¿ë °¡´É ÇÕ´Ï´Ù."), SHOUT_LIMIT_LEVEL);
			return (iExtraLen);
		}

		if (thecore_heart->pulse - (int) ch->GetLastShoutPulse() < passes_per_sec * 15)
			return (iExtraLen);

		ch->SetLastShoutPulse(thecore_heart->pulse);

		const char* kingdoms[3] = {"|cFFff0000|H|h[Shinsoo]|cFFa7FFD4|H|h","|cFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h","|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h"};
		char chatbuf_global[CHAT_MAX_LEN + 1];
		int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s",kingdoms[ch->GetEmpire()-1],chatbuf);
		
		TPacketGGShout p;

		p.bHeader = HEADER_GG_SHOUT;
		p.bEmpire = ch->GetEmpire();
		strlcpy(p.szText, chatbuf_global, sizeof(p.szText));
		//strlcpy(p.szText, chatbuf, sizeof(p.szText));
		P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout));

		SendShout(chatbuf_global, ch->GetEmpire());

		return (iExtraLen);
	}
Link to comment
https://metin2.dev/topic/884-global-chat/page/2/#findComment-27762
Share on other sites

  • Honorable Member

I have made this myself by another way. (No need glass to make shout if empire_chat is enabled.)

 

Check my part of code to solve your problem:

	const char * ColoredEmpireNames[4] = {"0", "|cFFFF0000[Shinshoo]|r", "|cFFFFFF00[Chunjo]|r", "|cFF0080FF[Jinno]|r",};
	const char * ColoredTeamName = "|cFFFFC700[Team]|r";
	len = snprintf(chatbuf, sizeof(chatbuf), "%s %s : %s",
		ch->GetGMLevel() != GM_PLAYER ? ColoredTeamName : ColoredEmpireNames[ch->GetEmpire()], ch->GetName(), buf);

The [shinsoo] is so ugly on printscreen by client:

0504_120833.jpg

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 6
Link to comment
https://metin2.dev/topic/884-global-chat/page/2/#findComment-27876
Share on other sites

  • 3 weeks later...
  • 1 month later...

Its work me fine.

const char* kingdoms[3] = {"|cFFff000|h|h[Shinsoo]|cFFA7FFD4|H|h","|CFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h","|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h"};
char chatbuf_global[CHAT_MAX_LEN + 1];
int len_global_ = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s",kingdoms[ch->GetEmpire()-1], chatbuf);
 
TPacketGGShout p;
 
p.bHeader = HEADER_GG_SHOUT;
p.bEmpire = ch->GetEmpire();
strlcpy(p.szText, chatbuf_global, sizeof(p.szText));
 
P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout));
 
SendShout(chatbuf_global, ch->GetEmpire());
Link to comment
https://metin2.dev/topic/884-global-chat/page/2/#findComment-33888
Share on other sites

  • 4 weeks later...

Hi,

I have this problem:

https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif/

 

And this is my code:

https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif/

 

Can me someone help?

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 4
  • Good 1
Link to comment
https://metin2.dev/topic/884-global-chat/page/2/#findComment-37341
Share on other sites

  • 6 years later...
  • 7 months later...

Ok. The system is good but i had an issue on 40k source. The kingdom's color are not working, only for blue kingdom.

To solve this, if you use the first post you need to change the colors i don t know really why, like those from  xP3NG3Rx.

So:

Replace this:

const char* kingdoms[3] = {"|cFFff000|h|h[Shinsoo]|cFFA7FFD4|H|h","|CFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h","|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h"};

With this:

const char* kingdoms[3] = {"|cFFFF0000[Shinsoo]|r", "|cFFFFFF00[Chunjo]|r", "|cFF0080FF[Jinno]|r"};

 

I checked a while, maybe it will help others. Good luck!

Edited by minigutza
Link to comment
https://metin2.dev/topic/884-global-chat/page/2/#findComment-151277
Share on other sites

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.