Постоянно включенный скрипт

ccv

Новичок
Автор темы
23
5
Версия MoonLoader
.026-beta
Мне нужно чтобы при входе в игру скрипт уже работал без прописывания команд, ниже скрипт:

антиафк:
script_author("RayssesEmpire")
require 'lib.moonloader'
local memory = require 'memory'

-- Тело скрипта
function main()
    -- Проверяем, загружен ли SAMP и SAMPFUNCS
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
   
    -- Проверяем инициализацию структур SAMP
    while not isSampAvailable() do wait(100) end
   
    -- Регистрируем команды
    sampRegisterChatCommand('fk', aAfk)
   
    writeMemory(7634870, 1, 0, 0)
    writeMemory(7635034, 1, 0, 0)
    memory.hex2bin('5051FF1500838500', 7623723, 8)
    memory.hex2bin('0F847B010000', 5499528, 6)

    wait(-1)
end

function aAfk()
    actAFK = not actAFK
    if actAFK then
        writeMemory(7634870, 1, 1, 1)
        writeMemory(7635034, 1, 1, 1)
        memory.fill(7623723, 144, 8)
        memory.fill(5499528, 144, 6)
        addOneOffSound(0.0, 0.0, 0.0, 1136)
        printString('~g~ FK ON', 2000)
    else
        writeMemory(7634870, 1, 0, 0)
        writeMemory(7635034, 1, 0, 0)
        memory.hex2bin('5051FF1500838500', 7623723, 8)
        memory.hex2bin('0F847B010000', 5499528, 6)
        addOneOffSound(0.0, 0.0, 0.0, 1136)
        printString('~r~ FK OFF', 2000)
    end
end
Как это можно вооплатить?
 
Последнее редактирование:
  • Bug
Реакции: qdIbp
Решение
Lua:
script_author("RayssesEmpire")
require 'lib.moonloader'
local memory = require 'memory'
local actAFK = true -- default active

-- Тело скрипта
function main()
    -- Проверяем, загружен ли SAMP и SAMPFUNCS
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
 
    -- Проверяем инициализацию структур SAMP
    while not isSampAvailable() do wait(100) end

    aAfk()
 
    -- Регистрируем команды
    sampRegisterChatCommand('fk', function()
    actAFK = not actAFK
    aAfk()
    end)
 
    writeMemory(7634870, 1, 0, 0)
    writeMemory(7635034, 1, 0, 0)
    memory.hex2bin('5051FF1500838500', 7623723, 8)
    memory.hex2bin('0F847B010000', 5499528, 6)

    wait(-1)
end

function aAfk()
    if actAFK then...

qdIbp

Автор темы
Проверенный
1,444
1,187
Так?
Lua:
script_author("RayssesEmpire")
require('lib.moonloader')
local memory = require( 'memory')

-- Тело скрипта
function main()
    -- Проверяем инициализацию структур SAMP
    while not isSampAvailable() do wait(100) end
  
    -- Регистрируем команды
    sampRegisterChatCommand('fk', aAfk)
  
    writeMemory(7634870, 1, 0, 0)
    writeMemory(7635034, 1, 0, 0)
    memory.hex2bin('5051FF1500838500', 7623723, 8)
    memory.hex2bin('0F847B010000', 5499528, 6)

   while true do wait(0)
        if actAFK then
            writeMemory(7634870, 1, 1, 1)
            writeMemory(7635034, 1, 1, 1)
            memory.fill(7623723, 144, 8)
            memory.fill(5499528, 144, 6)
            addOneOffSound(0.0, 0.0, 0.0, 1136)
        else
            writeMemory(7634870, 1, 0, 0)
            writeMemory(7635034, 1, 0, 0)
            memory.hex2bin('5051FF1500838500', 7623723, 8)
            memory.hex2bin('0F847B010000', 5499528, 6)
            addOneOffSound(0.0, 0.0, 0.0, 1136)
        end
   end
end

function aAfk()
    actAFK = not actAFK
     printString(actAFK and '~g~ FK ON' or '~r~ FK OFF', 2000)
end
 
  • Bug
  • Злость
Реакции: ccv и joumey

Gorskin

🖕
Проверенный
1,350
1,199
Lua:
script_author("RayssesEmpire")
require 'lib.moonloader'
local memory = require 'memory'
local actAFK = true -- default active

-- Тело скрипта
function main()
    -- Проверяем, загружен ли SAMP и SAMPFUNCS
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
 
    -- Проверяем инициализацию структур SAMP
    while not isSampAvailable() do wait(100) end

    aAfk()
 
    -- Регистрируем команды
    sampRegisterChatCommand('fk', function()
    actAFK = not actAFK
    aAfk()
    end)
 
    writeMemory(7634870, 1, 0, 0)
    writeMemory(7635034, 1, 0, 0)
    memory.hex2bin('5051FF1500838500', 7623723, 8)
    memory.hex2bin('0F847B010000', 5499528, 6)

    wait(-1)
end

function aAfk()
    if actAFK then
        writeMemory(7634870, 1, 1, 1)
        writeMemory(7635034, 1, 1, 1)
        memory.fill(7623723, 144, 8)
        memory.fill(5499528, 144, 6)
        addOneOffSound(0.0, 0.0, 0.0, 1136)
        printString('~g~ FK ON', 2000)
    else
        writeMemory(7634870, 1, 0, 0)
        writeMemory(7635034, 1, 0, 0)
        memory.hex2bin('5051FF1500838500', 7623723, 8)
        memory.hex2bin('0F847B010000', 5499528, 6)
        addOneOffSound(0.0, 0.0, 0.0, 1136)
        printString('~r~ FK OFF', 2000)
    end
end
 
  • Нравится
Реакции: ccv