Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sampev = require 'lib.samp.events'
- notsend = {}
- message = ""
- function main()
- repeat wait(0) until isSampAvailable()
- wait(2000)
- sampAddChatMessage("spammer wersja mrucznik-rp /spammenu /startspam", 0xFFFFFF)
- sampRegisterChatCommand("spammenu", spammenuf)
- sampRegisterChatCommand("startspam", startspamf)
- while true do
- wait(0)
- end
- end
- function startspamf()
- for i = 0, sampGetMaxPlayerId(false) do
- if(has_value(notsend, i) == false and sampIsPlayerConnected(i)) then
- lua_thread.create(send, i)
- --sampSendChat(string.format("/w %d %s", i, message))
- --sampAddChatMessage(string.format("/pm %d %s", i, message), 0xFFFFFF)
- end
- end
- end
- function send(id)
- wait(400)
- sampSendChat(string.format("/w %d %s", id, message))
- end
- function spammenuf()
- menuString = ""
- finalString = ""
- for i = 1, #notsend do
- menuString = string.format("%s%d\n", menuString, notsend[i])
- end
- 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)
- sampShowDialog(1337, "Spam menu by Renosk", finalString, "Akcpetuj", "Wyjdz", 2)
- lua_thread.create(checkerdialog)
- end
- function checkerdialog2()
- while sampIsDialogActive() do
- wait(0)
- local result, button, list, input = sampHasDialogRespond(1338)
- if result and button == 1 then
- if sampIsPlayerConnected(tonumber(input)) then
- if has_value(notsend, tonumber(input)) == false then
- sampAddChatMessage(string.format("{FFFFFF}Pomyslnie dodales id: {FF0000}%d", tonumber(input)), 0xFFFFFF)
- table.insert(notsend, tonumber(input))
- menuString = ""
- finalString = ""
- for i = 1, #notsend do
- menuString = string.format("%s%d\n", menuString, notsend[i])
- end
- 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)
- sampShowDialog(1337, "Spam menu by Renosk", finalString, "Akcpetuj", "Wyjdz", 2)
- lua_thread.create(checkerdialog)
- else
- sampAddChatMessage("{FFFFFF}Uzytkownik zostal juz wpisany", 0xFFFFFF)
- end
- else
- sampAddChatMessage("{FF0000}Ten osobnik nie jest polaczony z serwerem")
- end
- end
- end
- end
- function checkerdialog3()
- while sampIsDialogActive() do
- wait(0)
- local result, button, list, input = sampHasDialogRespond(1340)
- if result and button == 1 then
- if input ~= nil or input ~= "" then
- message = input
- sampAddChatMessage(string.format("Pomyslnie zmieniles wiadomosc na: {FF0000}%s", message), 0xFFFFFF)
- end
- end
- end
- end
- function checkerdialog()
- while sampIsDialogActive() do
- wait(0)
- local result, button, list, input = sampHasDialogRespond(1337)
- if result and button == 1 then
- if list == #notsend then
- sampShowDialog(1338, "Spam menu by Renosk", "Podaj ID osobnika, ktoremu ma zostac niewysylany spam.", "OK", "Wyjdz", 1)
- lua_thread.create(checkerdialog2)
- elseif list == #notsend + 1 then
- sampShowDialog(1340, "Spam menu by Renosk", "Wpisz ponizej wiadomosc, ktora ma byc wysylana", "OK", "Wyjdz", 1)
- lua_thread.create(checkerdialog3)
- end
- end
- end
- end
- function has_value (tab, val)
- for index, value in ipairs(tab) do
- if value == val then
- return true
- end
- end
- return false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement