Сделать код

fzzxhq

Активный
Автор темы
472
72
Кто может сделать код, чтобы раз в 10 секунд нажималась кнопка ПКМ
 

Willy4ka

Неизвестный
Проверенный
215
439
Кто может сделать код, чтобы раз в 10 секунд нажималась кнопка ПКМ
Lua:
function main()
    while not isSampAvailable() do wait(0) end
    while true do
        wait(10000)
        setVirtualKeyDown(0x01, true)
        wait(10)
        setVirtualKeyDown(0x01, false)
    end
end
 
  • Нравится
Реакции: tolic_snacheelz

Maxim25012

Известный
277
101
Lua:
function main()
    while not isSampAvailable() do wait(0) end
    while true do
        wait(10000)
        setVirtualKeyDown(0x01, true)
        wait(10)
        setVirtualKeyDown(0x01, false)
    end
end
Задолбали со своим этим setVirtualKeyDown уже. Есть setGameKeyState, он не вызывает лишних проблем.
Lua:
local autoShoot = false
local canChatCommandBeCreated = isSampLoaded() and isSampfuncsLoaded()

function main()
    if canChatCommandBeCreated then
        while not isSampAvailable() do
            wait()
        end
       
        sampRegisterChatCommand('autoshoot', activate)
    end
   
    while true do
        if not canChatCommandBeCreated then
            if testCheat('autoshoot') then
                activate()
            end
        end
       
        if autoShoot and isCharOnFoot(playerPed) then
            wait(10000)
           
            for _ = 1, 30 do
                setGameKeyState(6, 255)
                wait()
            end
        end
       
        wait()
    end
end

function activate()
    autoShoot = not autoShoot
    printStringNow(autoShoot and "Shooting automatically" or "Deactivated", 1000)
end