safademirel 288 Posted August 31, 2014 Share Posted August 31, 2014 (edited) help error https://metin2.download/picture/B5U50R7xoHKZRDvjeSJVkfKd69sOeJO9/.jpg https://metin2.download/picture/AgTyosONarQCFAG6PYHeG4TheVJJcuS7/.jpg 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 August 30, 2022 by Metin2 Dev Core X - External 2 Internal 1 1 Link to comment Share on other sites More sharing options...
Premium ahynoa 15 Posted August 31, 2014 Premium Share Posted August 31, 2014 Thanks, I had not looked that error Link to comment Share on other sites More sharing options...
ekoo 8 Posted September 4, 2014 Share Posted September 4, 2014 *solved Link to comment Share on other sites More sharing options...
Premium MrLibya 554 Posted November 13, 2014 Premium Share Posted November 13, 2014 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 Share on other sites More sharing options...
Former Staff flygun 304 Posted November 28, 2014 Former Staff Share Posted November 28, 2014 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()); 1 Link to comment Share on other sites More sharing options...
KIDD 9 Posted December 12, 2014 Share Posted December 12, 2014 (edited) Fix? For all other empire works fine Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
giovy010102 32 Posted December 14, 2014 Share Posted December 14, 2014 Thanks work Link to comment Share on other sites More sharing options...
KIDD 9 Posted December 14, 2014 Share Posted December 14, 2014 (edited) Fix? For all other empire works fine Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
Benhero 23 Posted December 16, 2014 Share Posted December 16, 2014 (edited) This isn't your original code. Because you use {} ingame. So please Post original Code... Greatz Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
KIDD 9 Posted December 18, 2014 Share Posted December 18, 2014 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 Share on other sites More sharing options...
Krusty 32 Posted December 19, 2014 Share Posted December 19, 2014 I have the same problem as Kidd Link to comment Share on other sites More sharing options...
Honorable Member xP3NG3Rx 19656 Posted December 19, 2014 Honorable Member Share Posted December 19, 2014 (edited) 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: Edited August 23, 2022 by Metin2 Dev Core X - External 2 Internal 6 Link to comment Share on other sites More sharing options...
danhakhavro 42 Posted January 9, 2015 Share Posted January 9, 2015 Work fine, thank you very much. Link to comment Share on other sites More sharing options...
chollinex 0 Posted February 10, 2015 Share Posted February 10, 2015 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 Share on other sites More sharing options...
Haades 5 Posted March 9, 2015 Share Posted March 9, 2015 (edited) 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 September 11, 2022 by Metin2 Dev Core X - External 2 Internal 4 1 Link to comment Share on other sites More sharing options...
nyirilaszlo 0 Posted December 27, 2021 Share Posted December 27, 2021 thanks..:) Link to comment Share on other sites More sharing options...
minigutza 54 Posted August 15, 2022 Share Posted August 15, 2022 (edited) 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 August 15, 2022 by minigutza Link to comment Share on other sites More sharing options...
Recommended Posts