Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server
You last visited: Today at 16:21

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Python function doesn't work

Discussion on Python function doesn't work within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
Noa_'s Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 605
Received Thanks: 580
Python function doesn't work

in my case "__CreateSubFunction" not work, so maybe i got a error think in this function, but i dont know.
PHP Code:
def __init__(self):
        
ui.Window.__init__(self)
        
self.Board ui.BoardWithTitleBar()
        
self.Board.SetSize(300500)
        
self.Board.SetCenterPosition()
        
self.Board.AddFlag('movable')
        
self.Board.AddFlag('float')
        
self.Board.SetTitleName("Test")
        
self.Board.SetCloseEvent(self.Close)
        
self.Board.Show()
        
        
self.mainbutton self.__SetButton(self.Board,50,100,"Base")
        
self.mainbutton.Show()
        
self.mainbutton.SetEvent(self.__CreateSubFunction)
    
def __CreateSubFunction(self):
        
res self.__SetButton(self.mainbutton,10,10,"1")
        
res.Show()
        return 
res

    def __SetButton
(self,parent,x,y,text):
        
button ui.Button()
        
button.SetParent(parent)
        
button.SetPosition(x,y)
        
button.SetUpVisual('d:/ymir work/ui/public/big_button_01.sub')
        
button.SetOverVisual('d:/ymir work/ui/public/big_button_02.sub')
        
button.SetDownVisual('d:/ymir work/ui/public/big_button_03.sub')
        
button.SetText(text)
        return 
button 
cuz this func?

PHP Code:
 def __SetButton(self,parent,x,y,text):
        
button ui.Button()
        
button.SetParent(parent)
        
button.SetPosition(x,y)
        
button.SetUpVisual('d:/ymir work/ui/public/big_button_01.sub')
        
button.SetOverVisual('d:/ymir work/ui/public/big_button_02.sub')
        
button.SetDownVisual('d:/ymir work/ui/public/big_button_03.sub')
        
button.SetText(text)
        return 
button 
there a use button variable and twice is not allowed, maybe use it in list or dic

iam solved it, just button to self.button
Noa_ is offline  
Reply


Similar Threads Similar Threads
[C++] Run Python Function Functions Metin2
05/10/2014 - C/C++ - 5 Replies
Hat sich geklärt.
Help Me Python Function
02/08/2014 - Metin2 Private Server - 1 Replies
Any person know the function in python to use : http://m2data.liquiron.com/ex/icon/item/70038.png Thanx.
[RELEASE]Python Chat Anti-SPAM Function
11/02/2013 - Metin2 PServer Guides & Strategies - 10 Replies
:D
[PYTHON]Function in game aufrufen?
04/23/2013 - Metin2 Private Server - 4 Replies
Hey, kann man in (metin) Python irgendwie von einer uiscript py datei aus eine Function in der game.py ausführen? Vielen Dank für jede Hilfe Das schon versucht: import game



All times are GMT +1. The time now is 16:24.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.