require "lib.moonloader"
local keys = require "vkeys"
local inicfg = require 'inicfg'
local directIni = 'sbiv.ini'
local ini = inicfg.load({
act = {
act = true,
},
}, directIni)
actv=ini.act.act
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand("sbiv", function() actv = not actv
save()
printStringNow(string.format("~p~ SBIV - %s", actv and "activated" or "deactivated"), 1000)
end)
while true do
wait(0)
if actv == true 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
function save()
ini.act.act = actv
inicfg.save(ini, directIni)
end