Advertisement
Guest User

Untitled

a guest
Dec 20th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.34 KB | None | 0 0
  1. quest gm_painel begin
  2.     state start begin
  3.         when letter with pc.is_gm() begin
  4.             send_letter("GM")
  5.         end
  6.  
  7.         when button or info begin
  8.             local senha_secreta = "12345"
  9.  
  10.             say_title("GM")
  11.             say("Seleciona uma Opção:")
  12.  
  13.             local principal = select("Eventos", "Bloqueamentos", "Fechar")
  14.  
  15.             if principal == 1 then
  16.                 say_title("Eventos")
  17.                 say("Seleciona uma Opção:")
  18.  
  19.                 local eventos = select("Evento OX", "Fechar")
  20.  
  21.                 if eventos == 1 then
  22.                     set_quest_state("ox_event","ox")
  23.                 else
  24.                     return
  25.                 end
  26.                
  27.             elseif principal == 2 then
  28.                 say_title("Bloqueamentos")
  29.                 say("Seleciona uma Opção:")
  30.                 local opcao_ban = select("Bloquear Contas")
  31.                 if opcao_ban == 1 then
  32.                     say_title("Bloquear Contas")
  33.                     say("Introduz o nome do jogador:")
  34.                     local nome = input()
  35.                     local encontrar_jogador = mysql_query("SELECT COUNT(*) FROM player.player WHERE name = '"..nome"'")
  36.                     say_title("Bloquear Contas")
  37.                     if nome = "" then
  38.                         say("Introduz um nome.")
  39.                         return
  40.                     elseif nome == pc.get_name() then
  41.                         say("Não podes fazer isso.")
  42.                         return
  43.                     elseif encontrar_jogador[1][1] == "0" then
  44.                         say("O jogador "..nome.." não existe")
  45.                         return
  46.                     end
  47.                
  48.                     say_reward("Queres bloquear a conta do jogador "..nome.." ?")
  49.                     if select("Sim","Não") == 2 then return end
  50.                     say_title("Senha de Segurança")
  51.                     say("Descrição")
  52.                     local senha = input()
  53.                    
  54.                     if senha == senha_secreta then
  55.                         local encontrar_jogador_id = mysql_query("SELECT account_id FROM player.player WHERE name = '"..nome.."'")
  56.                         local jogador_id = encontrar_jogador_id[1][1]
  57.                         local verificar_ban = mysql_query("SELECT status FROM account.account WHERE id = '"..jogador_id.."'")
  58.                         if verificar_ban[1][1] == "BLOCK" then
  59.                             say_title("Bloquear Contas")
  60.                             say("A conta do jogador "..nome.." já está bloqueada")
  61.                             return
  62.                         end
  63.                        
  64.                         mysql_query("UPDATE account.account SET status = 'BLOCK' WHERE id = '"..jogador_id.."' LIMIT 1")
  65.                         say_title("Bloquear Contas")
  66.                         say_reward("A conta do jogador "..nome.." foi bloqueada.")
  67.                        
  68.                     else
  69.                         say_title("Senha Secreta")
  70.                         say("A senha de segurança está incorreta.")
  71.                         return
  72.                     end            
  73.                 end
  74.  
  75.             elseif principal == 3 then
  76.                 return
  77.             end        
  78.         end    
  79.     end
  80. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement