Jump to content
×
×
  • Create New...
  • 0

Does anyone have this?


Sebypunct

Question

  • Answers 4
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

4 answers to this question

Recommended Posts

  • 0
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

  • 0
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


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.