Jump to content

Equipa Na Lista De Amigos


Recommended Posts

Olá,

 

Com este tutorial irão conseguir adicionar todos os membros da equipa por baixo da lista de amigos & guild.

 

1º-

 

Descompactar os root;

 

2º-

 

Abrir o ficheiro game.py e procurar:

 

: self.CommandCloseSafebox,  

 

Por baixo, adicionar:

 

"Teamler_on"            : self.__Team_On,"Teamler_off"            : self.__Team_Off,  

 

No final do ficheiro, adicionar:

 

    def __Team_On(self, name):        if self.interface.wndMessenger:            self.interface.wndMessenger.OnLogin(2, name)     def __Team_Off(self, name):        if self.interface.wndMessenger:            self.interface.wndMessenger.OnLogout(2, name)  

 

De seguida, abram o ficheiro uimessenger.py.

 

Procurem por:

 

FRIEND = 0GUILD = 1  

 

Adicionem, por baixo de "GUILD = 1", "TEAM = 2" de modo a que fique assim:

 

FRIEND = 0GUILD = 1TEAM = 2  

 

 

Depois disto, procurem por:

 

class MessengerFriendItem(MessengerMemberItem):     def __init__(self, getParentEvent):        MessengerMemberItem.__init__(self, getParentEvent)     def CanRemove(self):        return TRUE     def OnRemove(self):        messenger.RemoveFriend(self.key)        net.SendMessengerRemovePacket(self.key, self.name)        return TRUE  

 

E acrescentem-lhe o seguinte, em baixo:

 

class MessengerTeamItem(MessengerMemberItem):     def __init__(self, getParentEvent):        MessengerMemberItem.__init__(self, getParentEvent)     def CanRemove(self):        return FALSE     def OnRemove(self):        messenger.RemoveFriend(self.key)        net.SendMessengerRemovePacket(self.key, self.name)        return FALSE  

 

Procurem novamente por:

 

class MessengerFriendGroup(MessengerGroupItem):     def __init__(self, getParentEvent):        MessengerGroupItem.__init__(self, getParentEvent)        self.SetName(locale.MESSENGER_FRIEND)     def AppendMember(self, key, name):        item = MessengerFriendItem(self.getParentEvent)        return MessengerGroupItem.AppendMember(self, item, key, name)  

 

E por baixo adicionem:

 

class MessengerTeamGroup(MessengerGroupItem):     def __init__(self, getParentEvent):        MessengerGroupItem.__init__(self, getParentEvent)        self.SetName("TMoore Tutorials Team")     def AppendMember(self, key, name):        item = MessengerTeamItem(self.getParentEvent)        return MessengerGroupItem.AppendMember(self, item, key, name)  

 

Procurar por:

 

def __AddGroup(self):

 

E adicionar:

 

        member = MessengerTeamGroup(ui.__mem_func__(self.GetSelf))        member.Open()        member.Show()        self.TeamGroup = member        self.groupList.append(member)  

 

 

Quest:

 

 

 

quest gmstatus beginstate start beginwhen login begingmstatus.TeamMember()loop_timer("CheckGMActivity", 5)end when login with pc.is_gm() beginlocal name = pc.get_name()game.set_event_flag(name, 1)notice_all(""..name.." está agora online.")end when logout with pc.is_gm() beginlocal name = pc.get_name()game.set_event_flag(name, 0)end when CheckGMActivity.timer begingmstatus.TeamMember()end function TeamMember()local TeamMember = {"Sadness","Sadness2"}local i = 1local TeamCount = table.getn(TeamMember) + 1while i < TeamCount doif game.get_event_flag(TeamMember[i]) == 1 thencmdchat("Teamler_on "..TeamMember[i])elseif game.get_event_flag(TeamMember[i]) == 0 thencmdchat("Teamler_off "..TeamMember[i])endi = i + 1endendendend

 

 

 

Os membros presentes nesta lista são editáveis na quest .

Link to comment
  • 5 months later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...