|
|
@ -1,6 +1,6 @@ |
|
|
|
script_name("auto-ad") |
|
|
|
script_name("auto-ad") |
|
|
|
script_author("Serhiy_Rubin") |
|
|
|
script_author("Serhiy_Rubin") |
|
|
|
script_version("28.01.2023") |
|
|
|
script_version("30.06.2023") |
|
|
|
sampev = require("samp.events") |
|
|
|
sampev = require("samp.events") |
|
|
|
inicfg = require "inicfg" |
|
|
|
inicfg = require "inicfg" |
|
|
|
dlstatus = require("moonloader").download_status |
|
|
|
dlstatus = require("moonloader").download_status |
|
|
@ -56,17 +56,17 @@ text_to_int = { |
|
|
|
["LV"] = 3 |
|
|
|
["LV"] = 3 |
|
|
|
} |
|
|
|
} |
|
|
|
function sampev.onServerMessage(color, message) |
|
|
|
function sampev.onServerMessage(color, message) |
|
|
|
if message:find("Волна переключена на (.+) News") then |
|
|
|
if message:find("Волна переключена на News (.+)") then |
|
|
|
local text = message:match("Волна переключена на (.+) News") |
|
|
|
local text = message:match("Волна переключена на News (.+)") |
|
|
|
ad.radio = text_to_int[text] |
|
|
|
ad.radio = text_to_int[text] |
|
|
|
ad.radio_save = ad.radio |
|
|
|
ad.radio_save = ad.radio |
|
|
|
end |
|
|
|
end |
|
|
|
if message:find("Объявления можно дать через 5 секунд") then |
|
|
|
if message:find("Объявления можно дать через 5 секунд") then |
|
|
|
ad.af_5sec = os.clock() * 1000 |
|
|
|
ad.af_5sec = os.clock() * 1000 |
|
|
|
end |
|
|
|
end |
|
|
|
if message:find("Отредактировал сотрудник News (..)") then |
|
|
|
if message:find("Редакция News (..)%. Отредактировал") then |
|
|
|
if ad.status then |
|
|
|
if ad.status then |
|
|
|
local text = message:match("Отредактировал сотрудник News (..)") |
|
|
|
local text = message:match("Редакция News (..)%. Отредактировал") |
|
|
|
if ad.mode == 2 then |
|
|
|
if ad.mode == 2 then |
|
|
|
lua_thread.create(function(radio) |
|
|
|
lua_thread.create(function(radio) |
|
|
|
wait(30) |
|
|
|
wait(30) |
|
|
|