Особенности этого реконнекта
```lua
local Reconnector = {}
Reconnector.__index = Reconnector
function Reconnector:new(max_attempts, base_delay, max_delay)
    local obj = setmetatable({}, self)
    obj.max_attempts = max_attempts or 10
    obj.base_delay = base_delay or 2000
    obj.max_delay = max_delay or 20000
    obj.reconnecting = false
    obj.address = nil
    obj.port = nil
    return obj
end

function Reconnector:isReconnectNeeded()
    if not isSampAvailable() then return false end
    local state = sampGetGamestate()
    return state == 4 or state == 5
end

function Reconnector:manualReconnect()
    if self.reconnecting then
        sampAddChatMessage("{FFFF00}[Deep Reconnect] Уже идёт попытка переподключения.", -1)
        return
    end

    self.reconnecting = true
    lua_thread.create(function() self:deepReconnectRoutine() end)
end

function Reconnector:deepReconnectRoutine()
    self.address, self.port = sampGetCurrentServerAddress()
    if not self.address then
        sampAddChatMessage("{FF0000}[Deep Reconnect] Не удалось получить адрес сервера.", -1)
        self.reconnecting = false
        return
    end

    sampAddChatMessage(string.format("{FFFF00}[Deep Reconnect] Глубокий реконнект к %s:%d...", self.address, self.port), -1)
    local attempt = 1
    while attempt <= self.max_attempts do
        if not isSampAvailable() then
            sampAddChatMessage("{FF0000}[Deep Reconnect] SAMP недоступен, ожидание...", -1)
            wait(2000)
            attempt = attempt + 1
        else
            self:fullDisconnectSequence()
            if sampGetPlayerNickname then
                local nick = sampGetPlayerNickname()
                if not nick or #nick < 3 or #nick > 20 or not nick:match("^[a-zA-Z0-9_]+$") then
                    sampAddChatMessage("{FF0000}[Deep Reconnect] Некорректный ник! Исправьте ник в лаунчере SA-MP.", -1)
                    self.reconnecting = false
                    return
                end
            end

            local ok = false
            for i = 1, 3 do
                sampSetGamestate(4)
                wait(2000)
                ok = sampConnectToServer(self.address, self.port)
                if ok then break end
                wait(1000)
            end

            if ok then
                sampAddChatMessage(string.format("{00FF00}[Deep Reconnect] Попытка #%d отправлена.", attempt), -1)
            else
                sampAddChatMessage(string.format("{FF0000}[Deep Reconnect] Ошибка подключения (попытка #%d).", attempt), -1)
            end

            local wait_time = math.min(self.base_delay * 2 ^ (attempt - 1) + math.random(0, 500), self.max_delay)
            local timer = 0
            local connected = false
            while timer < wait_time do
                wait(500)
                timer = timer + 500
                if sampGetGamestate() == 3 then
                    connected = true
                    break
                end

                if self:isConnectionRejected() then
                    sampAddChatMessage("{FF0000}[Deep Reconnect] Сервер отклонил соединение (ник или слот). Повтор...", -1)
                    break
                end
            end

            if connected then
                sampAddChatMessage("{00FF00}[Deep Reconnect] Успешно переподключено!", -1)
                self.reconnecting = false
                return
            end

            attempt = attempt + 1
        end
    end

    sampAddChatMessage("{FF0000}[Deep Reconnect] Не удалось переподключиться после нескольких попыток.", -1)
    self.reconnecting = false
end

function Reconnector:fullDisconnectSequence()
    for i = 1, 2 do
        if sampGetGamestate() == 3 then
            sampDisconnectWithReason(1)
            wait(1500)
        end

        sampSetGamestate(4)
        wait(1000)
    end

    local wait_gs = 0
    while sampGetGamestate() ~= 4 and wait_gs < 7000 do
        wait(250)
        wait_gs = wait_gs + 250
    end

    wait(1000)
end

function Reconnector:isConnectionRejected()
    local state = sampGetGamestate()
    return state == 6 or state == 4 or state == 5
end

local reconnector = Reconnector:new(10, 2000, 20000)
function main()
    require"lib.sampfuncs"
    repeat
        wait(500)
    until isSampAvailable()

    sampAddChatMessage("{00FF00}[Deep Reconnect] Скрипт загружен.", -1)
    sampRegisterChatCommand("deepreconnect", function() reconnector:manualReconnect() end)
    while true do
        wait(1000)
        if not reconnector.reconnecting and reconnector:isReconnectNeeded() then
            reconnector.reconnecting = true
            lua_thread.create(function() reconnector:deepReconnectRoutine() end)
        end
    end
end
```