Button only for some players ?

08/02/2013 02:12 WyppyOne#1
Hi , i have inventory viewer but , i can make it to appear only at players who names are "[..]..." ? Like [MOD] ,[VIP],[GM] etc ... if your name start with
[" that button appear
thread : [Only registered and activated users can see links. Click Here To Register...]
-------------------
sorry for my english...i hope you understand
08/02/2013 09:17 xGr33n#2
Quote:
Open up uitarget.py
At line 287 we find:

PHP Code:
 def ShowDefaultButton(self):

        
self.isShowButton TRUE
        self
.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_WHISPER])
        
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_EXCHANGE])
        
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_FIGHT])
        
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_EMOTION_ALLOW])
        for 
button in self.showingButtonList:
            
button.Show() 
Above all those "self.showingButtonList.append" we'll add:
PHP Code:
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_VIEW_EQUIPMENT]) 
We replace it with(untested!):

PHP Code:
def ShowDefaultButton(self):

        
import player
        name 
player.GetName()
        
self.isShowButton TRUE
        self
.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_WHISPER])
        
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_EXCHANGE])
        
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_FIGHT])
        
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_EMOTION_ALLOW])

        if 
name.find("[")!=-or name.find("]")!=-1:
            
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_VIEW_EQUIPMENT])

        for 
button in self.showingButtonList:
            
button.Show() 
I Hope it works
08/02/2013 16:01 WyppyOne#3
thx ... but doens't work :D
08/02/2013 22:13 xGr33n#4
Syserr.txt? or can all see it?
08/02/2013 23:08 WyppyOne#5
Code:
def ShowDefaultButton(self):

		self.isShowButton = TRUE
		self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_WHISPER])
		self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_EXCHANGE])
		self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_FIGHT])
		self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_EMOTION_ALLOW])
		if name.find("[")!=-1 or name.find("]")!=-1: 
            self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_VIEW_EQUIPMENT])
		for button in self.showingButtonList:
			button.Show()
sysser :


Code:
0803 00:03:30730 :: 
networkModule.py(line:194) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:26) ?
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - exceptions.IndentationError:unindent does not match any outer indentation level (line 295)

0803 00:03:30731 :: ============================================================================================================
0803 00:03:30731 :: Abort!!!!
08/03/2013 11:12 xGr33n#6
The function you used is Wrong! copy mine!!! Or upload your uitarget.py and i Make it
08/03/2013 11:37 [uLow]Beni#7
Quote:
Originally Posted by xGr33n View Post
We replace it with(untested!):

PHP Code:
def ShowDefaultButton(self):

        
import player
        name 
player.GetName()
        
self.isShowButton TRUE
        self
.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_WHISPER])
        
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_EXCHANGE])
        
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_FIGHT])
        
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_EMOTION_ALLOW])

        if 
"[" in name:
            
self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_VIEW_EQUIPMENT])

        for 
button in self.showingButtonList:
            
button.Show() 
I Hope it works
Is easier to understand i thing ;)
08/03/2013 15:29 WyppyOne#8
with :
Code:
	def ShowDefaultButton(self):

		self.isShowButton = TRUE
		self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_WHISPER])
		self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_EXCHANGE])
		self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_FIGHT])
		self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_EMOTION_ALLOW])
		
		if name.find("[")!=-1 or name.find("]")!=-1: 
            self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_VIEW_EQUIPMENT])
			
		for button in self.showingButtonList:
			button.Show()
sysser :

Code:
0803 16:21:12853 :: 
networkModule.py(line:194) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:26) ?
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - exceptions.IndentationError:unindent does not match any outer indentation level (line 296)

0803 16:21:12853 :: ============================================================================================================
0803 16:21:12853 :: Abort!!!!
---------------------------------------------------------------------
with :

Code:
def ShowDefaultButton(self): 

        import player 
        name = player.GetName() 
        self.isShowButton = TRUE 
        self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_WHISPER]) 
        self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_EXCHANGE]) 
        self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_FIGHT]) 
        self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_EMOTION_ALLOW]) 

        if "[" in name: 
            self.showingButtonList.append(self.buttonDict[locale.TARGET_BUTTON_VIEW_EQUIPMENT]) 

        for button in self.showingButtonList: 
            button.Show()
sysser :

Code:
0803 16:24:20471 :: CMapOutdoor::Load - LoadMonsterAreaInfo ERROR
0803 16:24:47931 :: CreateFromMemoryFile: Cannot create texture
0803 16:24:48082 :: Traceback (most recent call last):

0803 16:24:48082 ::   File "networkModule.py", line 233, in SetGamePhase

0803 16:24:48082 ::   File "game.py", line 105, in __init__

0803 16:24:48082 ::   File "uiTarget.py", line 99, in __init__

0803 16:24:48082 :: AttributeError
0803 16:24:48082 :: : 
0803 16:24:48082 :: 'TargetBoard' object has no attribute 'OnWhisper'
0803 16:24:48082 ::
img :
[Only registered and activated users can see links. Click Here To Register...]

my uitarget.py ( if you wanna make it for me ) :
[Only registered and activated users can see links. Click Here To Register...]
08/03/2013 16:08 xGr33n#9
Test it:
[Only registered and activated users can see links. Click Here To Register...]
08/03/2013 16:57 WyppyOne#10
thx :D it works , the button appear just at gm etc :D