require "lib.moonloader"
local sampev = require "lib.samp.events"
local active = false
local lovlya = false
function main()
repeat wait(0) until isSampAvailable()
wait(-1)
end
function onSendRpc(id, bs)
if id == 50 then
local cmd_len = raknetBitStreamReadInt32(bs)
local cmd_text = raknetBitStreamReadString(bs, cmd_len)
if cmd_text == '/autolovecvc' then
active = not active
printStringNow(active and '~g~ON' or '~r~OFF', 700)
return false
end
end
end
function clicker()
lua_thread.create(function()
setVirtualKeyDown(VK_RETURN, true)
wait(30)
setVirtualKeyDown(VK_RETURN, false)
lovlya = false
active = false
return false
end)
end
function sampev.onSetPlayerTime()
if active and lovlya then
clicker()
end
end
function sampev.onSetWeather()
if active and lovlya then
clicker()
end
end
function sampev.onShowDialog(id, style, title, button1, button2, text)
if title:find("Покупка видеокарты") and active then
lovlya = true
end
end