Jump to content
×
×
  • Create New...
  • 0

def __SendChatPacket(self, text, type):


EnKor

Question

  • 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
Link to comment
Share on other sites

  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

1 answer to this question

Recommended Posts

  • 0

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)

Link to comment
Share on other sites

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


  • Activity

    1. 2

      Problem freebsd

    2. 0

      Making chain quest

    3. 4

      Ludus2: a metin2-like browser game

    4. 6
    5. 9

      Help in implementing a switch bot

    6. 0

      Special Inventory System Can't Sell To Npc's

    7. 0

      ROV2.GLOBAL | International | Server start 14.05.2022

    8. 75

      Services - System Ard [C ++ / Python / Lua]

  • Recently Browsing

    • No registered users viewing this page.

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.