rατατυi ☆ 7 Posted January 9, 2016 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: 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 1 Cσяvσ⋆ reacted to this Share this post Link to post Share on other sites
RachadoPT 140 Posted January 9, 2016 Obrigado pela partilha, só é pena ser copy paste doutro forum, titulo e tudo, e não ter créditos nem fonte, mas... Cumprimentos, RachadoPT 1 AndoPerdido reacted to this Share this post Link to post Share on other sites