Lua [ARZ]AutoBikeMotoRunSwimOnMaxSpeed - ARIZONA EDITION

histor

Известный
Автор темы
174
104
Версия SA-MP
  1. 0.3.7 (R1)
  2. 0.3.7-R3
Приветствую пользователей Blast HK!

Как известно, на Arizona RP добавили много новых кастомных автомобилей, мотоциклов и велосипедов. В следствии чего, популярный скрипт AutoBikeMotoRunSwimOnMaxSpeed не работает на новых моделях. Именно поэтому я выкладываю данное чудо.


Описание:
  • Cкрипт будет нажимать за вас W, когда вы едете на велосипеде.
  • Стрелку вверх, когда вы едете на на мотоцикле/скутере/квадроцикле/электроскутере.
  • Клавишу бега, когда вы бежите или плывете.
Активация:
  • На велосипеде/электроскутере: Зажать левый шифт
  • На мотоцикле/скутере/квадроцикле: Зажать левый шифт
  • Во время бега: Зажать W + 1
  • Во время плавания: Зажать 1
Требования:
Установка:
  • Поместить файл в папку moonloader

Оригинальная тема AutoBikeMotoRunSwimOnMaxSpeed автора checkdasound
 

Вложения

  • ABMRSOMS-arzEDIT.lua
    2 KB · Просмотры: 672

Vespan

loneliness
Проверенный
2,109
1,632
1682765094597.png

lmao
сделал бы условия "ускорение" через тип транспорта
Lua:
    cars = {}
    local vehs = io.open(getGameDirectory() .. '/data/vehicles.ide','r+')
    for l in (vehs:read('*a')):gmatch('[^\n]+') do
        if l:find('%d+,%s+%S+%s+%S+,%s+%S+,%s+%S+,') then
            local id,name,type,gameName = l:match('(%d+),%s+(%S+),%s+%S+,%s+(%S+),%s+(%S+),')
            table.insert(cars,{id=tonumber(id),name=name,type=type,gameName=gameName})
        end
    end
1682765148672.png


зачем? что бы ты вручную не добавлял в скрипт новые тс, ибо разрабы еще будут добавлять всякое говно на колесах
 
  • Нравится
Реакции: Sadow, ntdll и histor

histor

Известный
Автор темы
174
104
Посмотреть вложение 199643
lmao
сделал бы условия "ускорение" через тип транспорта
Lua:
    cars = {}
    local vehs = io.open(getGameDirectory() .. '/data/vehicles.ide','r+')
    for l in (vehs:read('*a')):gmatch('[^\n]+') do
        if l:find('%d+,%s+%S+%s+%S+,%s+%S+,%s+%S+,') then
            local id,name,type,gameName = l:match('(%d+),%s+(%S+),%s+%S+,%s+(%S+),%s+(%S+),')
            table.insert(cars,{id=tonumber(id),name=name,type=type,gameName=gameName})
        end
    end
Посмотреть вложение 199645

зачем? что бы ты вручную не добавлял в скрипт новые тс, ибо разрабы еще будут добавлять всякое говно на колесах
я еще не способен на такие фокусы с файлами 👉👈
но спасибо
 
  • Нравится
Реакции: zukad

Vespan

loneliness
Проверенный
2,109
1,632
я еще не способен на такие фокусы с файлами 👉👈
но спасибо
Lua:
script_name("AutoBicycleRunSwimOnMaxSpeed - ArizonaEdition")
script_author("histor")
script_version("1.0")

KEY = {
    ['bike'] = VK_LSHIFT,
    ['bmx'] = VK_1,
}
function main()
    cars = {}
    local vehs = io.open(getGameDirectory() .. '/data/vehicles.ide','r+')
    for l in (vehs:read('*a')):gmatch('[^\n]+') do
        if l:find('%d+,%s+%S+%s+%S+,%s+%S+,%s+%S+,') then
            local id,name,type,gameName = l:match('(%d+),%s+(%S+),%s+%S+,%s+(%S+),%s+(%S+),')
            table.insert(cars,{id=tonumber(id),name=name,type=type,gameName=gameName})
        end
    end
    while true do wait(0)

        if isCharInAnyCar(PLAYER_PED) then
            local veh = storeCarCharIsInNoSave(playerPed)
            for k,v in pairs(cars) do
                if v.id == getCarModel(veh) then
                    local types = {
                        ['bike'] = VK_UP,
                        ['bmx'] = VK_W,
                    }
                    if types[v.type] ~= nil and type(types[v.type]) == 'number' and isKeyDown(KEY[v.type]) and isKeyCheckAvailable() then
                        setVirtualKeyDown(types[v.type],true)
                        wait(50--[[ЗАДЕРЖКА]])
                        setVirtualKeyDown(types[v.type],false)
                    end
                end
            end
        end

    end
end

function isKeyCheckAvailable()
    if not isSampLoaded() then
        return true
    end
    if not isSampfuncsLoaded() then
        return not sampIsChatInputActive() and not sampIsDialogActive()
    end
    return not sampIsChatInputActive() and not sampIsDialogActive() and not isSampfuncsConsoleActive()
end
 

Вложения

  • ABMRSOMS-arzEDIT.lua
    1.4 KB · Просмотры: 64
  • Bug
  • Влюблен
Реакции: chapo и histor

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,747
11,157
Lua:
script_name("AutoBicycleRunSwimOnMaxSpeed - ArizonaEdition")
script_author("histor")
script_version("1.0")

KEY = {
    ['bike'] = VK_LSHIFT,
    ['bmx'] = VK_1,
}
function main()
    cars = {}
    local vehs = io.open(getGameDirectory() .. '/data/vehicles.ide','r+')
    for l in (vehs:read('*a')):gmatch('[^\n]+') do
        if l:find('%d+,%s+%S+%s+%S+,%s+%S+,%s+%S+,') then
            local id,name,type,gameName = l:match('(%d+),%s+(%S+),%s+%S+,%s+(%S+),%s+(%S+),')
            table.insert(cars,{id=tonumber(id),name=name,type=type,gameName=gameName})
        end
    end
    while true do wait(0)

        if isCharInAnyCar(PLAYER_PED) then
            local veh = storeCarCharIsInNoSave(playerPed)
            for k,v in pairs(cars) do
                if v.id == getCarModel(veh) then
                    local types = {
                        ['bike'] = VK_UP,
                        ['bmx'] = VK_W,
                    }
                    if types[v.type] ~= nil and type(types[v.type]) == 'number' and isKeyDown(KEY[v.type]) and isKeyCheckAvailable() then
                        setVirtualKeyDown(types[v.type],true)
                        wait(50--[[ЗАДЕРЖКА]])
                        setVirtualKeyDown(types[v.type],false)
                    end
                end
            end
        end

    end
end

function isKeyCheckAvailable()
    if not isSampLoaded() then
        return true
    end
    if not isSampfuncsLoaded() then
        return not sampIsChatInputActive() and not sampIsDialogActive()
    end
    return not sampIsChatInputActive() and not sampIsDialogActive() and not isSampfuncsConsoleActive()
end
твой способ тоже говно

Lua:
local isBikeModel = ffi.cast('bool (__cdecl *)(int)', 0x4C5B60)
local isBmxModel = ffi.cast('bool (__cdecl *)(int)', 0x4C5C20)

-- пример:
local model = getCarModel(storeCarCharIsInNoSave(PLAYER_PED))
print('мотоцикл', isBikeModel(model) and 'да' or 'нет')
print('велосипед', isBmxModel(model) and 'да' or 'нет')

Lua:
require('lib.moonloader')
local ffi = require('ffi')
local isBikeModel = ffi.cast('bool (__cdecl *)(int)', 0x4C5B60)
local isBmxModel = ffi.cast('bool (__cdecl *)(int)', 0x4C5C20)

function main()
    while not isSampAvailable() do wait(0) end
    while true do
        wait(0)
        if not sampIsChatInputActive() and isCharInAnyCar(PLAYER_PED) and isKeyDown(VK_SHIFT) then
            local model = getCarModel(storeCarCharIsInNoSave(PLAYER_PED))
            local key = isBikeModel(model) and 1 or (isBmxModel(model) and 16)
            if key then
                setGameKeyState(key, key == 1 and -256 or 256)
                wait(100)
                setGameKeyState(key, key == 1 and -256 or 256)
            end
        end
    end
end
 
  • Грустно
  • Нравится
  • Ха-ха
Реакции: Arz rpg, ntdll и Vespan

Vespan

loneliness
Проверенный
2,109
1,632
твой способ тоже говно

Lua:
local isBikeModel = ffi.cast('bool (__cdecl *)(int)', 0x4C5B60)
local isBmxModel = ffi.cast('bool (__cdecl *)(int)', 0x4C5C20)

-- пример:
local model = getCarModel(storeCarCharIsInNoSave(PLAYER_PED))
print('мотоцикл', isBikeModel(model) and 'да' or 'нет')
print('велосипед', isBmxModel(model) and 'да' or 'нет')

Lua:
require('lib.moonloader')
local ffi = require('ffi')
local isBikeModel = ffi.cast('bool (__cdecl *)(int)', 0x4C5B60)
local isBmxModel = ffi.cast('bool (__cdecl *)(int)', 0x4C5C20)

function main()
    while not isSampAvailable() do wait(0) end
    while true do
        wait(0)
        if not sampIsChatInputActive() and isCharInAnyCar(PLAYER_PED) and isKeyDown(VK_SHIFT) then
            local model = getCarModel(storeCarCharIsInNoSave(PLAYER_PED))
            local key = isBikeModel(model) and 1 or (isBmxModel(model) and 16)
            if key then
                setGameKeyState(key, key == 1 and -256 or 256)
                wait(100)
                setGameKeyState(key, key == 1 and -256 or 256)
            end
        end
    end
end
Ну разница между твоим убогим кодом и моим шедевральный только..визуальной части? Ибо и то и то одинаково работает😁
Кому как🙄
 
  • Эм
Реакции: Arz rpg

myneth

Участник
68
2
Не работает, зажимаю W и Shift но ничего не происходит, ни на байке ни на велике