antiblock
diamwall
  • Chatbox

    You don't have permission to chat.
    Load More
  • 0
Sign in to follow this  
Snooke

Erro numa Quest de GM

Question

Boas Pessoal.

Estou a ter um seguinte erro na quest 

0iK.png

 

Porém, acho que tenho as coisas bem fechadas e não estou a conseguir ver onde está o problema..

 

Pastebin: http://pastebin.com/GRiLacW7

 

Código sem ser pastebin:

 

quest gm_painel begin
	state start begin
		when letter with pc.is_gm() begin
			send_letter("GM")
		end

		when button or info begin 
			local senha_secreta = "12345"

			say_title("GM")
			say("Seleciona uma Opção:")

			local principal = select("Eventos", "Bloqueamentos", "Fechar")

			if principal == 1 then
				say_title("Eventos")
				say("Seleciona uma Opção:")

				local eventos = select("Evento OX", "Fechar")

				if eventos == 1 then
					set_quest_state("ox_event","ox")
         		else
					return
				end
				
			elseif principal == 2 then
				say_title("Bloqueamentos")
				say("Seleciona uma Opção:")
				local opcao_ban = select("Bloquear Contas")
				if opcao_ban == 1 then
					say_title("Bloquear Contas")
					say("Introduz o nome do jogador:")
					local nome = input()
					local encontrar_jogador = mysql_query("SELECT COUNT(*) FROM player.player WHERE name = '"..nome"'")
					say_title("Bloquear Contas")
					if nome = "" then
						say("Introduz um nome.")
						return
					elseif nome == pc.get_name() then
						say("Não podes fazer isso.")
						return
					elseif encontrar_jogador[1][1] == "0" then
						say("O jogador "..nome.." não existe")
						return
					end
				
					say_reward("Queres bloquear a conta do jogador "..nome.." ?")
					if select("Sim","Não") == 2 then return end
					say_title("Senha de Segurança")
					say("Descrição")
					local senha = input()
					
					if senha == senha_secreta then
						local encontrar_jogador_id = mysql_query("SELECT account_id FROM player.player WHERE name = '"..nome.."'")
						local jogador_id = encontrar_jogador_id[1][1]
						local verificar_ban = mysql_query("SELECT status FROM account.account WHERE id = '"..jogador_id.."'")
						if verificar_ban[1][1] == "BLOCK" then
							say_title("Bloquear Contas")
							say("A conta do jogador "..nome.." já está bloqueada")
							return
						end
						
						mysql_query("UPDATE account.account SET status = 'BLOCK' WHERE id = '"..jogador_id.."' LIMIT 1")
						say_title("Bloquear Contas")
						say_reward("A conta do jogador "..nome.." foi bloqueada.")
						
					else
						say_title("Senha Secreta")
						say("A senha de segurança está incorreta.")
						return
					end				
				end

			elseif principal == 3 then
				return
			end			
		end		
	end
end

 

Edited by αท∂ré
Spoiler (see edit history)

Share this post


Link to post
Share on other sites

4 answers to this question

  • 0
3 minutos atrás, Cσяvσ⋆ disse:

Penso que o erro está em:

if nome = "" then

 

Altera-o para:
if nome == "" then

 

3 minutos atrás, NewWars disse:

0iZ.png

 

Falta de append após append feito com a literal string prefixa e = nome em baixo

Correto: "..nome.." e == nome

 

 

Cumprimentos.

Era isso, não tinha reparado que faltavam esses append e um =

Obrigado aos dois :)

 

Podem fechar o tópico se quiserem :P

Share this post


Link to post
Share on other sites
antiblock
Rodnia | Alpha & Omega
  • 1

Penso que o erro está em:

if nome = "" then

 

Altera-o para:
if nome == "" then

Share this post


Link to post
Share on other sites
  • 0

0iZ.png

 

Falta de append após append feito com a literal string prefixa e = nome em baixo

"..var = append a prefixo

var.." = append a sufixo

 

x1 =  igual a assign
x2 = igual a comparação bool

 

Correto:

   "..nome.."

   == nome

 

 

Cumprimentos.

Share this post


Link to post
Share on other sites
  • 0

Dúvida resolvida.

Tópico fechado.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this