Advertisement
nodevprogrammer

[TFM] Report Bug

May 9th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.24 KB | None | 0 0
  1. -- Script Report Bug by: Natsmiro#0000
  2.  
  3.  
  4. adm = "Natsmiro#0000"
  5.  
  6. local reportList = {}
  7. local reportPopupId = 1
  8.  
  9. function eventChatCommand(p, cmd)
  10.     local cmds = {}
  11.  
  12.     for value in cmd:gmatch("%S+") do
  13.         cmds[#cmds + 1] = tonumber(value) or value
  14.     end
  15.  
  16.     if cmds[1] == "report" and not cmds[2] then
  17.         ui.addPopup(reportPopupId, 2, "Relatar um erro:", p, 400-(300/2), 180, 300, true)
  18.     end
  19.  
  20.     -- Cargos altos
  21.     if cmd and p == adm then
  22.  
  23.         if cmds[1] == "report" and cmds[2] == "delete" and cmds[3] then
  24.             table.remove(reportList, cmds[3])
  25.             print("Relato número " .. cmds[3] .." removido com sucesso.", p)
  26.         end
  27.  
  28.         if (cmd == "reportlist") or (cmds[1] == "report" and cmds[2] == "list") then
  29.             if #reportList > 0 then
  30.                 print("<font color='#ed67ea'>[+] Bugs reportados no jogo:</font>", p)
  31.                 for number,list in ipairs(reportList) do
  32.                     print("<font color='#ffc800'>ID: " .. number .. "</font><font color='#6C77C1'>, - </font>" .. list, p)
  33.                 end
  34.             else
  35.                 print("<font color='#2ecf73'>Nenhum bug relatado. :)</font>")
  36.             end
  37.         end
  38.     end
  39. end
  40.  
  41. function eventPopupAnswer(popupId, p, answer)
  42.     reportList[#reportList + 1] = os.date("(%d/%m/%y) ") .. p .." : " .. tostring(answer) -- os.date("%m/%d/%y") se for internacional
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement