require 'lib.moonloader'
local keys = require "vkeys"
-- Переменная, в которой хранится ид напавшего
local a_id = nil
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
attack(9)
while true do
if isKeyJustPressed(VK_M) then
if aid ~= nil then
-- Действия при нажатии M
sampAddChatMessage("Готово.", -1)
aid = nil
end
end
if isKeyJustPressed(VK_J) then
if aid ~= nil then
-- Действия при нажатии J
sampAddChatMessage("Отменено.", -1)
aid = nil
end
end
wait(0)
end
end
function attack(id)
local attack_nick = sampGetPlayerNickname(id)
sampAddChatMessage("На вас напал игрок с ником [ " .. attack_nick .. " ]. Выдать розыск: M, отмена: J", -1 )
aid = id
end