Необходимый скрипт.

Статус
В этой теме нельзя размещать новые ответы.

DolgorukovGTA

Известный
Автор темы
Проверенный
652
344
7a09f409f8eb.png


Здравствуйте, необходим скрипт, желательно на LUA, чтобы при нажатии на кнопку "1" на клавиатуре, нажимался текстдрав с числом 1. ID текстдравов приложил, также, если ты нажимаешь Enter, то нажимает на "Submit".
 

wD.D159

Известный
Друг
446
479
Проверяй работоспособность.

Lua:
require 'lib.moonloader'

function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
   
    while true do wait(0)
        if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно
            if isKeyDown(48) then -- Клавиша 0
                sampSendClickTextdraw(2057)
            end
            if isKeyDown(49) then -- Клавиша 1
                sampSendClickTextdraw(2058)
            end
            if isKeyDown(50) then -- Клавиша 2
                sampSendClickTextdraw(2053)
            end
            if isKeyDown(51) then -- Клавиша 3
                sampSendClickTextdraw(2052)
            end
            if isKeyDown(52) then -- Клавиша 4
                sampSendClickTextdraw(2056)
            end
            if isKeyDown(53) then -- Клавиша 5
                sampSendClickTextdraw(2051)
            end
            if isKeyDown(54) then -- Клавиша 6
                sampSendClickTextdraw(2049)
            end
            if isKeyDown(55) then -- Клавиша 7
                sampSendClickTextdraw(2055)
            end
            if isKeyDown(56) then -- Клавиша 8
                sampSendClickTextdraw(2054)
            end
            if isKeyDown(57) then -- Клавиша 9
                sampSendClickTextdraw(2050)
            end
            if isKeyDown(13) then -- Клавиша Enter
                sampSendClickTextdraw(648)
            end
        end
    end
end
 
Последнее редактирование:

™ ChipFamily

По ту сторону надежды.
5,144
1,980
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Сервер какой?, мне нужно лично протестировать то что я сделал по твоему описанию, чтобы не кидать тебе недоделанное.
 
Последнее редактирование:

DolgorukovGTA

Известный
Автор темы
Проверенный
652
344
Сервер какой?, мне нужно лично протестировать то что я сделал по твоему описанию, чтобы не кидать тебе недоделанное.
Trinity.

Проверяй работоспособность.

Lua:
require 'lib.moonloader'

function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
  
    while true do wait(0)
        if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно
            if isKeyDown(48) then -- Клавиша 0
                sampSendClickTextdraw(2057)
            end
            if isKeyDown(49) then -- Клавиша 1
                sampSendClickTextdraw(2058)
            end
            if isKeyDown(50) then -- Клавиша 2
                sampSendClickTextdraw(2053)
            end
            if isKeyDown(51) then -- Клавиша 3
                sampSendClickTextdraw(2052)
            end
            if isKeyDown(52) then -- Клавиша 4
                sampSendClickTextdraw(2056)
            end
            if isKeyDown(53) then -- Клавиша 5
                sampSendClickTextdraw(2051)
            end
            if isKeyDown(54) then -- Клавиша 6
                sampSendClickTextdraw(2049)
            end
            if isKeyDown(55) then -- Клавиша 7
                sampSendClickTextdraw(2055)
            end
            if isKeyDown(56) then -- Клавиша 8
                sampSendClickTextdraw(2054)
            end
            if isKeyDown(57) then -- Клавиша 9
                sampSendClickTextdraw(2050)
            end
            if isKeyDown(13) then -- Клавиша Enter
                sampSendClickTextdraw(648)
            end
        end
    end
end

Не работает, в логе всё нормально.
 

DolgorukovGTA

Известный
Автор темы
Проверенный
652
344
Значит ID текстдравов не те указал я, попробуй поменять.
Окей.

Значит ID текстдравов не те указал я, попробуй поменять.

Lua:
require 'lib.moonloader'

function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
   
    while true do wait(0)
        if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно
            if isKeyDown(48) then -- Клавиша 0
                sampSendClickTextdraw(642)
            end
            if isKeyDown(49) then -- Клавиша 1
                sampSendClickTextdraw(643)
            end
            if isKeyDown(50) then -- Клавиша 2
                sampSendClickTextdraw(638)
            end
            if isKeyDown(51) then -- Клавиша 3
                sampSendClickTextdraw(637)
            end
            if isKeyDown(52) then -- Клавиша 4
                sampSendClickTextdraw(641)
            end
            if isKeyDown(53) then -- Клавиша 5
                sampSendClickTextdraw(636)
            end
            if isKeyDown(54) then -- Клавиша 6
                sampSendClickTextdraw(634)
            end
            if isKeyDown(55) then -- Клавиша 7
                sampSendClickTextdraw(640)
            end
            if isKeyDown(56) then -- Клавиша 8
                sampSendClickTextdraw(639)
            end
            if isKeyDown(57) then -- Клавиша 9
                sampSendClickTextdraw(635)
            end
            if isKeyDown(13) then -- Клавиша Enter
                sampSendClickTextdraw(649)
            end
        end
    end
end

Короче, я поменял, скрипт реагирует на нажатия, но если я нажму на клавиатуре "1", то он 4 раза введет 1 (пин-код состоит из 4-ёх чисел). Как фиксить?

Тема актуальна.
 

wD.D159

Известный
Друг
446
479
Окей.



Lua:
require 'lib.moonloader'

function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
 
    while true do wait(0)
        if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно
            if isKeyJustPressed(48) then -- Клавиша 0
                sampSendClickTextdraw(642)
            end
            if isKeyJustPressed(49) then -- Клавиша 1
                sampSendClickTextdraw(643)
            end
            if isKeyJustPressed(50) then -- Клавиша 2
                sampSendClickTextdraw(638)
            end
            if isKeyJustPressed(51) then -- Клавиша 3
                sampSendClickTextdraw(637)
            end
            if isKeyJustPressed(52) then -- Клавиша 4
                sampSendClickTextdraw(641)
            end
            if isKeyJustPressed(53) then -- Клавиша 5
                sampSendClickTextdraw(636)
            end
            if isKeyDown(54) then -- Клавиша 6
                sampSendClickTextdraw(634)
            end
            if isKeyJustPressed(55) then -- Клавиша 7
                sampSendClickTextdraw(640)
            end
            if isKeyJustPressed(56) then -- Клавиша 8
                sampSendClickTextdraw(639)
            end
            if isKeyJustPressed(57) then -- Клавиша 9
                sampSendClickTextdraw(635)
            end
            if isKeyJustPressed(13) then -- Клавиша Enter
                sampSendClickTextdraw(649)
            end
        end
    end
end

Короче, я поменял, скрипт реагирует на нажатия, но если я нажму на клавиатуре "1", то он 4 раза введет 1 (пин-код состоит из 4-ёх чисел). Как фиксить?

Тема актуальна.
Lua:
require 'lib.moonloader'

function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
 
    while true do wait(0)
        if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно
            if isKeyDown(48) then -- Клавиша 0
                sampSendClickTextdraw(642) wait(1000)
            end
            if isKeyDown(49) then -- Клавиша 1
                sampSendClickTextdraw(643) wait(1000)
            end
            if isKeyDown(50) then -- Клавиша 2
                sampSendClickTextdraw(638) wait(1000)
            end
            if isKeyDown(51) then -- Клавиша 3
                sampSendClickTextdraw(637) wait(1000)
            end
            if isKeyDown(52) then -- Клавиша 4
                sampSendClickTextdraw(641) wait(1000)
            end
            if isKeyDown(53) then -- Клавиша 5
                sampSendClickTextdraw(636) wait(1000)
            end
            if isKeyDown(54) then -- Клавиша 6
                sampSendClickTextdraw(634) wait(1000)
            end
            if isKeyDown(55) then -- Клавиша 7
                sampSendClickTextdraw(640) wait(1000)
            end
            if isKeyDown(56) then -- Клавиша 8
                sampSendClickTextdraw(639) wait(1000)
            end
            if isKeyDown(57) then -- Клавиша 9
                sampSendClickTextdraw(635) wait(1000)
            end
            if isKeyDown(13) then -- Клавиша Enter
                sampSendClickTextdraw(649) wait(1000)
            end
        end
    end
end
 
Последнее редактирование:

MFatunes

Новичок
46
10
Lua:
require 'lib.moonloader'

function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
 
    while true do wait(0)
        if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно
            if isKeyDown(48) then -- Клавиша 0
                sampSendClickTextdraw(642) wait(1000)
            end
            if isKeyDown(49) then -- Клавиша 1
                sampSendClickTextdraw(643) wait(1000)
            end
            if isKeyDown(50) then -- Клавиша 2
                sampSendClickTextdraw(638) wait(1000)
            end
            if isKeyDown(51) then -- Клавиша 3
                sampSendClickTextdraw(637) wait(1000)
            end
            if isKeyDown(52) then -- Клавиша 4
                sampSendClickTextdraw(641) wait(1000)
            end
            if isKeyDown(53) then -- Клавиша 5
                sampSendClickTextdraw(636) wait(1000)
            end
            if isKeyDown(54) then -- Клавиша 6
                sampSendClickTextdraw(634) wait(1000)
            end
            if isKeyDown(55) then -- Клавиша 7
                sampSendClickTextdraw(640) wait(1000)
            end
            if isKeyDown(56) then -- Клавиша 8
                sampSendClickTextdraw(639) wait(1000)
            end
            if isKeyDown(57) then -- Клавиша 9
                sampSendClickTextdraw(635) wait(1000)
            end
            if isKeyDown(13) then -- Клавиша Enter
                sampSendClickTextdraw(649) wait(1000)
            end
        end
    end
end

Lua:
local textdraw = {
    [48] = 642,
    [49] = 643,
    [50] = 638,
    [51] = 637,
    [52] = 641,
    [53] = 636,
    [54] = 634,
    [55] = 640,
    [56] = 639,
    [57] = 635,
    [13] = 649
}

function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
 
    while true do
        wait(0)
        if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then
            for key, value in ipairs(textdraw) do
                if isKeyJustPressed(key) then
                    sampSendClickTextdraw(value)
                end
            end
        end
    end
end
 

wD.D159

Известный
Друг
446
479
Lua:
local textdraw = {
    [48] = 642,
    [49] = 643,
    [50] = 638,
    [51] = 637,
    [52] = 641,
    [53] = 636,
    [54] = 634,
    [55] = 640,
    [56] = 639,
    [57] = 635,
    [13] = 649
}

function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
 
    while true do
        wait(0)
        if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then
            for key, value in ipairs(textdraw) do
                if isKeyJustPressed(key) then
                    sampSendClickTextdraw(value)
                end
            end
        end
    end
end
Флуда не будет при нажатии??

PS: Люблю говнокодить!:monkey:
 

DolgorukovGTA

Известный
Автор темы
Проверенный
652
344
Флуда не будет при нажатии??

PS: Люблю говнокодить!:monkey:
Так
Lua:
local textdraw = {
    [48] = 642,
    [49] = 643,
    [50] = 638,
    [51] = 637,
    [52] = 641,
    [53] = 636,
    [54] = 634,
    [55] = 640,
    [56] = 639,
    [57] = 635,
    [13] = 649
}

function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
 
    while true do
        wait(0)
        if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then
            for key, value in ipairs(textdraw) do
                if isKeyJustPressed(key) then
                    sampSendClickTextdraw(value)
                end
            end
        end
    end
end
Вообще не работает, лог в порядке.

Флуда не будет при нажатии??

PS: Люблю говнокодить!:monkey:
Всё также плохо, нажимаю, он с задержкой нажимает, он просто вводит одно и то же число, независимо, куда я нажимал.

Актуально.
 

wD.D159

Известный
Друг
446
479

wD.D159

Известный
Друг
446
479
Lua:
require 'lib.moonloader'

function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    while true do wait(0)
        if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно
            if isKeyJustPressed(48) then -- Клавиша 0
                sampSendClickTextdraw(642) wait(1000)
            end
            if isKeyJustPressed(49) then -- Клавиша 1
                sampSendClickTextdraw(643) wait(1000)
            end
            if isKeyJustPressed(50) then -- Клавиша 2
                sampSendClickTextdraw(638) wait(1000)
            end
            if isKeyJustPressed(51) then -- Клавиша 3
                sampSendClickTextdraw(637) wait(1000)
            end
            if isKeyJustPressed(52) then -- Клавиша 4
                sampSendClickTextdraw(641) wait(1000)
            end
            if isKeyJustPressed(53) then -- Клавиша 5
                sampSendClickTextdraw(636) wait(1000)
            end
            if isKeyJustPressed(54) then -- Клавиша 6
                sampSendClickTextdraw(634) wait(1000)
            end
            if isKeyJustPressed(55) then -- Клавиша 7
                sampSendClickTextdraw(640) wait(1000)
            end
            if isKeyJustPressed(56) then -- Клавиша 8
                sampSendClickTextdraw(639) wait(1000)
            end
            if isKeyJustPressed(57) then -- Клавиша 9
                sampSendClickTextdraw(635) wait(1000)
            end
            if isKeyJustPressed(13) then -- Клавиша Enter
                sampSendClickTextdraw(649) wait(1000)
            end
        end
    end
end
 

DolgorukovGTA

Известный
Автор темы
Проверенный
652
344
ид тд статический?
Да, ID текстдравов не меняются.

Lua:
require 'lib.moonloader'

function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    while true do wait(0)
        if not sampIsChatInputActive() and not isSampfuncsConsoleActive() and not sampIsDialogActive() then -- Если закрыт чат, закрыта консоль SF и не открыт диалог-окно
            if isKeyJustPressed(48) then -- Клавиша 0
                sampSendClickTextdraw(642) wait(1000)
            end
            if isKeyJustPressed(49) then -- Клавиша 1
                sampSendClickTextdraw(643) wait(1000)
            end
            if isKeyJustPressed(50) then -- Клавиша 2
                sampSendClickTextdraw(638) wait(1000)
            end
            if isKeyJustPressed(51) then -- Клавиша 3
                sampSendClickTextdraw(637) wait(1000)
            end
            if isKeyJustPressed(52) then -- Клавиша 4
                sampSendClickTextdraw(641) wait(1000)
            end
            if isKeyJustPressed(53) then -- Клавиша 5
                sampSendClickTextdraw(636) wait(1000)
            end
            if isKeyJustPressed(54) then -- Клавиша 6
                sampSendClickTextdraw(634) wait(1000)
            end
            if isKeyJustPressed(55) then -- Клавиша 7
                sampSendClickTextdraw(640) wait(1000)
            end
            if isKeyJustPressed(56) then -- Клавиша 8
                sampSendClickTextdraw(639) wait(1000)
            end
            if isKeyJustPressed(57) then -- Клавиша 9
                sampSendClickTextdraw(635) wait(1000)
            end
            if isKeyJustPressed(13) then -- Клавиша Enter
                sampSendClickTextdraw(649) wait(1000)
            end
        end
    end
end
Он одно и тоже число набирает, только сейчас с большой задержкой.
 
Статус
В этой теме нельзя размещать новые ответы.