cкрипт не работает без ctrl + R

Oki_Bern

Участник
Автор темы
169
6
Всем привет, столкнулся с такой проблемой, что cкрипт не работает без ctrl + R, захожу в игру не робит, после ctrl + r начинает работать, мб что то с кодом?
 
Решение
нет проверки на загруженность сампа
Lua:
local ctm = false
function main()
    repeat wait(0) until isSampAvailable()
    wait(1050)
    sampAddChatMessage("{FFFAFA} Активация по команде - /ctm", -1)
    sampRegisterChatCommand('ctm', function()
    ctm = not ctm -- переключаем статус скрипта, если была false станет true и наоборот
        sampAddChatMessage(ctm and "{7FFF00} Включен" or "{B22222} Выключен", -1) -- в чат напишет значение переменной "Ctm"
    end)
    while true do wait(0)
            if wasKeyPressed(96) and not sampIsCursorActive() then
                sampSendChat("/clist 0")
            end
                if wasKeyPressed(48) and not sampIsCursorActive() then
                    sampSendChat("/clist 0")...

Oki_Bern

Участник
Автор темы
169
6
Кинь скрипт сюда
Lua:
local ctm = false
function main()
    wait(1050)
    sampAddChatMessage("{FFFAFA} Активация по команде - /ctm", -1)
    sampRegisterChatCommand('ctm', function()
    ctm = not ctm -- переключаем статус скрипта, если была false станет true и наоборот
        sampAddChatMessage(ctm and "{7FFF00} Включен" or "{B22222} Выключен", -1) -- в чат напишет значение переменной "Ctm"
    end)
    while true do wait(0)
            if wasKeyPressed(96) and not sampIsCursorActive() then
                sampSendChat("/clist 0")
            end
                if wasKeyPressed(48) and not sampIsCursorActive() then
                    sampSendChat("/clist 0")
                end
        if ctm then -- если активно, то выполняется код ниже
            wait(1000)
        if isCharDead(PLAYER_PED) and not deat then
               dead = true
            elseif not isCharDead(PLAYER_PED) and dead then
               dead = false
                wait(500)
            sampSendChat("/clist 0")
                wait(1000)
            sampAddChatMessage("{FFFAFA}Активирован Clist 0", -1)
            end
        end
    end
end
 

percheklii

Известный
733
269
нет проверки на загруженность сампа
Lua:
local ctm = false
function main()
    repeat wait(0) until isSampAvailable()
    wait(1050)
    sampAddChatMessage("{FFFAFA} Активация по команде - /ctm", -1)
    sampRegisterChatCommand('ctm', function()
    ctm = not ctm -- переключаем статус скрипта, если была false станет true и наоборот
        sampAddChatMessage(ctm and "{7FFF00} Включен" or "{B22222} Выключен", -1) -- в чат напишет значение переменной "Ctm"
    end)
    while true do wait(0)
            if wasKeyPressed(96) and not sampIsCursorActive() then
                sampSendChat("/clist 0")
            end
                if wasKeyPressed(48) and not sampIsCursorActive() then
                    sampSendChat("/clist 0")
                end
        if ctm then -- если активно, то выполняется код ниже
            wait(1000)
        if isCharDead(PLAYER_PED) and not deat then
               dead = true
            elseif not isCharDead(PLAYER_PED) and dead then
               dead = false
                wait(500)
            sampSendChat("/clist 0")
                wait(1000)
            sampAddChatMessage("{FFFAFA}Активирован Clist 0", -1)
            end
        end
    end
end
 
  • Нравится
Реакции: Oki_Bern и Maxim25012