antiblock
diamwall
  • Chatbox

    You don't have permission to chat.
    Load More
Sign in to follow this  
rατατυi ☆

Atalho "@" Para Enviar Mensagens Privadas

3 posts in this topic

Boas Comunidade.

Venho trazer-vos um tutorial de como adicionam o "@" para enviarem uma mensagem privada pelo chat.

Basicamente um sistema parecido com o do chat aqui da cyber, mas, no chat do jogo.

 

Exemplo:

8a789d2c6063186b0741d381b60727a5.png

 

1º Lugar

Descompactar o ficheiro root, e abrir o ficheiro uichat.py

 

2º Lugar

Procurar por:

def __SendChatPacket(self, text, type):

3º Lugar

Alterar o localizado em cima para:

def __SendChatPacket(self, text, type):

        if text.find("@") ==0:

            text = text.split(" ")

            user = text[0]

            user = text[0].split("@")

            user = user[1]

            del text[0]

            realtext = ""

            for i in xrange(len(text)):

                if i > 0:

                    realtext = realtext + " " + text[i]

                else:

                    realtext = realtext + text[i]

            if len(realtext) > 0:

                net.SendWhisperPacket(user, realtext)

                chat.AppendChat(chat.CHAT_TYPE_INFO, "Envias-te uma mensagem ao " + user + ", por favor aguarde pela respposta.")

            else:

                chat.AppendChat(chat.CHAT_TYPE_INFO, "Tens que escrever uma mensagem..")

        elif net.IsChatInsultIn(text):

            chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHAT_INSULT_STRING)

        else:

            net.SendChatPacket(text, type)

4º Lugar

Compactar o root e substituir o mesmo no cliente.

 

Nota: 

Basta escrever "@nomedojogador mensagem" no chat que enviará uma mensagem somente para ele.

 

Atenção:

O "@" e o nome do jogador são juntos, seguido de um espaço para a mensagem.

 

Cumprimentos,

Motoko

 

Share this post


Link to post
Share on other sites
antiblock
https://arwen2.global/

Obrigado pela partilha, só é pena ser copy paste doutro forum, titulo e tudo, e não ter créditos nem fonte, mas...

 

Cumprimentos,

RachadoPT

Share this post


Link to post
Share on other sites

alguém testou?

Share this post


Link to post
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
Sign in to follow this