Помогите сделать это с этим бестолковым кодом
Код:
require "lib.moonloader"
local keys = require "vkeys"
local act = true
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand("onsbiv", function() act = true
printStringNow(string.format("~p~ SBIV - %s", "activated"), 1000)
end)
sampRegisterChatCommand("offsbiv", function() act = false
printStringNow(string.format("~p~ SBIV - %s", "deactivated"), 1000)
end)
while true do
wait(0)
if act then
if isKeyJustPressed(VK_1) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/usedrugs 3") wait(10) sampSendChat(" ") end
if isKeyJustPressed(VK_2) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/usemed") wait(10) sampSendChat(" ") end
else
if isKeyJustPressed(VK_1) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/usedrugs 3") wait(10) end
if isKeyJustPressed(VK_2) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/usemed") wait(10) end end
if isKeyJustPressed(VK_L) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/lock") end
if isKeyJustPressed(VK_CAPITAL) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/anims 1") wait(10) setVirtualKeyDown(VK_RETURN, true) wait(600) setVirtualKeyDown(VK_RETURN, false) end
end
end