barjik

Известный
Автор темы
464
190

BarjBind​

Описание:​

Данный скрипт служит для упрощения игры на Arizona RP.
Это очень простой скрипт с биндами, ранее существовал похожий, но я доделал.
Будет полезен как для ловцов, так и для обычных игроков Аризоны.
По сути эти команды можно забить в каком нибудь биндере, но для тех кому лень, тут все есть.
Делал его для себя, но решил поделиться, надеюсь хоть кому-нибудь пригодится.


Функционал:​

  • На клавишу L будет открываться дверь вашего т/с.
  • На клавишу K будут вставляться ключи в ваш т/с.
  • На клавишу P будет открываться телефон.
  • На клавишу 9 будет одеваться маска.
  • На клавишу X будет меняться стиль езды. (Sport/Comfort.)
  • На клавишу 4 будет одеваться бронежилет.
  • На клавишу 3 будет включаться /anim 3, что позволяет например упасть с высока, и не получить урон.
  • На клавишу 0 будет разворачиваться шар. (для тех у кого он есть.)
  • На клавишу 1 будет использована аптечка.
  • При нажатии ALT + Numpad (1,2,3), будет использоваться нарко. (в зависимости какую цифру нажмете.)
  • При нажатии правой кнопки мыши + R, можно починить ваш авто.
  • При нажатии правой кнопки мыши + 2, можно заправить ваш авто.
 

Вложения

  • BarjBind.lua
    3.2 KB · Просмотры: 6,380

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,769
11,213
а не лучше вместо
Lua:
if isKeyJustPressed(VK_L) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/lock") end
   
     if isKeyJustPressed(VK_K) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/key") end

      if isKeyJustPressed(VK_P) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/phone") end

       if isKeyJustPressed(VK_1) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/usemed") end
       
        if isKeyJustPressed(VK_X) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/style") end

         if isKeyJustPressed(VK_9) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/mask") end

          if isKeyJustPressed(VK_0) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/balloon") end

         if isKeyJustPressed(VK_4) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/armour") end
 
        if isKeyJustPressed(VK_3) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/anim 3") end

делать так?
Lua:
require 'lib.moonloader'
local vk = require 'vkeys'

local binds = {
    {vk.VK_L, '/lock'},
    {vk.VK_K, '/key'},
    {vk.VK_P, '/phone'},
    {vk.VK_1, '/usemed'},
    {vk.VK_X, '/style'},
    {vk.VK_9, '/mask'},
    {vk.VK_0, '/balloon'},
    {vk.VK_4, '/armour'},
    {vk.VK_3, '/anim 3'},
}

function main()
    while not isSampAvailable() do wait(0) end
    
    while true do
        wait(0)
        for i = 1, #binds do
            if wasKeyPressed(binds[i][1]) and not sampIsCursorActive() then sampSendChat(binds[i][2]) end
        end
    end
end
 

Akat

Активный
380
90
а не лучше вместо
Lua:
if isKeyJustPressed(VK_L) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/lock") end
  
     if isKeyJustPressed(VK_K) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/key") end

      if isKeyJustPressed(VK_P) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/phone") end

       if isKeyJustPressed(VK_1) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/usemed") end
      
        if isKeyJustPressed(VK_X) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/style") end

         if isKeyJustPressed(VK_9) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/mask") end

          if isKeyJustPressed(VK_0) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/balloon") end

         if isKeyJustPressed(VK_4) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/armour") end

        if isKeyJustPressed(VK_3) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/anim 3") end

делать так?
Lua:
require 'lib.moonloader'
local vk = require 'vkeys'

local binds = {
    {vk.VK_L, '/lock'},
    {vk.VK_K, '/key'},
    {vk.VK_P, '/phone'},
    {vk.VK_1, '/usemed'},
    {vk.VK_X, '/style'},
    {vk.VK_9, '/mask'},
    {vk.VK_0, '/balloon'},
    {vk.VK_4, '/armour'},
    {vk.VK_3, '/anim 3'},
}

function main()
    while not isSampAvailable() do wait(0) end
   
    while true do
        wait(0)
        for i = 1, #binds do
            if wasKeyPressed(binds[i][1]) and not sampIsCursorActive() then sampSendChat(binds[i][2]) end
        end
    end
end
i = Это клавиши? 2 = Это бинды? Или как понять?
 

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,769
11,213
i = Это клавиши? 2 = Это бинды? Или как понять?
1623585141868.png
 
  • Нравится
Реакции: shitcodes

barjik

Известный
Автор темы
464
190
а не лучше вместо
Lua:
if isKeyJustPressed(VK_L) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/lock") end
  
     if isKeyJustPressed(VK_K) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/key") end

      if isKeyJustPressed(VK_P) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/phone") end

       if isKeyJustPressed(VK_1) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/usemed") end
      
        if isKeyJustPressed(VK_X) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/style") end

         if isKeyJustPressed(VK_9) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/mask") end

          if isKeyJustPressed(VK_0) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/balloon") end

         if isKeyJustPressed(VK_4) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/armour") end

        if isKeyJustPressed(VK_3) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/anim 3") end

делать так?
Lua:
require 'lib.moonloader'
local vk = require 'vkeys'

local binds = {
    {vk.VK_L, '/lock'},
    {vk.VK_K, '/key'},
    {vk.VK_P, '/phone'},
    {vk.VK_1, '/usemed'},
    {vk.VK_X, '/style'},
    {vk.VK_9, '/mask'},
    {vk.VK_0, '/balloon'},
    {vk.VK_4, '/armour'},
    {vk.VK_3, '/anim 3'},
}

function main()
    while not isSampAvailable() do wait(0) end
   
    while true do
        wait(0)
        for i = 1, #binds do
            if wasKeyPressed(binds[i][1]) and not sampIsCursorActive() then sampSendChat(binds[i][2]) end
        end
    end
end
Конечно лучше, просто первый раз делаю что то подобное.
 

Smeruxa

Известный
1,297
681
в душе не ебу как работает этот ваш pairs
Объяснение:
Как мы знаем существует pairs и ipairs
При создании массива, если не указать ключ ( [1] - не указываем ) - то это должно читаться через ipairs
А если мы создадим ключ ( ["Лошпед"] ) - то это должно читаться через pairs
Ничего сложного
 
  • Нравится
Реакции: chapo

SamperJostkiy

Участник
169
19
а не лучше вместо
Lua:
if isKeyJustPressed(VK_L) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/lock") end
  
     if isKeyJustPressed(VK_K) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/key") end

      if isKeyJustPressed(VK_P) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/phone") end

       if isKeyJustPressed(VK_1) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/usemed") end
      
        if isKeyJustPressed(VK_X) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/style") end

         if isKeyJustPressed(VK_9) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/mask") end

          if isKeyJustPressed(VK_0) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/balloon") end

         if isKeyJustPressed(VK_4) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/armour") end

        if isKeyJustPressed(VK_3) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/anim 3") end

делать так?
Lua:
require 'lib.moonloader'
local vk = require 'vkeys'

local binds = {
    {vk.VK_L, '/lock'},
    {vk.VK_K, '/key'},
    {vk.VK_P, '/phone'},
    {vk.VK_1, '/usemed'},
    {vk.VK_X, '/style'},
    {vk.VK_9, '/mask'},
    {vk.VK_0, '/balloon'},
    {vk.VK_4, '/armour'},
    {vk.VK_3, '/anim 3'},
}

function main()
    while not isSampAvailable() do wait(0) end
   
    while true do
        wait(0)
        for i = 1, #binds do
            if wasKeyPressed(binds[i][1]) and not sampIsCursorActive() then sampSendChat(binds[i][2]) end
        end
    end
end
Можно ещё место первого кода, там где чекает чат, диалог, афк ли ты, и прочею херню, юзать вот эту команду isCursorActive