Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. local sampev = require 'lib.samp.events'
  2. notsend = {}
  3. message = ""
  4.  
  5. function main()
  6. repeat wait(0) until isSampAvailable()
  7. wait(2000)
  8. sampAddChatMessage("spammer wersja mrucznik-rp /spammenu /startspam", 0xFFFFFF)
  9. sampRegisterChatCommand("spammenu", spammenuf)
  10. sampRegisterChatCommand("startspam", startspamf)
  11. while true do
  12. wait(0)
  13. end
  14. end
  15.  
  16. function startspamf()
  17. for i = 0, sampGetMaxPlayerId(false) do
  18. if(has_value(notsend, i) == false and sampIsPlayerConnected(i)) then
  19. lua_thread.create(send, i)
  20. --sampSendChat(string.format("/w %d %s", i, message))
  21. --sampAddChatMessage(string.format("/pm %d %s", i, message), 0xFFFFFF)
  22. end
  23. end
  24. end
  25.  
  26. function send(id)
  27. wait(400)
  28. sampSendChat(string.format("/w %d %s", id, message))
  29. end
  30.  
  31. function spammenuf()
  32. menuString = ""
  33. finalString = ""
  34. for i = 1, #notsend do
  35. menuString = string.format("%s%d\n", menuString, notsend[i])
  36. end
  37. finalString = string.format("%s{00FF00}Dodaj osobnika, ktoremu ma byc niewysylany spam.\n{FFFFFF}Edytuj wiadomosc, ktora ma byc wysylana\n{FFFFFF}Wiadomosc: {00FF00}%s", menuString, message)
  38. sampShowDialog(1337, "Spam menu by Renosk", finalString, "Akcpetuj", "Wyjdz", 2)
  39. lua_thread.create(checkerdialog)
  40. end
  41.  
  42. function checkerdialog2()
  43. while sampIsDialogActive() do
  44. wait(0)
  45. local result, button, list, input = sampHasDialogRespond(1338)
  46. if result and button == 1 then
  47. if sampIsPlayerConnected(tonumber(input)) then
  48. if has_value(notsend, tonumber(input)) == false then
  49. sampAddChatMessage(string.format("{FFFFFF}Pomyslnie dodales id: {FF0000}%d", tonumber(input)), 0xFFFFFF)
  50. table.insert(notsend, tonumber(input))
  51. menuString = ""
  52. finalString = ""
  53. for i = 1, #notsend do
  54. menuString = string.format("%s%d\n", menuString, notsend[i])
  55. end
  56. finalString = string.format("%s{00FF00}Dodaj osobnika, ktoremu ma byc niewysylany spam.\n{FFFFFF}Edytuj wiadomosc, ktora ma byc wysylana\n{FFFFFF}Wiadomosc: {00FF00}%s", menuString, message)
  57. sampShowDialog(1337, "Spam menu by Renosk", finalString, "Akcpetuj", "Wyjdz", 2)
  58. lua_thread.create(checkerdialog)
  59. else
  60. sampAddChatMessage("{FFFFFF}Uzytkownik zostal juz wpisany", 0xFFFFFF)
  61. end
  62. else
  63. sampAddChatMessage("{FF0000}Ten osobnik nie jest polaczony z serwerem")
  64. end
  65. end
  66. end
  67. end
  68.  
  69. function checkerdialog3()
  70. while sampIsDialogActive() do
  71. wait(0)
  72. local result, button, list, input = sampHasDialogRespond(1340)
  73. if result and button == 1 then
  74. if input ~= nil or input ~= "" then
  75. message = input
  76. sampAddChatMessage(string.format("Pomyslnie zmieniles wiadomosc na: {FF0000}%s", message), 0xFFFFFF)
  77. end
  78. end
  79. end
  80. end
  81.  
  82. function checkerdialog()
  83. while sampIsDialogActive() do
  84. wait(0)
  85. local result, button, list, input = sampHasDialogRespond(1337)
  86. if result and button == 1 then
  87. if list == #notsend then
  88. sampShowDialog(1338, "Spam menu by Renosk", "Podaj ID osobnika, ktoremu ma zostac niewysylany spam.", "OK", "Wyjdz", 1)
  89. lua_thread.create(checkerdialog2)
  90. elseif list == #notsend + 1 then
  91. sampShowDialog(1340, "Spam menu by Renosk", "Wpisz ponizej wiadomosc, ktora ma byc wysylana", "OK", "Wyjdz", 1)
  92. lua_thread.create(checkerdialog3)
  93. end
  94. end
  95. end
  96. end
  97.  
  98. function has_value (tab, val)
  99. for index, value in ipairs(tab) do
  100. if value == val then
  101. return true
  102. end
  103. end
  104.  
  105. return false
  106. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement