antiblock
https://arwen2.global/
  • Chatbox

    Did you check out our Discord? https://discord.gg/FFdvMjk9xA
    You don't have permission to chat.
    Load More
  • 0
Sign in to follow this  
DarkWolf

[Python]Botão Em Python

Question

Boas estou a tentar criar um botão em python que só seja visivel se o jogador tiver uma quest flag mas estou a ter algums problemas, quando entro no cliente ele cai.

 

quest

quest Button begin	state start begin		when login begin			if pc.getqf("test_1") == 1 then				cmdchat("SHOW_TEST_BUTTON 1")			end		end	endend

game.py

 

##TESTBUTTON"SHOW_TEST_BUTTON"          : self.__ShowTestButton,##END_TESTBUTTON

constInfo.py

SHOW_TEST_BUTTON = 0

 

uitarget.py

"TEST_BUTTON",self.buttonDict["TEST_BUTTON"].SetEvent(ui.__mem_func__(self.OnTest))if constInfo.SHOW_TEST_BUTTON() == 1:			self.__ShowTestButton("TEST_BUTTON")def OnTest(self):            net.SendChatPacket("/stun " + str(chr.GetNameByVID(self.vid)))

 

Se alguem poder ajudar agradecia.

 

Cumprimentos.

Share this post


Link to post
Share on other sites

2 answers to this question

  • 0
quest button begin state start begin when login begin cmdchat("SHOW_TEST_BUTTON "..pc.getqf("test_1")) end end end
game.py 
"SHOW_TEST_BUTTON"			: self.__ShowTestButton,def __ShowTestButton(self, qf):	constInfo.SHOW_TEST_BUTTON = int(qf)
uitarget.py 
"SHOW_TEST_BUTTON",def __init__if constInfo.SHOW_TEST_BUTTON == 1:	self.buttonDict["SHOW_TEST_BUTTON"].SetEvent(ui.__mem_func__(self.OnTest))def OnTest(self):	net.SendChatPacket("/stun " + str(chr.GetNameByVID(self.vid)))
constinfo.py
SHOW_TEST_BUTTON = 0

Share this post


Link to post
Share on other sites
antiblock
Cyphriun
  • 0

Não percebi esta parte:

 

 

uitarget.py
 
def __init__if constInfo.SHOW_TEST_BUTTON == 1:	self.buttonDict["SHOW_TEST_BUTTON"].SetEvent(ui.__mem_func__(self.OnTest))

 

Onde ponho isso?

 

é assim:

Imagem colocada

 

se for ta a dar erro, quando vou a fazer login o cliente cai.

Share this post


Link to post
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
Sign in to follow this