Помощь с lua стробоскопами.

3aypov

Новичок
Автор темы
3
0
Привет, парни, в общем.
Скачал lua стробоскопы, но они слишком частые, ну, часто мерцают, короче. но в силу того, что в lua скриптинге я ну совсем аутсайдер, решил попросить помощи у вас. Можно ли поставить задержку побольше, чтоб они так жёстко не мерцали? Здесь же прикреплю код и сам файл lua.


Stroboscopes:
script_name("Stroboscopes")
local showText = false -- показывать ли надпись STROBOSCOPES на экране. Да/Нет - true/false

script_description([[
    Стробоскопы, работающие синхронно с сиреной.
    Активация: зажатие L.Alt на секунду; команда /strobes; включение сирены
    
    История изменений:
    19.03.2019 - добавление автообновления, исправление бага с мотоциклом, возможность отключение надписи STROBOSCOPES
]])
script_version("19.03.2019")
script_author("AppleThe; http://athe.ml")

require "lib.moonloader"
local encoding = require 'encoding'
encoding.default = 'CP1251'

function main()
    if not isCleoLoaded() or not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    
    sampRegisterChatCommand("strobes", function()
        if isCharInAnyCar(PLAYER_PED) then
            local car = storeCarCharIsInNoSave(PLAYER_PED)
            local driverPed = getDriverOfCar(car)
            
            if PLAYER_PED == driverPed then
                local state = not isCarSirenOn(car)
                switchCarSiren(car, state)
            end
        end
    end)
    lua_thread.create(strobe)
    if showText then lua_thread.create(strobeText) end
    
    while true do
        wait(0)
        
        if isCharInAnyCar(PLAYER_PED) then
        
            local car = storeCarCharIsInNoSave(PLAYER_PED)
            local driverPed = getDriverOfCar(car)
            
            if isKeyDown(VK_LMENU) and isKeyCheckAvailable() and driverPed == PLAYER_PED then
                local state = true
                
                for i = 1, 10 do
                    wait(100)
                    if not isKeyDown(VK_LMENU) then state = false end
                end
                
                if isKeyDown(VK_LMENU) and state then
                    
                    local state = not isCarSirenOn(car)
                    switchCarSiren(car, state)
                    
                    while isKeyDown(VK_LMENU) do wait(0) end
                
                end
                
            end
            
        end
        
        
    end
end

function stroboscopes(adress, ptr, _1, _2, _3, _4) -- функция стробоскопов
    if not isCharInAnyCar(PLAYER_PED) then return end
    
    if not isCarSirenOn(storeCarCharIsInNoSave(PLAYER_PED)) then
        forceCarLights(storeCarCharIsInNoSave(PLAYER_PED), 0)
        callMethod(7086336, ptr, 2, 0, 1, 3)
        callMethod(7086336, ptr, 2, 0, 0, 0)
        callMethod(7086336, ptr, 2, 0, 1, 0)
        markCarAsNoLongerNeeded(storeCarCharIsInNoSave(PLAYER_PED))
        return
    end

    callMethod(adress, ptr, _1, _2, _3, _4)
end

function strobeText() -- надпись STROBOSCOPES
    local sequence = true
    while true do
        wait(0)
        if isCharInAnyCar(PLAYER_PED) then
        
            local car = storeCarCharIsInNoSave(PLAYER_PED)
            local driverPed = getDriverOfCar(car)
            
            if isCarSirenOn(car) and PLAYER_PED == driverPed then
                
                if sequence then printStyledString('~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~b~STROB~w~OS~r~COPES', 1000, 4)
                else printStyledString('~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~STROB~w~OS~b~COPES', 1000, 4) end
                
                sequence = not sequence
                wait(950)
                
            end
        end
    end
end

function strobe() -- главый скрипт
    while true do
        wait(0)
        
        if isCharInAnyCar(PLAYER_PED) then
        
            local car = storeCarCharIsInNoSave(PLAYER_PED)
            local driverPed = getDriverOfCar(car)
            
            if isCarSirenOn(car) and PLAYER_PED == driverPed then
            
                local ptr = getCarPointer(car) + 1440
                forceCarLights(car, 2)
                wait(50)
                stroboscopes(7086336, ptr, 2, 0, 1, 3)

                while isCarSirenOn(car) do
                    wait(0)
                    for i = 1, 12 do
                        wait(100)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        wait(100)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        wait(100)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        wait(100)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                    end
                    
                    if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end

                    for i = 1, 6 do
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 1, 3)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                        wait(300)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                    end
                    
                    if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end

                    for i = 1, 3 do
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 1, 3)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(60)
                        if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(350)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        wait(60)
                        if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(50)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        wait(50)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(100)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(100)
                        if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(100)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                    end
                    
                    if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                end
            end
        end
    end
end

function isKeyCheckAvailable()
  if not isSampfuncsLoaded() then
    return not isPauseMenuActive()
  end
  local result = not isSampfuncsConsoleActive() and not isPauseMenuActive()
  if isSampLoaded() and isSampAvailable() then
    result = result and not sampIsChatInputActive() and not sampIsDialogActive()
  end
  return result
end

function isCharInAnyCar(ped) -- проверка находится ли игрок в автомобиле
    local vehicles = {602, 545, 496, 517, 401, 410, 518, 600, 527, 436, 589, 580, 419, 439, 533, 549, 526, 491, 474, 445, 467, 604, 426, 507, 547, 585, 405, 587, 409, 466, 550, 492, 566, 546, 540, 551, 421, 516, 529, 485, 552, 431, 438, 437, 574, 420, 525, 408, 416, 596, 433, 597, 427, 599, 490, 528, 601, 407, 428, 544, 470, 598, 499, 588, 609, 403, 498, 514, 524, 423, 532, 414, 578, 443, 486, 515, 406, 531, 573, 456, 455, 459, 543, 422, 583, 482, 478, 605, 554, 530, 418, 572, 582, 413, 440, 536, 575, 534, 567, 535, 576, 412, 402, 542, 603, 475, 568, 557, 424, 471, 504, 495, 457, 483, 508, 500, 444, 556, 429, 411, 541, 559, 415, 561, 480, 560, 562, 506, 565, 451, 434, 558, 494, 555, 502, 477, 503, 579, 400, 404, 489, 505, 479, 442, 458}
    for i, v in ipairs(vehicles) do
        if isCharInModel(ped, v) then return true end
    end
    return false
end

function onSystemInitialized() -- проверка на наличие новых версий
    lua_thread.create(function()
        while not isSampAvailable() do wait(100) end
        local dlstatus = require('moonloader').download_status
        local json = getWorkingDirectory() .. '\\'..thisScript().name..'-version.json'
        if doesFileExist(json) then os.remove(json) end
        downloadUrlToFile('https://api.jsonbin.io/b/5c90dac82d33133c40171a9f/latest', json,
        function(id, status, p1, p2)
            if status == dlstatus.STATUSEX_ENDDOWNLOAD then
                if doesFileExist(json) then
                    local f = io.open(json, 'r')
                    if f then
                        local info = decodeJson(f:read('*a'))
                        f:close()
                        os.remove(json)
                        if info.latest ~= thisScript().version then
                            info.changelog = info.changelog:gsub('%[', '{00d659}'); info.changelog = info.changelog:gsub('%]', '{ffffff}')
                            math.randomseed(os.time())
                            local command = 'info' .. math.random(100, 999)
                            local dialog = '{ffffff}Новая версия скрипта: {00b84d}' .. info.latest .. '{ffffff}, текущая: {00b84d}' .. thisScript().version .. '{ffffff}\n\n' .. encoding.UTF8:decode(info.changelog) .. '\n\n{b8e0c9}Ссылка на новую версию скопирована в буфер обмена'
                            setClipboardText(info.scripturl)
                            sampAddChatMessage('{00d659}[' .. thisScript().name .. ']{ffffff} Обнаружено обновление скрипта. Введите {00d659}/' .. command .. '{ffffff} чтобы увидеть подробности', -1)
                            sampRegisterChatCommand(command, function() sampShowDialog(math.random(800), thisScript().name, dialog, 'Закрыть', '', 0) end)
                        end
                    end
                end
            end
        end)
    end)
end
 

Вложения

  • Stroboscopes.rar
    2.7 KB · Просмотры: 41

Fuexie

Известный
108
30
Привет, парни, в общем.
Скачал lua стробоскопы, но они слишком частые, ну, часто мерцают, короче. но в силу того, что в lua скриптинге я ну совсем аутсайдер, решил попросить помощи у вас. Можно ли поставить задержку побольше, чтоб они так жёстко не мерцали? Здесь же прикреплю код и сам файл lua.


Stroboscopes:
script_name("Stroboscopes")
local showText = false -- показывать ли надпись STROBOSCOPES на экране. Да/Нет - true/false

script_description([[
    Стробоскопы, работающие синхронно с сиреной.
    Активация: зажатие L.Alt на секунду; команда /strobes; включение сирены
  
    История изменений:
    19.03.2019 - добавление автообновления, исправление бага с мотоциклом, возможность отключение надписи STROBOSCOPES
]])
script_version("19.03.2019")
script_author("AppleThe; http://athe.ml")

require "lib.moonloader"
local encoding = require 'encoding'
encoding.default = 'CP1251'

function main()
    if not isCleoLoaded() or not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
  
    sampRegisterChatCommand("strobes", function()
        if isCharInAnyCar(PLAYER_PED) then
            local car = storeCarCharIsInNoSave(PLAYER_PED)
            local driverPed = getDriverOfCar(car)
          
            if PLAYER_PED == driverPed then
                local state = not isCarSirenOn(car)
                switchCarSiren(car, state)
            end
        end
    end)
    lua_thread.create(strobe)
    if showText then lua_thread.create(strobeText) end
  
    while true do
        wait(0)
      
        if isCharInAnyCar(PLAYER_PED) then
      
            local car = storeCarCharIsInNoSave(PLAYER_PED)
            local driverPed = getDriverOfCar(car)
          
            if isKeyDown(VK_LMENU) and isKeyCheckAvailable() and driverPed == PLAYER_PED then
                local state = true
              
                for i = 1, 10 do
                    wait(100)
                    if not isKeyDown(VK_LMENU) then state = false end
                end
              
                if isKeyDown(VK_LMENU) and state then
                  
                    local state = not isCarSirenOn(car)
                    switchCarSiren(car, state)
                  
                    while isKeyDown(VK_LMENU) do wait(0) end
              
                end
              
            end
          
        end
      
      
    end
end

function stroboscopes(adress, ptr, _1, _2, _3, _4) -- функция стробоскопов
    if not isCharInAnyCar(PLAYER_PED) then return end
  
    if not isCarSirenOn(storeCarCharIsInNoSave(PLAYER_PED)) then
        forceCarLights(storeCarCharIsInNoSave(PLAYER_PED), 0)
        callMethod(7086336, ptr, 2, 0, 1, 3)
        callMethod(7086336, ptr, 2, 0, 0, 0)
        callMethod(7086336, ptr, 2, 0, 1, 0)
        markCarAsNoLongerNeeded(storeCarCharIsInNoSave(PLAYER_PED))
        return
    end

    callMethod(adress, ptr, _1, _2, _3, _4)
end

function strobeText() -- надпись STROBOSCOPES
    local sequence = true
    while true do
        wait(0)
        if isCharInAnyCar(PLAYER_PED) then
      
            local car = storeCarCharIsInNoSave(PLAYER_PED)
            local driverPed = getDriverOfCar(car)
          
            if isCarSirenOn(car) and PLAYER_PED == driverPed then
              
                if sequence then printStyledString('~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~b~STROB~w~OS~r~COPES', 1000, 4)
                else printStyledString('~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~STROB~w~OS~b~COPES', 1000, 4) end
              
                sequence = not sequence
                wait(950)
              
            end
        end
    end
end

function strobe() -- главый скрипт
    while true do
        wait(0)
      
        if isCharInAnyCar(PLAYER_PED) then
      
            local car = storeCarCharIsInNoSave(PLAYER_PED)
            local driverPed = getDriverOfCar(car)
          
            if isCarSirenOn(car) and PLAYER_PED == driverPed then
          
                local ptr = getCarPointer(car) + 1440
                forceCarLights(car, 2)
                wait(50)
                stroboscopes(7086336, ptr, 2, 0, 1, 3)

                while isCarSirenOn(car) do
                    wait(0)
                    for i = 1, 12 do
                        wait(100)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        wait(100)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        wait(100)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        wait(100)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                    end
                  
                    if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end

                    for i = 1, 6 do
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 1, 3)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                        wait(300)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                    end
                  
                    if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end

                    for i = 1, 3 do
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 1, 3)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(60)
                        if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        wait(60)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(350)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        wait(60)
                        if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(50)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        wait(50)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(100)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(100)
                        if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        wait(100)
                        stroboscopes(7086336, ptr, 2, 0, 0, 1)
                        stroboscopes(7086336, ptr, 2, 0, 1, 0)
                        wait(80)
                        stroboscopes(7086336, ptr, 2, 0, 1, 1)
                        stroboscopes(7086336, ptr, 2, 0, 0, 0)
                        if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                    end
                  
                    if not isCarSirenOn(car) or not isCharInAnyCar(PLAYER_PED) then break end
                end
            end
        end
    end
end

function isKeyCheckAvailable()
  if not isSampfuncsLoaded() then
    return not isPauseMenuActive()
  end
  local result = not isSampfuncsConsoleActive() and not isPauseMenuActive()
  if isSampLoaded() and isSampAvailable() then
    result = result and not sampIsChatInputActive() and not sampIsDialogActive()
  end
  return result
end

function isCharInAnyCar(ped) -- проверка находится ли игрок в автомобиле
    local vehicles = {602, 545, 496, 517, 401, 410, 518, 600, 527, 436, 589, 580, 419, 439, 533, 549, 526, 491, 474, 445, 467, 604, 426, 507, 547, 585, 405, 587, 409, 466, 550, 492, 566, 546, 540, 551, 421, 516, 529, 485, 552, 431, 438, 437, 574, 420, 525, 408, 416, 596, 433, 597, 427, 599, 490, 528, 601, 407, 428, 544, 470, 598, 499, 588, 609, 403, 498, 514, 524, 423, 532, 414, 578, 443, 486, 515, 406, 531, 573, 456, 455, 459, 543, 422, 583, 482, 478, 605, 554, 530, 418, 572, 582, 413, 440, 536, 575, 534, 567, 535, 576, 412, 402, 542, 603, 475, 568, 557, 424, 471, 504, 495, 457, 483, 508, 500, 444, 556, 429, 411, 541, 559, 415, 561, 480, 560, 562, 506, 565, 451, 434, 558, 494, 555, 502, 477, 503, 579, 400, 404, 489, 505, 479, 442, 458}
    for i, v in ipairs(vehicles) do
        if isCharInModel(ped, v) then return true end
    end
    return false
end

function onSystemInitialized() -- проверка на наличие новых версий
    lua_thread.create(function()
        while not isSampAvailable() do wait(100) end
        local dlstatus = require('moonloader').download_status
        local json = getWorkingDirectory() .. '\\'..thisScript().name..'-version.json'
        if doesFileExist(json) then os.remove(json) end
        downloadUrlToFile('https://api.jsonbin.io/b/5c90dac82d33133c40171a9f/latest', json,
        function(id, status, p1, p2)
            if status == dlstatus.STATUSEX_ENDDOWNLOAD then
                if doesFileExist(json) then
                    local f = io.open(json, 'r')
                    if f then
                        local info = decodeJson(f:read('*a'))
                        f:close()
                        os.remove(json)
                        if info.latest ~= thisScript().version then
                            info.changelog = info.changelog:gsub('%[', '{00d659}'); info.changelog = info.changelog:gsub('%]', '{ffffff}')
                            math.randomseed(os.time())
                            local command = 'info' .. math.random(100, 999)
                            local dialog = '{ffffff}Новая версия скрипта: {00b84d}' .. info.latest .. '{ffffff}, текущая: {00b84d}' .. thisScript().version .. '{ffffff}\n\n' .. encoding.UTF8:decode(info.changelog) .. '\n\n{b8e0c9}Ссылка на новую версию скопирована в буфер обмена'
                            setClipboardText(info.scripturl)
                            sampAddChatMessage('{00d659}[' .. thisScript().name .. ']{ffffff} Обнаружено обновление скрипта. Введите {00d659}/' .. command .. '{ffffff} чтобы увидеть подробности', -1)
                            sampRegisterChatCommand(command, function() sampShowDialog(math.random(800), thisScript().name, dialog, 'Закрыть', '', 0) end)
                        end
                    end
                end
            end
        end)
    end)
end
Ну тут даже комментарии есть. Кста советую убрать автообновление, но это на твое усмотрение, т.к. автор может подгрузить стиллер на автообновление, ну а с другой стороны может выйти риально годное обновление.
Задержку изменить можно, если у тебя стоит AutoReboot, то вообще шик. Вон function strobe, это тебе надо. Играйся со значениями 'wait' кроме тех, у которых, у которых задержка нуль, их не трогай.