|
|
|
@ -9,7 +9,6 @@ encoding = require "encoding" |
|
|
|
|
encoding.default = "CP1251" |
|
|
|
|
u8 = encoding.UTF8 |
|
|
|
|
|
|
|
|
|
main_key_start = { "VK_LSHIFT" } |
|
|
|
|
additional_key_start = { "VK_W", "VK_S" } |
|
|
|
|
cruise = false |
|
|
|
|
|
|
|
|
@ -20,29 +19,33 @@ function main() |
|
|
|
|
lua_thread.create(menu.loop) |
|
|
|
|
while true do |
|
|
|
|
wait(0) |
|
|
|
|
local car = storeCarCharIsInNoSave(playerPed) |
|
|
|
|
if not isCharInAnyCar(playerPed) or not isCarEngineOn(car) then |
|
|
|
|
if cruise then |
|
|
|
|
cruise = false |
|
|
|
|
printStringNow('~R~cruise control - OFF', 1500) |
|
|
|
|
end |
|
|
|
|
return |
|
|
|
|
end |
|
|
|
|
if not sampIsChatInputActive() and not sampIsDialogActive() and not sampIsCursorActive() then |
|
|
|
|
if not cruise and select(1, check_press_key(additional_key_start)) and select(1, check_press_key(main_key_start)) then |
|
|
|
|
cruise = true |
|
|
|
|
printStringNow('~G~cruise control - ON', 1500) |
|
|
|
|
repeat |
|
|
|
|
wait(100) |
|
|
|
|
until not isKeyDown(vkeys["VK_W"]) |
|
|
|
|
elseif cruise and not isKeyDown(vkeys["VK_LSHIFT"]) and select(1, check_press_key(additional_key_start)) then |
|
|
|
|
cruise = false |
|
|
|
|
printStringNow('~R~cruise control - OFF', 1500) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
doCruise() |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
function doCruise() |
|
|
|
|
local car = storeCarCharIsInNoSave(playerPed) |
|
|
|
|
if not isCharInAnyCar(playerPed) or not isCarEngineOn(car) then |
|
|
|
|
if cruise then |
|
|
|
|
setGameKeyState(16, 255) |
|
|
|
|
cruise = false |
|
|
|
|
printStringNow('~R~cruise control', 1500) |
|
|
|
|
end |
|
|
|
|
return |
|
|
|
|
end |
|
|
|
|
if not sampIsChatInputActive() and not sampIsDialogActive() and not sampIsCursorActive() then |
|
|
|
|
if not cruise and select(1, check_press_key(additional_key_start)) and isKeyDown(vkeys[config.data.key]) then |
|
|
|
|
cruise = true |
|
|
|
|
printStringNow('~G~cruise control', 1500) |
|
|
|
|
repeat |
|
|
|
|
wait(100) |
|
|
|
|
until not isKeyDown(vkeys["VK_W"]) |
|
|
|
|
elseif cruise and not isKeyDown(vkeys["VK_LSHIFT"]) and select(1, check_press_key(additional_key_start)) then |
|
|
|
|
cruise = false |
|
|
|
|
printStringNow('~R~cruise control', 1500) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
if cruise then |
|
|
|
|
setGameKeyState(16, 255) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
@ -67,7 +70,7 @@ menu.ffixcar_log = {} |
|
|
|
|
menu.update = function() |
|
|
|
|
menu.dialog = { |
|
|
|
|
["main"] = { |
|
|
|
|
settings = {title = "mafia-tools" ,style = 4 ,btn1 = "Выбрать" ,btn2 = "Закрыть" ,forward = "{ffffff}" ,backwards = "\n" ,score = false}, |
|
|
|
|
settings = {title = "easy-cruise" ,style = 4 ,btn1 = "Выбрать" ,btn2 = "Закрыть" ,forward = "{ffffff}" ,backwards = "\n" ,score = false}, |
|
|
|
|
{ |
|
|
|
|
{ |
|
|
|
|
title = "Cruise\t"..(config.data.status and "вкл" or "выкл"), |
|
|
|
@ -87,7 +90,7 @@ menu.update = function() |
|
|
|
|
repeat |
|
|
|
|
wait(0) |
|
|
|
|
if not sampIsDialogActive() then |
|
|
|
|
sampShowDialog(222,"LUA Truck-HUD: Смена активации","Нажмите на любую клавишу","Выбрать","Закрыть",0) |
|
|
|
|
sampShowDialog(222,"Смена активации","Нажмите на любую клавишу","Выбрать","Закрыть",0) |
|
|
|
|
end |
|
|
|
|
for k, v in pairs(vkeys) do |
|
|
|
|
if wasKeyPressed(v) and k ~= "VK_ESCAPE" and k ~= "VK_RETURN" then |
|
|
|
|