-- Виртуальные коды клавиш (https://api.farmanager.com/ru/winapi/virtualkeycodes.html) (ex. key.VK_F12 / обязательно вписывать key.) script_author("suttiev") script_version("1.0.2") require "lib.moonloader" local key = require 'vkeys' local ev = require 'lib.samp.events' function CheckServerIP() local ip, port = sampGetCurrentServerAddress() local server = ip .. ':' .. port if server ~= '51.83.174.78:7777' and server ~= '51.83.174.79:7777' then thisScript():unload() end end function main() while not isSampAvailable() do wait(120) end CheckServerIP() while true do wait(120) if not sampIsChatInputActive() and not sampIsDialogActive() and not isCharInAnyCar(playerPed) then if isKeyJustPressed(key.VK_F2) then -- первый слот useHotkey = 1 cartridges = 40 -- патроны в первом слоте sampSendChat("/bag") sampSendClickTextdraw(231) sampSendClickTextdraw(231) end if isKeyJustPressed(key.VK_F3) then -- второй слот useHotkey = 1 cartridges = 25 -- патроны во втором слоте sampSendChat("/bag") sampSendClickTextdraw(232) sampSendClickTextdraw(232) end end end wait(-1) end function ev.onShowDialog(dialogId, style, title, button1, button2, text) if dialogId == 3861 and useHotkey == 1 then useHotkey = 0 sampSendDialogResponse(dialogId, 1, _, cartridges) sampSendClickTextdraw(230) return false end end