Jump to content

Recommended Posts

  • Premium

def __SendChatPacket(self, text, type):
        name = player.GetName()
    
        if net.IsChatInsultIn(text):
            chat.AppendChat(chat.CHAT_TYPE_INFO, locale.CHAT_INSULT_STRING)
            return
        else:
            text = "|Hmsg:" + name + "|h""[PM]""|h|r " + text
            net.SendChatPacket(text, type)

 

 

That is my def of chat. When i say something e say this line :

 text = "|Hmsg:" + name + "|h""[PM]""|h|r " + text

 

 

How can i say that only in ChatPacket, GuildChatPacket and ShoutChatPacket

Please? 

 

 

 

Found it:

 

def __SendChatPacket(self, text, type):
        name = player.GetName()
    
        if net.IsChatInsultIn(text):
            chat.AppendChat(chat.CHAT_TYPE_INFO, locale.CHAT_INSULT_STRING)
            return
        else:
            if type == chat.CHAT_TYPE_SHOUT or type == chat.CHAT_TYPE_GUILD or type == chat.CHAT_TYPE_PARTY:
                text = "|Hmsg:" + name + "|h""[PM]""|h|r " + text
                net.SendChatPacket(text, type)
            else:
                net.SendChatPacket(text, type)

 

 

 

Close it please.

 

 

Edited by EnKor
if pc.get_sex() == true and npc.get_sex() == false then
	npc.purge()
end

 

Link to comment
https://metin2.dev/topic/8973-def-__sendchatpacketself-text-type/
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

def __SendChatPacket(self, text, type):
        name = player.GetName()
    
        if net.IsChatInsultIn(text):
            chat.AppendChat(chat.CHAT_TYPE_INFO, locale.CHAT_INSULT_STRING)
            return
        else:
            text = "|Hmsg:" + name + "|h""[PM]""|h|r " + text
            net.SendChatPacket(text, type)

 

 

That is my def of chat. When i say something e say this line :

 text = "|Hmsg:" + name + "|h""[PM]""|h|r " + text

 

 

How can i say that only in ChatPacket, GuildChatPacket and ShoutChatPacket

Please? 

 

 

 

Found it:

 

def __SendChatPacket(self, text, type):
        name = player.GetName()
    
        if net.IsChatInsultIn(text):
            chat.AppendChat(chat.CHAT_TYPE_INFO, locale.CHAT_INSULT_STRING)
            return
        else:
            if type == chat.CHAT_TYPE_SHOUT or type == chat.CHAT_TYPE_GUILD or type == chat.CHAT_TYPE_PARTY:
                text = "|Hmsg:" + name + "|h""[PM]""|h|r " + text
                net.SendChatPacket(text, type)
            else:
                net.SendChatPacket(text, type)

 

 

 

Close it please.

 

 


            texts = "|Hmsg:" + name + "|h"+"[PM]"+"|h|r " + text
            net.SendChatPacket(texts, type)

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.