Jump to content

Does anyone have this?


Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

import net, constInfo, ui, background, time, chat

class Zmiana_Kanalu(ui.Window):
	def __init__(self):
		ui.Window.__init__(self)

	def __del__(self):
		ui.Window.__del__(self)

	def Open(self):
		self.vegas_change = ui.BoardWithTitleBar()
		self.vegas_change.AddFlag("movable")
		self.vegas_change.AddFlag("float")
		self.vegas_change.SetTitleName("Zmiana Kanału")
		self.vegas_change.SetCloseEvent(self.Close)
		
		x = 0
		
		self.channel_list = []
		
		for ch in xrange(4): #Nr of channels
			channel_button = ui.Button()
			channel_button.SetParent(self.vegas_change) 
			channel_button.SetSize(100, 100)
			channel_button.SetPosition(30, 34 + (20 * x + x))
			channel_button.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
			channel_button.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
			channel_button.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
			channel_button.SetEvent(ui.__mem_func__(self.change_channel), ch)
			
			channel_button.SetText("Kanał " + str(ch+1))
			channel_button.Show()
			
			self.channel_list.append(channel_button)
			x = x + 1
		
		self.vegas_change.SetSize(150, 50 + (20 * x + x)) 
		self.vegas_change.SetCenterPosition()
		self.vegas_change.Show()
		
	def protect_maps(self):
		protect_list = [
			"season99/new_map_ox",
			"maps_dungeon/devils_zone",
			"maps_dungeon/dt_zone",
			"maps_vegas/wedding_zone",
			"maps_dungeon/spider_3",  
			"maps_vegas/duel_zone",
		]
		if str(background.GetCurrentMapName()) in protect_list:
			return TRUE
		return FALSE    		
		
	def change_channel(self, ch):
		if self.protect_maps():
			chat.AppendChat(1, "[Zmiana Kanału] Nie możesz zmienić kanału na tej mapie!")
			return	
		elif time.clock() >= constInfo.change_time:			
			self.Close()
			net.SetServerInfo("Metin2 - Kanał %d" % int(ch+1)) # Nazwa pod minimapką po zmianie kanału
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[Zmiana Kanału] Zmiana kanału zakończona pomyślnie!")
			net.SendChatPacket("/ch %d" % int(ch+1))
			constInfo.change_time = time.clock() + 10 # Czas po którym można zmieniać kanał
		else:
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[Zmiana Kanału] Możesz zmieniać kanał co 10 sekund!")		
		
	def	Close(self):
		self.vegas_change.Hide()
		
	def OnPressExitKey(self):
	
		self.Close()
		return True

	def OnPressEscapeKey(self):
		self.Close()
		return True
		

 

Link to comment
Share on other sites

Acum 47 minute, mateo7788 a spus:

import net, constInfo, ui, background, time, chat

class Zmiana_Kanalu(ui.Window):
	def __init__(self):
		ui.Window.__init__(self)

	def __del__(self):
		ui.Window.__del__(self)

	def Open(self):
		self.vegas_change = ui.BoardWithTitleBar()
		self.vegas_change.AddFlag("movable")
		self.vegas_change.AddFlag("float")
		self.vegas_change.SetTitleName("Zmiana Kanału")
		self.vegas_change.SetCloseEvent(self.Close)
		
		x = 0
		
		self.channel_list = []
		
		for ch in xrange(4): #Nr of channels
			channel_button = ui.Button()
			channel_button.SetParent(self.vegas_change) 
			channel_button.SetSize(100, 100)
			channel_button.SetPosition(30, 34 + (20 * x + x))
			channel_button.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
			channel_button.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
			channel_button.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
			channel_button.SetEvent(ui.__mem_func__(self.change_channel), ch)
			
			channel_button.SetText("Kanał " + str(ch+1))
			channel_button.Show()
			
			self.channel_list.append(channel_button)
			x = x + 1
		
		self.vegas_change.SetSize(150, 50 + (20 * x + x)) 
		self.vegas_change.SetCenterPosition()
		self.vegas_change.Show()
		
	def protect_maps(self):
		protect_list = [
			"season99/new_map_ox",
			"maps_dungeon/devils_zone",
			"maps_dungeon/dt_zone",
			"maps_vegas/wedding_zone",
			"maps_dungeon/spider_3",  
			"maps_vegas/duel_zone",
		]
		if str(background.GetCurrentMapName()) in protect_list:
			return TRUE
		return FALSE    		
		
	def change_channel(self, ch):
		if self.protect_maps():
			chat.AppendChat(1, "[Zmiana Kanału] Nie możesz zmienić kanału na tej mapie!")
			return	
		elif time.clock() >= constInfo.change_time:			
			self.Close()
			net.SetServerInfo("Metin2 - Kanał %d" % int(ch+1)) # Nazwa pod minimapką po zmianie kanału
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[Zmiana Kanału] Zmiana kanału zakończona pomyślnie!")
			net.SendChatPacket("/ch %d" % int(ch+1))
			constInfo.change_time = time.clock() + 10 # Czas po którym można zmieniać kanał
		else:
			chat.AppendChat(chat.CHAT_TYPE_INFO, "[Zmiana Kanału] Możesz zmieniać kanał co 10 sekund!")		
		
	def	Close(self):
		self.vegas_change.Hide()
		
	def OnPressExitKey(self):
	
		self.Close()
		return True

	def OnPressEscapeKey(self):
		self.Close()
		return True
		

 

Man , i need this "large_button_01.sub" same my photo , no system.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 3

      Crystal Metinstone

    2. 3

      Feeding game source to LLM

    3. 113

      Ulthar SF V2 (TMP4 Base)

    4. 3

      Feeding game source to LLM

    5. 0

      Target Information System

    6. 3

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.