Empire-Shoutchat problem ..

03/08/2014 17:34 |Elea|#1
Hallo,


Ich habe ein Problem. Ich begann Empire-Shoutchat auf meinem Server. Aber das ist, wie es angezeigt wird. Diese Form:

Pseudo: [Prefix] Nachricht

[Only registered and activated users can see links. Click Here To Register...]

Ich möchte:

[Prefix] Pseudo: Nachricht

[Only registered and activated users can see links. Click Here To Register...]

Wie kann ich tun?

PHP Code:
            name player.GetName()
            if 
type == chat.CHAT_TYPE_SHOUT:
                if 
name.find("[") !=-1:
                    
empire_id "|cFFFF6600|H|h[Staff]|cFFA7FFD4|H|h"
                
else:
                    
empire_id str(net.GetEmpireID())
                    if 
empire_id == "1":
                        
empire_id "|cFFFF0000|H|h[Rouge]|cFFA7FFD4|H|h"
                    
elif empire_id == "2":
                        
empire_id "|cFFFFFF00|H|h[Jaune]|cFFA7FFD4|H|h"
                    
elif empire_id == "3":
                        
empire_id "|cFF0080FF|H|h[Bleu]|cFFA7FFD4|H|h"

                
text empire_id text

            net
.SendChatPacket(texttype
GAME 40250
03/08/2014 20:46 rollback#2
PHP Code:
name player.GetName()
            if 
type == chat.CHAT_TYPE_SHOUT:
                if 
name.find("[") !=-1:
                    
empire_id "|cFFFF6600|H|h[Staff]|cFFA7FFD4|H|h"
                
else:
                    
empire_id str(net.GetEmpireID())
                    if 
empire_id == "1":
                        
empire_id "[Rouge]|cFFFF0000|H|h|cFFA7FFD4|H|h"
                    
if empire_id == "2":
                        
empire_id "[Jaune]|cFFFFFF00|H|h|cFFA7FFD4|H|h"
                    
if empire_id == "3":
                        
empire_id "[Bleu]|cFF0080FF|H|h|cFFA7FFD4|H|h"

                
text empire_id name text

            net
.SendChatPacket(texttype
probiers mal^^
03/08/2014 22:57 |Elea|#3
@Cpt Tr: Same Problem ...:

Pseudo: [Prefix] Nachricht

@[Sensenmann]: Problem:

Pseudo: [Prefix]Pseudo: Nachricht

Vielen Dank an Sie!
Sorry, ich bin Französisch ...
03/09/2014 02:47 Cpt Tr#4
Code:
def __SendChatPacket(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 = "|cFFFF6600|H|h[Staff]|cFFA7FFD4|H|h"
                else:
                    empire_id = str(net.GetEmpireID())
                    if empire_id == "1":
                        empire_id = "|cFFFF0000|H|h[Rouge]|cFFA7FFD4|H|h"
                    elif empire_id == "2":
                        empire_id = "|cFFFFFF00|H|h[Jaune]|cFFA7FFD4|H|h"
                    elif empire_id == "3":
                        empire_id = "|cFF0080FF|H|h[Bleu]|cFFA7FFD4|H|h"

                text = empire_id + name + text

            net.SendChatPacket(text, type)
That should be you your full code. Maybe it works if you delete the 'self' in 'def __SendChatPacket(self,text, type):'
and add '+ name' in the penultimate line.

If that doesn't work you need to find the code wich defines that the 'playername' gets printed out before and delete this part and add also the '+name' in the line 'text = empire_id + text'