Загрузка данных


-- STREAMING_CHUNK:Initializing script metadata...
script_name("AutoRun SAMP")
script_author("Gemini")
script_description("AutoRun")
script_version("1.0")
-- STREAMING_CHUNK:Loading required MoonLoader libraries...
local vkeys = require 'vkeys'
-- STREAMING_CHUNK:Declaring state variables and constants...
local autoRunActive = false
local BIND_KEY = vkeys.VK_OEM_3
local KEY_FORWARD = 1
local KEY_SPRINT = 16
-- STREAMING_CHUNK:Defining player status check helper function...
function isPlayerFree()
if isSampLoaded() then
if sampIsChatInputActive() or sampIsDialogActive() then
return false
end
end
if isPauseMenuActive() then
return false
end
return true
end
-- STREAMING_CHUNK:Main execution function...
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
sampAddChatMessage("{00FF00}[AutoRun]{FFFFFF} Скрипт загружен!", -1)
while true do
wait(0)
if isKeyJustPressed(BIND_KEY) and isPlayerFree() then
autoRunActive = not autoRunActive
if autoRunActive then
sampAddChatMessage("{00FF00}[AutoRun]{FFFFFF} Автобег: {00FF00}ВКЛЮЧЕН", -1)
addOneOffSound(0.0, 0.0, 0.0, 1052)
else
sampAddChatMessage("{00FF00}[AutoRun]{FFFFFF} Автобег: {FF0000}ВЫКЛЮЧЕН", -1)
addOneOffSound(0.0, 0.0, 0.0, 1053)
end
end
if autoRunActive then
if isCharInAnyCar(PLAYER_PED) or isCharDead(PLAYER_PED) then
autoRunActive = false
sampAddChatMessage("{00FF00}[AutoRun]{FFFFFF} Автобег: {FF0000}ОТКЛЮЧЕН", -1)
else
setGameKeyState(KEY_FORWARD, -128)
setGameKeyState(KEY_SPRINT, 255)
end
end
end
end