- Регистрация
- 12 Июн 2025
- Сообщения
- 31
- Реакции
- 3
- Баллы
- 28
Скрипт, который автоматически реконектнится на 2 минуты, если в рацию кто-то напишет ключевые слова:
"строй", "построение", "строе", "постройка", "стройтесь",
"неявка", "даю 5 минут", "Строй", "Неявка", "Даю 5 минут",
"Построение", "Постройка", "Стройтесь", "местоположение", "Местоположение"
Скрипт так-же реконекнится, если в рацию напишут ваш айди
например: 265, 2-6-5 и т.д
Скрипт предназначен для госсок, что б не давали выговоры за неявки в строй
local sampev = require("samp.events")
local myPlayerID = nil
local inventoryHintReceived = false
local function normalizeID(idText)
if not idText then return nil end
local cleanNumber = idText:gsub("[^%d]", "")
if cleanNumber == "" then return nil end
return tonumber(cleanNumber)
end
local function getMyID()
if type(getBotId) == "function" then return getBotId() end
if type(sampGetPlayerIdByCharHandle) == "function" then return sampGetPlayerIdByCharHandle(PLAYER_PED) end
return nil
end
local KEYWORDS = {
"строй", "построение", "строе", "постройка", "стройтесь",
"неявка", "даю 5 минут", "Строй", "Неявка", "Даю 5 минут",
"Построение", "Постройка", "Стройтесь", "местоположение", "Местоположение"
}
local function cleanOldID()
for i = #KEYWORDS, 1, -1 do
if type(KEYWORDS) == "string" and KEYWORDS:match("^%d+$") then
table.remove(KEYWORDS, i)
end
end
end
local function containsMyID(text)
if not myPlayerID or not text then return false end
local idStr = tostring(myPlayerID)
local pattern = idStr:gsub("(%d)", "%1[%-%s]?"):sub(1, -3)
local exactPattern = "%f[%d]"..pattern.."%f[%D]"
if text:match(exactPattern) then
return true, "ID в формате: "..idStr
end
for found in text:gmatch("%f[%d]%d+%f[%D]") do
if tonumber(found) == myPlayerID then
return true, "ID: "..found
end
end
return false
end
function sampev.onServerMessage(color, text)
if not text then return end
if text:find("{DFCFCF}%[Подсказка%] {DC4747}На сервере есть инвентарь") then
inventoryHintReceived = true
cleanOldID()
myPlayerID = getMyID()
if myPlayerID then table.insert(KEYWORDS, tostring(myPlayerID)) end
end
if text:find("%[R%]") then
local lowerText = text:lower()
for _, word in ipairs(KEYWORDS) do
if word and lowerText:find(word:lower(), 1, true) then
print("[АВТОРЕКОННЕКТ] Сработало на слово: "..word)
reconnect(300000)
return
end
end
local idFound, idFormat = containsMyID(text)
if idFound then
print("[АВТОРЕКОННЕКТ] Сработало на "..idFormat)
reconnect(120000)
end
end
if not myPlayerID then
local foundID = (text:match("%[ID:([%d%-]+)%]") or text:match("ID%s*[%.:]?%s*([%d%-]+)"))
if foundID then
cleanOldID()
myPlayerID = normalizeID(foundID)
if myPlayerID then table.insert(KEYWORDS, tostring(myPlayerID)) end
end
end
end
function main() end
"строй", "построение", "строе", "постройка", "стройтесь",
"неявка", "даю 5 минут", "Строй", "Неявка", "Даю 5 минут",
"Построение", "Постройка", "Стройтесь", "местоположение", "Местоположение"
Скрипт так-же реконекнится, если в рацию напишут ваш айди
например: 265, 2-6-5 и т.д
Скрипт предназначен для госсок, что б не давали выговоры за неявки в строй
local sampev = require("samp.events")
local myPlayerID = nil
local inventoryHintReceived = false
local function normalizeID(idText)
if not idText then return nil end
local cleanNumber = idText:gsub("[^%d]", "")
if cleanNumber == "" then return nil end
return tonumber(cleanNumber)
end
local function getMyID()
if type(getBotId) == "function" then return getBotId() end
if type(sampGetPlayerIdByCharHandle) == "function" then return sampGetPlayerIdByCharHandle(PLAYER_PED) end
return nil
end
local KEYWORDS = {
"строй", "построение", "строе", "постройка", "стройтесь",
"неявка", "даю 5 минут", "Строй", "Неявка", "Даю 5 минут",
"Построение", "Постройка", "Стройтесь", "местоположение", "Местоположение"
}
local function cleanOldID()
for i = #KEYWORDS, 1, -1 do
if type(KEYWORDS) == "string" and KEYWORDS:match("^%d+$") then
table.remove(KEYWORDS, i)
end
end
end
local function containsMyID(text)
if not myPlayerID or not text then return false end
local idStr = tostring(myPlayerID)
local pattern = idStr:gsub("(%d)", "%1[%-%s]?"):sub(1, -3)
local exactPattern = "%f[%d]"..pattern.."%f[%D]"
if text:match(exactPattern) then
return true, "ID в формате: "..idStr
end
for found in text:gmatch("%f[%d]%d+%f[%D]") do
if tonumber(found) == myPlayerID then
return true, "ID: "..found
end
end
return false
end
function sampev.onServerMessage(color, text)
if not text then return end
if text:find("{DFCFCF}%[Подсказка%] {DC4747}На сервере есть инвентарь") then
inventoryHintReceived = true
cleanOldID()
myPlayerID = getMyID()
if myPlayerID then table.insert(KEYWORDS, tostring(myPlayerID)) end
end
if text:find("%[R%]") then
local lowerText = text:lower()
for _, word in ipairs(KEYWORDS) do
if word and lowerText:find(word:lower(), 1, true) then
print("[АВТОРЕКОННЕКТ] Сработало на слово: "..word)
reconnect(300000)
return
end
end
local idFound, idFormat = containsMyID(text)
if idFound then
print("[АВТОРЕКОННЕКТ] Сработало на "..idFormat)
reconnect(120000)
end
end
if not myPlayerID then
local foundID = (text:match("%[ID:([%d%-]+)%]") or text:match("ID%s*[%.:]?%s*([%d%-]+)"))
if foundID then
cleanOldID()
myPlayerID = normalizeID(foundID)
if myPlayerID then table.insert(KEYWORDS, tostring(myPlayerID)) end
end
end
end
function main() end