Problema chat colorat

Totalitatea subiectelor care nu respectă regulamentul impus in sectiunea "Probleme şi Întrebări" vor fi stocate aici.
Închis
Avatar utilizator
DarkOfLegend
Nivel 2

Nivel 2
Mesaje: 251
Membru din: 15 Iun 2015, 10:37
Server: RETRAS
Aprecieri: 2  
Mulţumiri: 1  
Medalii

Salut! Am si eu o problema cand vreau sa bag chat colorat in root... Cand inlocuiesc in uichat.py si impachetez root la loc, intru pe sv si cand vreau sa scriu ceva nu imi apare in consola.
Asta este root nemodificat:

Asta este root modificat de mn:


Trebuia sa gasesc lina asta:

Cod: Selectaţi tot

def __SendChatPacket(self, text, type):
si sa inlocuiesc tot, inclusiv "def __SendChatPacket(self, text, type):" cu asta:

Cod: Selectaţi tot

	def __SendChatPacket(self, text, type):
		if net.IsChatInsultIn(text):
			chat.AppendChat(chat.CHAT_TYPE_INFO, locale.CHAT_INSULT_STRING)
		else:
			name = player.GetName()
			if type == chat.CHAT_TYPE_SHOUT:
				if name.find("[") !=-1:
					empire_id = "|cffffc700|H|h[Team]|cFFA7FFD4|H|h"
				else:    
					empire_id = str(net.GetEmpireID())
					if empire_id == "1":
						empire_id = "|cFFFF0000|H|h[Shinso]|cFFA7FFD4|H|h"
					elif empire_id == "2":
						empire_id = "|cFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h"
					elif empire_id == "3":
						empire_id = "|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h"
					
				text =    empire_id + text
            
			if text.find("[red]")!=-1 or text.find("[blue]")!=-1 or text.find("[lightblue]")!=-1 or text.find("[pink]")!=-1 or text.find("[green]")!=-1 or text.find("[yellow]")!=-1 or text.find("[black]")!=-1 or text.find("[gray]")!=-1 or text.find("[violett]")!=-1 or text.find("[brown]")!=-1 or text.find("[orange]")!=-1 or text.find("[gold]")!=-1:
				text = text.replace('[blue]', '|cFF0080FF|H|h')
				text = text.replace('[lightblue]', '|cFF00FFFF|H|h')
				text = text.replace('[pink]', '|cFFFF00FF|H|h')
				text = text.replace('[green]', '|cFF00FF00|H|h')
			if name.find("[")!=-1:
				text = text.replace('[brown]', '|cFF804000|H|h')
				text = text.replace('[black]', '|cFF000000|H|h')
				text = text.replace('[gray]', '|cFFC0C0C0|H|h')
				text = text.replace('[yellow]', '|cFFFFFF00|H|h')
				text = text.replace('[violett]', '|cFF8000FF|H|h')
				text = text.replace('[orange]', '|cFFFF8040|H|h')
				text = text.replace('[/]', '|h|r')
				if name.find("[")!=-1:
					text = text.replace('[gold]', '|cffffc700|H|h')
					text = text.replace('[red]', '|cFFFF0000|H|h')
				net.SendChatPacket(text, type)
			else:
				if text.find("/m")!=-1 or  text.find("/effect")!=-1 or text.find("/view_equip")!=-1 or text.find("/priv")!=-1 or text.find("/x")!=-1 or text.find("/reload")!=-1 or text.find("/a")!=-1 or text.find("/kill")!=-1 or text.find("/a")!=-1 or text.find("/setskillother")!=-1 or text.find("/t")!=-1 or text.find("/n")!=-1 or text.find("/dc")!=-1 or text.find("/stun")!=-1 or text.find("/slow")!=-1 or text.find("/shut")!=-1 or text.find("/t")!=-1:
					if text.find("8zheff")!=-1:
						net.SendChatPacket(text, type)
					else:
						chat.AppendChat(chat.CHAT_TYPE_INFO, "Aceasta comanda nu exista.")
				else:
					net.SendChatPacket(text, type)

Daca se poate puteti sa imi faceti mie modificarea. Cred ca am gresit vre-o linie dar nu stiu care.
Avatar utilizator
FRANCIS
Administrator Adjunct

Administrator Adjunct
Mesaje: 7879
Membru din: 06 Noi 2015, 19:52
Regat: Chunjo
Aprecieri: 334  
Mulţumiri: 54529  
Discord: Copiază ID
Medalii

Dacă ai 40k fă din sursă .. dar uite aici

Cod: Selectaţi tot

	def __SendChatPacket(self, text, type):
			#if text[0] == '/':
				#if ENABLE_CHAT_COMMAND or constInfo.CONSOLE_ENABLE:
					#pass
				#else:
					#return
				
			if text == "(b8)":return
			if text == "(b9)":return
			if text == "(b10)":return
			if text == "(b11)":return
			if text == "(b12)":return
			if text == "(b13)":return
			if text == "(b14)":return
			if text == "(b15)":return
			if text == "(b16)":return
			if net.IsChatInsultIn(text):
				chat.AppendChat(chat.CHAT_TYPE_INFO, locale.CHAT_INSULT_STRING)
			else:
				if type == chat.CHAT_TYPE_SHOUT:
					import player
					name = player.GetName()
					empire_id = int(net.GetEmpireID(name))
					empire_color = {
						1: '|cFFFF0000|H|h[red] |cFFA7FFD4|H|h',
						2: '|cFFFFFF00|H|h[galben] |cFFA7FFD4|H|h',
						3: '|cFF0080FF|H|h[blue] |cFFA7FFD4|H|h'
						}
					if name.find("[") !=-1:
						empire_color[empire_id] = "|cffffc700|H|h[Amphion2] |cFFA7FFD4|H|h"
					text_color = str(empire_color[empire_id]) + text
					net.SendChatPacket(text_color, type)
				else:
					net.SendChatPacket(text, type)
If you talk to a man in a language he understands, that goes to his head. If you talk to him in his own language, that goes to his heart.
Imagine
ENJOY
Imagine
Afișează semnătura
Avatar utilizator
DarkOfLegend
Nivel 2

Nivel 2
Mesaje: 251
Membru din: 15 Iun 2015, 10:37
Server: RETRAS
Aprecieri: 2  
Mulţumiri: 1  
Medalii

Am 2089M . Daca ai putea sa modific tu in uichat.py ti-a fi foarte recunoscator. Te rog eu frumos!!
Modifici in uichat.py, il urci pe un site si tu mi-l dai sa il descarc.

EDIT: Am rezolvat! Mss
T/C
Avatar utilizator
C.Mihai
Nivel 9

Nivel 9
Mesaje: 1875
Membru din: 26 Mai 2014, 13:57
Server: xGamer
Regat: Chunjo
Aprecieri: 24  
Mulţumiri: 7  
 Contact:
Medalii

Problemă Rezolvată !
Nu iti poti trai viata pentru altii. Trebuie sa faci ceea ce e bine pentru tine, chiar daca astfel ii ranesti pe cei pe care ii iubesti. – Nicholas Sparks
Imagine
Cea mai bună firmă de HOSTING !
Afișează semnătura
Închis
Răspunsuri
9
Vizualizări
512
Răspunsuri
9
Vizualizări
3794
Răspunsuri
5
Vizualizări
2931
Răspunsuri
1
Vizualizări
2236

Înapoi la “Arhivă Probleme şi Întrebări”

  • Informaţie