System ajutor administrare:

Avatar utilizator
 
Mesaje: 9
Membru din: Joi Oct 19, 2017 12:50 am
Like-uri oferite: 0 time
Like-uri primite: 0 time

System ajutor administrare:

de [DEV]Bughy » Sâm Noi 04, 2017 3:38 am

O sa va arat un mic system pentru admini.

Imagine



1: Deschidem 'uitarget.py'

Cautam:
Code: Select All Code
import event

Sub el adaugam:
Code: Select All Code
import uiChatBlock
import uiban

Cautam:
Code: Select All Code
localeInfo.TARGET_BUTTON_EMOTION_ALLOW,

Sub el adaugam:
Code: Select All Code
"Slow",
"Stun",
"Kill",
"Kick",
"ChatBlock",
"Ban",

Cautam: self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER].SetEvent(ui.__mem_func__(self.OnWhisper))
Sub el adaugam:
Code: Select All Code
self.buttonDict["Slow"].SetEvent(ui.__mem_func__(self.OnSlow))
self.buttonDict["Stun"].SetEvent(ui.__mem_func__(self.OnStun))
self.buttonDict["Kill"].SetEvent(ui.__mem_func__(self.OnKill))
self.buttonDict["Kick"].SetEvent(ui.__mem_func__(self.OnKick))
self.buttonDict["ChatBlock"].SetEvent(ui.__mem_func__(self.OnChatBlock))
self.buttonDict["Ban"].SetEvent(ui.__mem_func__(self.OnBan))

Cautam:
Code: Select All Code
self.isShowButton = False

Sub el adaugam:
Code: Select All Code
#ChatBlock
dlgChatBlock = uiChatBlock.ChatBlockDialog()
dlgChatBlock.LoadDialog()
dlgChatBlock.SetTitleName("ChatBlock")
dlgChatBlock.Hide()
self.dlgChatBlock = dlgChatBlock
#Ban
dlgBan = uiban.BanDialog()
dlgBan.LoadDialog()
dlgBan.SetTitleName("Ban")
dlgBan.Hide()
self.dlgBan = dlgBan

Cautam:
Code: Select All Code
self.hpGauge = None

Sub el adaugam:
Code: Select All Code
#ChatBlock
self.dlgChatBlock.Destroy()
self.dlgChatBlock = 0
#Ban
self.dlgBan.Destroy()
self.dlgBan = 0

Cautam:
Code: Select All Code
self.ShowDefaultButton()

Sub el adaugam:
Code: Select All Code
if str(player.GetName())[0] == "[":
            self.__ShowButton("Slow")
            self.__ShowButton("Stun")
            self.__ShowButton("Kill")
            self.__ShowButton("Kick")
            self.__ShowButton("ChatBlock")
            self.__ShowButton("Ban")

Mergem la sfarsitul fisierului si adaugam:
Code: Select All Code
def OnSlow(self):
        net.SendChatPacket("/slow " + str(chr.GetNameByVID(self.vid)))
   
    def OnStun(self):
        net.SendChatPacket("/stun " + str(chr.GetNameByVID(self.vid)))
       
    def OnKill(self):
        net.SendChatPacket("/kill " + str(chr.GetNameByVID(self.vid)))
   
    def OnKick(self):
        net.SendChatPacket("/de ce " + str(chr.GetNameByVID(self.vid)))
    def OnChatBlock(self):
        #if os.path.exists('gm.txt') and os.path.isfile('gm.txt'):
        if str(player.GetName())[0] == "[":
            self.dlgChatBlock.SetTitleName("ChatBlock: " + str(chr.GetNameByVID(self.vid)))
            self.dlgChatBlock.Open(str(chr.GetNameByVID(self.vid)))
           
    def OnBan(self):
        if str(player.GetName())[0] == "[":
            self.dlgBan.SetTitleName("Ban: " + str(chr.GetNameByVID(self.vid)))
            self.dlgBan.Open(str(chr.GetNameByVID(self.vid)))


Fisierele din arhiva, si anume: Uiban.py si Uichatblock.py le punem in root iar bandialog.py si chatblockdialog.py le punem in uiscript.

Daca v-am ajutat lasa-ti un thx =) <3 :p

Înapoi la C++

Cine este conectat

Utilizatorii ce navighează pe acest forum: Niciun utilizator înregistrat şi 1 vizitator