brauche mal wieder etwas Hilfe.
Ich versuche gerade den Ruf Chat weng zu modden.
Mein Problem ist, ich möchte gerne vom jedem Reich den Namen dabei stehen haben "Bund".
Aber im Game will er dann "Glas der Einsicht".
Und des mit SA Funktioniert auch nicht.
Wäre nett wenn jemand Helfen könnte
Hier mal mein Code.
PHP Code:
def __SendChatPacket(self, text, type):
#START BLACKLIST#
blacklist = ["(buff1)","(buff2)","(buff3)","(buff4)","(buff5)","(buff6)","(vip)"]
for x in xrange(len(blacklist)):
if text == blacklist[x]:
return
#END BLACKLIST#
#START EMPIRECHAT#
if type == chat.CHAT_TYPE_SHOUT:
name = player.GetName()
empire_id = int(net.GetEmpireID(name))
empire_color = {
1: '|cFFFF0000|H|h[Shinsoo]|cFFA7FFD4|H|h',
2: '|cFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h',
3: '|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h'
}
text_color = str(empire_color[empire_id]) + text
net.SendChatPacket(text_color, type)
else:
#END EMPIRECHAT#
#START COLORMODE#
colors = [
'[Rot]','[Orange]','[Pink]','[HellBlau]','[Blau]','[Grün]','[Black]','[Gelb]',
]
farbcodes = {
'[Rot]' : '|cFFFF0000|H|h',
'[Orange]' : "|cFFFF8040|H|h",
'[Pink]' : "|cFFFF00FF|H|h",
'[HellBlau]' : "|cFF00FFFF|H|h",
'[Blau]' : "|cFF0080FF|H|h",
'[Grün]' : "|cFF00FF00|H|h",
'[Black]' : "|cFF000000|H|h",
'[Gelb]' : "|cFFFFFF00|H|h",
}
for farben in colors:
if text.find(farben) !=-1:
textwithcolor = text.replace(farben,farbcodes[farben])
net.SendChatPacket(textwithcolor, type)
return
net.SendChatPacket(text, type)
#END COLORMODE#
name = player.GetName()
if type == chat.CHAT_TYPE_SHOUT:
if name.find("[SA]") !=-1: # Wenn im [SA] im Namen gefunden wird dann...
empire_id = "|cFFFF0000|H|h[Serveradmin]|cFFA7FFD4|H|h" # ...Reaktion auf ^ (1 Zeile drüber)