- 111
- 4
у меня окно пропадает когда я закрываю меню скриптаСоздаешь окно imgui его процесс ставишь true, он появляется теперь на экраое, установи проверку если твое окно активно то showCursor(false), теперь твое окно на экране и ты можешь при этом ходить, дальше импровизируй добавляй текст, системы, или даже fAwesome5-6, и будет тебе дакое меню
скинь коду меня окно пропадает когда я закрываю меню скрипта
скинь код
script_name('SWAT SCRIPT')
require 'lib.moonloader'
local imgui = require 'imgui'
local key = require 'vkeys'
local rkeys = require 'rkeys'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local ffi = require 'ffi'
local main_window_state = imgui.ImBool(false)
local secondary_window_state = imgui.ImBool(false)
local eblandary_window_state = imgui.ImBool(false)
local pidaratry_window_state = imgui.ImBool(false)
local wpora_window_state = imgui.ImBool(false)
local infobar = imgui.ImBool(false)
local inicfg = require 'inicfg'
local cfg = inicfg.load({
main = {
rang = '',
frac = ''
},
settings = {
infobar
}
}, "swatscript")
--
local text = imgui.ImBuffer(tostring(cfg.main.rang), 256)
local text2 = imgui.ImBuffer(tostring(cfg.main.frac), 256)
local search = imgui.ImBuffer(256)
local fa = require 'fAwesome5'
local fa_font = nil
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
function imgui.BeforeDrawFrame()
if fa_font == nil then
local font_config = imgui.ImFontConfig() -- to use 'imgui.ImFontConfig.new()' on error
font_config.MergeMode = true
fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fa-solid-900.ttf', 13.0, font_config, fa_glyph_ranges)
end
end
local tab = 0
local isPressed = imgui.ImBool(false)
local pinfa = {
''
}
local selected_item = imgui.ImInt(0)
local sw, sh = getScreenResolution()
local tag = '{808080}[SWAT SCRIPT]{ffffff}:'
local strings = [[Бомба с дистанционным управлением
Бомба с дистанционным управлением если {008000}[Удачно]{ffffff}
Бомба с дистанционным управлением если {008000}[Нашел осн.заряд]{ffffff}
Бомба с дистанционным управлением если {ff0000}[Не нашел осн.заряд]{ffffff}
Бомба с дистанционным управлением если {ff0000}[Неудачно]{ffffff}
]]
---меню
function imgui.OnDrawFrame()
if not main_window_state.v and not secondary_window_state.v and not eblandary_window_state.v and not pidaratry_window_state.v and not wpora_window_state.v then
imgui.Process = false
end
if main_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(500, 300), imgui.Cond.FirstUseEver)
imgui.SetNextWindowPos(imgui.ImVec2((sw / 2), sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.Begin(fa['ICON_FA_USER_TIE'] ..u8' SWAT SCRIPT | Главное меню | Версия: 1.00 ' .. fa['ICON_FA_USER_TIE'], main_window_state, imgui.WindowFlags.NoResize)
imgui.CenterText(u8'Скрипт для SWAT | Автор: Marcus_Kransov | Server: Underground')
imgui.Separator()
imgui.Text('')
imgui.SetCursorPos(imgui.ImVec2(150,50))
if imgui.Button(u8'Помощь по скрипту', imgui.ImVec2(200, 30)) then
secondary_window_state.v = true
end
imgui.SetCursorPos(imgui.ImVec2(150,84))
if imgui.Button(u8'Настройки скрипта', imgui.ImVec2(200, 30)) then
pidaratry_window_state.v = true
end
imgui.SetCursorPos(imgui.ImVec2(150,118))
if imgui.Button(u8'Шпора', imgui.ImVec2(200,30)) then
wpora_window_state.v = true
end
imgui.Separator()
if imgui.Button(u8'Инструменты') then tab = 1 end
imgui.SameLine()
if tab == 1 then
if imgui.Button(u8'Перезагрузить скрипт') then
showCursor(false)
sampAddChatMessage(tag ..' Перезагружается...', -1)
thisScript():reload()
end
if imgui.Button(u8'Выключить скрипт') then
showCursor(false)
sampAddChatMessage(tag ..' Выключен. Приятной игры')
thisScript():unload()
end
end
imgui.End()
end
if secondary_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(300, 300), imgui.Cond.FirstUseEver)
imgui.SetNextWindowPos(imgui.ImVec2((sw / 2), sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.Begin(fa['ICON_FA_USER_TIE'] ..u8' SWAT SCRIPT | Команды скрипта ' .. fa['ICON_FA_USER_TIE'], secondary_window_state, imgui.WindowFlags.NoResize)
if imgui.CollapsingHeader(u8'/swt') then
imgui.TextWrapped(u8'Описание: открыть/закрыть меню\nИспользование: /swt')
end
if imgui.CollapsingHeader(u8'/bmb') then
imgui.TextWrapped(u8'Описание: Открыть меню с разм. бомбы\nИспользование: /bmb')
end
if imgui.CollapsingHeader(u8'/pmp') then
imgui.TextWrapped(u8'Описание: Первая мед. помощь\nИспользование: /pmp')
end
if imgui.CollapsingHeader(u8'/bal') then
imgui.TextWrapped(u8'Описание: Одеть балаклаву\nИспользование: /bal')
end
if imgui.CollapsingHeader(u8'/otm') then
imgui.TextWrapped(u8'Описание: Отмычка\nИспользование: /otm')
end
if imgui.CollapsingHeader(u8'/c2') then
imgui.TextWrapped(u8'Описание: Взрывчатка\nИспользование: /c2')
end
if imgui.CollapsingHeader(u8'/showudo') then
imgui.TextWrapped(u8'Описание: Удостоверение\nИспользование: /showudo\nВыведет: "' .. nick .. ' | ' .. cfg.main.rang .. ' | ' .. cfg.main.frac .. '"')
end
if imgui.CollapsingHeader(u8'/prp') then
imgui.TextWrapped(u8'Описание: Зачитать права задержанному\nИспользование: /prp')
end
if imgui.CollapsingHeader(u8'/geat') then
imgui.TextWrapped(u8'Описание: Ест грибы до 50 сытости\nИспользование: /geat')
end
if imgui.CollapsingHeader(u8'/gheal') then
imgui.TextWrapped(u8'Описание: /grib heal\nИспользование: /gheal')
end
if imgui.Button(u8'Бинды скрипта', imgui.ImVec2(300, 30)) then
eblandary_window_state.v = true
end
imgui.End()
end
if eblandary_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(410, 200), imgui.Cond.FirstUseEver)
imgui.SetNextWindowPos(imgui.ImVec2((sw / 2), sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.Begin(fa['ICON_FA_USER_TIE'] .. u8' SWAT SCRIPT | Бинды скрипта ' .. fa['ICON_FA_USER_TIE'], eblandary_window_state, imgui.WindowFlags.NoResize)
imgui.Text(u8'Alt + 1 - Балаклава | Alt + 3 - Требования | L - Открыть/Закрыть авто\nB + 7 - Вкл. Body Cam | B + 8 - Состояние Body Cam | B + 9 - Выкл.\n', -1)
imgui.End()
end
if pidaratry_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(459, 130), imgui.Cond.FirstUseEver)
imgui.SetNextWindowPos(imgui.ImVec2((sw / 2), sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.Begin(fa['ICON_FA_USER_TIE'] .. u8' SWAT SCRIPT | Настройки скрипта ' .. fa['ICON_FA_USER_TIE'], pidaratry_window_state, imgui.WindowFlags.NoResize)
if imgui.InputText(fa['ICON_FA_ADDRESS_CARD'] .. u8' Введите Ранг', text) then
cfg.main.rang = text.v
inicfg.save(cfg, 'swatscript.ini')
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Введите ваш ранг в организации')
imgui.EndTooltip()
end
if imgui.InputText(fa['ICON_FA_ADDRESS_CARD'] .. u8' Ваша организация', text2) then
cfg.main.frac = text2.v
inicfg.save(cfg, 'swatscript.ini')
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Введите организацию в которой состоите (на ENG)')
imgui.EndTooltip()
end
imgui.Text('')
imgui.Separator()
imgui.Text('')
if imgui.Checkbox('CheckBoxName', isPressed) then
infobar.v = not infobar.v
cfg.settings.infobar = isPressed.v
inicfg.save(cfg, 'swatscript.ini')
end
imgui.End()
end
if wpora_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(500, 300), imgui.Cond.FirstUseEver)
imgui.SetNextWindowPos(imgui.ImVec2((sw / 2), sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.Begin(fa['ICON_FA_USER_TIE'] .. u8' SWAT SCRIPT | Шпора | Версия: 1.0.0 ' .. fa['ICON_FA_USER_TIE'], wpora_window_state, imgui.WindowFlags.NoResize)
if imgui.CollapsingHeader(u8'Полезное') then
imgui.Separator()
imgui.Text('')
imgui.CenterText(u8'При нажатии на кнопку копируется ссылка. Вставлять в браузер')
imgui.Text('')
imgui.Separator()
imgui.Text('')
if imgui.Button(u8'ЕКП') then
setClipboardText("https://samp-rp.online/threads/edinyj-kodeks-pravonarushenij.2497691/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Единый кодекс правонарушений')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'ФП') then
setClipboardText("https://samp-rp.online/threads/federalnoe-postanovlenie-fp.2531396/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Федеральное постановление')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'ОПГО') then
setClipboardText("https://samp-rp.online/threads/obschee-polozhenie-dlja-gosudarstvennyx-organizacij-opgo.2501534/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Общее положение гос.структур')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'Конституция') then
setClipboardText("https://samp-rp.online/threads/konstitucija.2487411/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Конституция')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'Рейтинг SAPD') then
setClipboardText("https://samp-rp.online/threads/sistema-rejtingov-sapd.2532118/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'система рейтинга SAPD')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'FAQ') then
setClipboardText("https://samp-rp.online/threads/faq.2490746/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'FAQ')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'BadCops') then
setClipboardText("https://samp-rp.online/threads/pravila-bad-cops.2507848/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Правила BadCops')
imgui.EndTooltip()
end
if imgui.Button(u8'Похищения/Теракты') then
setClipboardText("https://samp-rp.online/threads/pravila-poxischenij-i-teraktov.2481228/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Правила похищений & терактов')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'Федеральные законы') then
setClipboardText("https://samp-rp.online/forums/federalnye-zakony.1848/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Федеральные законы')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'Форум') then
setClipboardText("https://samp-rp.online/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Форум SAMP RP')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'П.внедрений') then
setClipboardText("https://samp-rp.online/threads/pravila-vnedrenij-dlja-policii.2494984/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Правила внедрений для полиции')
imgui.EndTooltip()
end
end
if imgui.CollapsingHeader(u8'Полезные скрипты') then
imgui.Separator()
imgui.Text(u8'Для Police/FBI: ')
imgui.SameLine()
if imgui.Button(u8'[ Нажмите ]') then
setClipboardText("https://samp-rp.online/threads/los-santos-police-department-poleznye-skripty.2480261/")
end
imgui.Text('')
imgui.Separator()
imgui.Text('')
imgui.Text(u8'© farm-exclusive / Автор: David Wilson: ')
imgui.SameLine()
if imgui.Button(u8'|| F.Exclusive ||') then
setClipboardText("https://drive.google.com/file/d/19MUNISTyHEgAhACIYqpcOh_vfSpoF61r/view?usp=sharing")
end
imgui.Text(u8'© Super Weapon / Автор: NARVELL')
imgui.SameLine()
if imgui.Button(u8'|| S.Weapon ||') then
setClipboardText("https://drive.google.com/file/d/1gpaqpRYxZdvNy7WYpW1JEYICbRsW2LEu/view?usp=sharing")
end
imgui.Text(u8'CommonPoi / Автор: Неизвестно')
imgui.SameLine()
if imgui.Button(u8'|| CPOI ||') then
setClipboardText("https://drive.google.com/file/d/1SlbQOKivVNgYDlEKr8T9weT2PXQxCDb3/view?usp=drive_link")
end
imgui.Text(u8'© SRP MultiTool / Автор: Flex Junior')
imgui.SameLine()
if imgui.Button(u8'|| S.MultiTool ||') then
setClipboardText("https://drive.google.com/file/d/1C-Dv8qy40UksCE92VkaBIxKCrNyFtep9/view")
end
imgui.Text('')
imgui.Separator()
imgui.TextDisabled(u8'Остальные скрипты для Police/FBI в')
imgui.SameLine()
imgui.TextDisabled(u8'Discord канале')
if imgui.IsItemClicked() then
setClipboardText("https://discord.gg/GJkQJu3rDs")
end
imgui.SameLine()
imgui.TextDisabled(u8'. (Нажмите на "Discord")')
end
if imgui.Combo(u8'Выберите шпору', selected_item, {u8'Ничего не выбрано', u8'ЕКП', u8'ФП', '4'}, 4) then
end
if selected_item.v == 0 then
elseif selected_item.v == 1 then
imgui.Text('TEST')
end
imgui.End()
end
if infobar.v == true then
showCursor(false)
imgui.Begin('Test')
imgui.End()
end
end
---------------------------------------------------------------------
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
sampAddChatMessage(tag ..' Загружен, активация: /swt', 0xFFFFFF)
_, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
nick = sampGetPlayerNickname(id)
---
sampRegisterChatCommand('swt', cmd_swt)
sampRegisterChatCommand('tst', cmd_tst)
sampRegisterChatCommand('showudo', cmd_showudo)
--
sampRegisterChatCommand('bmb', cmd_bmb)
sampRegisterChatCommand('pmp', cmd_pmp)
sampRegisterChatCommand('bal', cmd_bal)
sampRegisterChatCommand('otm', cmd_otm)
sampRegisterChatCommand('c2', cmd_c2)
sampRegisterChatCommand('pre', cmd_pre)
sampRegisterChatCommand('geat', cmd_geat)
sampRegisterChatCommand('gheal', cmd_gheal)
while true do
wait(0)
local result, button, list, input = sampHasDialogRespond(12)
if result then
if button == 1 and list == 0 then
sampSendChat('/me достал из подсумка складную отвертку и саперные щипчики')
wait(2000)
sampSendChat('/me осмотрел бомбу')
wait(2000)
sampSendChat('/do Определил тип взрывного устройства "Бомба с дистанционным управлением"')
wait(2000)
sampSendChat('/do Корпус бомбы держится на четырёх болтах.')
wait(2000)
sampSendChat('/me положил сапёрные щипчики рядом с собой')
wait(2000)
sampSendChat('/me открутил четыре болта на бомбе, положил отвёртку на пол')
wait(2000)
sampSendChat('/me двумя руками вскрыл корпус бомбы, осмотрел бомбу')
wait(2000)
sampSendChat('/try нашёл детонатор') end
if button == 1 and list == 1 then
sampSendChat('/me внимательно изучил провода ведущие к детонатору')
wait(2000)
sampSendChat('/me отрезал нужный провод')
wait(2000)
sampSendChat('/me аккуратно перевернул бомбу другой стороной')
wait(2000)
sampSendChat('/try нашёл основной заряд') end
if button == 1 and list == 2 then
sampSendChat('/me отсоединил заряд')
wait(2000)
sampSendChat('/do Бомба обезврежена')
wait(2000)
sampSendChat('/me убрал сапёрные щипчики и отвёртку в ящик')
end
if button == 1 and list == 3 then
sampSendChat('/try нашёл основной заряд')
end
if button == 1 and list == 4 then
sampSendChat('/me осмотрел бомбу')
wait(1000)
sampSendChat('/try нашёл детонатор') end
end
-----Бинды на клавишу
if wasKeyPressed(VK_L) and not sampIsChatInputActive() and not sampIsDialogActive() then
sampSendChat("/lock")
end
if isKeyDown(VK_MENU) and isKeyJustPressed(VK_3) then
sampSendChat('/s Никому не двигаться! работает SWAT')
wait(1000)
sampSendChat('/b /anim 3 7')
end
if isKeyDown(VK_MENU) and isKeyJustPressed(VK_1) then
sampSendChat('/do На голове надета балаклава, на руках тактические перчатки.')
wait(1000)
sampSendChat('/do Опознавательные знаки отсутствуют . Распознать личность невозможно.')
end
if isKeyDown(VK_B) and isKeyJustPressed(VK_O) then
sampSendChat('/me нажал на кнопку на нагрудной камере «Body Cam G-101» и включил запись.')
end
if isKeyDown(VK_B) and isKeyJustPressed(VK_O) then
sampSendChat('/do Нагрудная камера «Body Cam G-101» ведет запись с передачей на SD-карту.')
wait(1000)
sampSendChat('/time')
end
if isKeyDown(VK_B) and isKeyJustPressed(VK_O) then
sampSendChat('/me нажал на кнопку на нагрудной камере и выключил запись.')
end
end
end
-------Команды
function cmd_tst(arg)
sampSendChat('/b ' .. nick .. ' | ' .. u8:decode(cfg.main.rang) .. ' | ' .. cfg.main.frac .. '.')
end
function cmd_swt(arg)
main_window_state.v = not main_window_state.v
imgui.Process = main_window_state.v
end
function cmd_bmb(arg)
sampShowDialog(12, 'SWAT SCRIPT | Разминирование бомбы', strings, 'Выбрать', 'Закрыть', 2)
end
function cmd_pmp(arg)
lua_thread.create(
function(arg)
sampSendChat('/me осмотрел рану')
wait(1000)
sampSendChat('/do в левом подсумке жгут')
wait(1000)
sampSendChat('/me достал жгут, затем наложил его')
wait(1000)
sampSendChat('/do Кровотечение остановлено')
wait(1000)
sampSendChat('/me достал спирт, брызнул на рану')
wait(1000)
sampSendChat('/me достал бинт, наложил асептическую повязку')
end, arg)
end
function cmd_bal(arg)
lua_thread.create(
function(arg)
sampSendChat('/me достал из кармана балаклаву, натянул на голову')
wait(1000)
sampSendChat('/do На голове балаклава, на руках перчатки. Личность опознать невозможно.')
wait(1000)
sampSendChat('/clist 32')
end, arg)
end
function cmd_otm(arg)
lua_thread.create(
function(arg)
sampSendChat('/me достал из подсумка универсальный набор отмычек, осмотрел замок')
wait(1000)
sampSendChat('/do Определил тип замка, и осмотрел внимательнее')
wait(1000)
sampSendChat('/me подносит отмычку к замку')
wait(1000)
sampSendChat('/do Отмычка в руке.')
wait(1000)
sampSendChat('/me провернул манипуляцию с замком после чего тот открылся')
wait(1000)
sampSendChat('/do Замок успешно открыт.')
wait(1000)
sampSendChat('/todo Готово, можем входить*придерживая ручку двери.')
end, arg)
end
function cmd_c2(arg)
lua_thread.create(
function(arg)
sampSendChat('/me достал из подсумка взрывчатку C2')
wait(1000)
sampSendChat('/do Взрывчатка в руках')
wait(1000)
sampSendChat('/me установил взрывчатку на дверь, взвёл таймер на взрывчатке')
wait(1000)
sampSendChat('/do Взрывчатка активирована')
wait(1000)
sampSendChat('/do Взрыв произошёл успешно, Дверь открыта.')
end, arg)
end
function cmd_showudo(arg)
lua_thread.create(
function(arg)
sampSendChat('/do В заднем кармане штанов лежит удостоверение')
wait(1000)
sampSendChat('/todo Подождите секунду*сунув руку в карман')
wait(1000)
sampSendChat('/me правой рукой вытащил удостоверение из штанов')
wait(1000)
sampSendChat('/do В удостоверении написано: ' .. nick .. ' | ' .. u8:decode(cfg.main.rang) .. ' | ' .. cfg.main.frac .. '.')
end, arg)
end
function cmd_pre(arg)
lua_thread.create(
function(arg)
sampSendChat('Вы вправе не отвечать на вопросы без присутствия своего адвоката.')
wait(1500)
sampSendChat('Все сказанное вами будет использовано против вас в суде.')
wait(1500)
sampSendChat('По вашей просьбе вам предоставят государственного защитника.')
wait(1500)
sampSendChat('Вам ясны ваши права?')
end, arg)
end
function cmd_geat(arg)
lua_thread.create(
function(arg)
sampSendChat('/grib eat')
wait(1000)
sampSendChat('/grib eat')
wait(1000)
sampSendChat('/grib eat')
wait(1000)
sampSendChat('/grib eat')
wait(1000)
sampSendChat('/grib eat')
end, arg)
end
function cmd_gheal(arg)
lua_thread.create(
function(arg)
sampSendChat('/grib heal')
end, arg)
end
------------------------------------------------------------------------------------------------------------------------------------
function theme()
imgui.SwitchContext()
local style = imgui.GetStyle()
local colors = style.Colors
local clr = imgui.Col
local ImVec4 = imgui.ImVec4
local ImVec2 = imgui.ImVec2
style.WindowPadding = ImVec2(8, 8)
style.WindowRounding = 5.0
style.ChildWindowRounding = 5.0
style.FramePadding = ImVec2(2, 2)
style.FrameRounding = 5.0
style.ItemSpacing = ImVec2(5, 5)
style.ItemInnerSpacing = ImVec2(5, 5)
style.TouchExtraPadding = ImVec2(0, 0)
style.IndentSpacing = 5.0
style.ScrollbarSize = 13.0
style.ScrollbarRounding = 5.0
style.GrabMinSize = 20.0
style.GrabRounding = 5.0
style.WindowTitleAlign = ImVec2(0.5, 0.5)
colors[clr.Text] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.TextDisabled] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.WindowBg] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.ChildWindowBg] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.PopupBg] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.Border] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.BorderShadow] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.FrameBg] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.FrameBgHovered] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.FrameBgActive] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.TitleBg] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.TitleBgCollapsed] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.TitleBgActive] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.MenuBarBg] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.ScrollbarBg] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.ScrollbarGrab] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.ScrollbarGrabHovered] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.ScrollbarGrabActive] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.ComboBg] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.CheckMark] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.SliderGrab] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.SliderGrabActive] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.Button] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.ButtonHovered] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.ButtonActive] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.Header] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.HeaderHovered] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.HeaderActive] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.ResizeGrip] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.ResizeGripHovered] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.ResizeGripActive] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.CloseButton] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.CloseButtonHovered] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.CloseButtonActive] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.PlotLines] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.PlotLinesHovered] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.PlotHistogram] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.PlotHistogramHovered] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.TextSelectedBg] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.ModalWindowDarkening] = ImVec4(1.00, 1.00, 1.00, 1.00)
end
theme()
function imgui.CenterText(text)
local width = imgui.GetWindowWidth()
local size = imgui.CalcTextSize(text)
imgui.SetCursorPosX(width / 2 - size.x / 2)
imgui.Text(text)
end
function imgui.NewInputText(lable, val, width, hint, hintpos)
local hint = hint and hint or ''
local hintpos = tonumber(hintpos) and tonumber(hintpos) or 1
local cPos = imgui.GetCursorPos()
imgui.PushItemWidth(width)
local result = imgui.InputText(lable, val)
if #val.v == 0 then
local hintSize = imgui.CalcTextSize(hint)
if hintpos == 2 then imgui.SameLine(cPos.x + (width - hintSize.x) / 2)
elseif hintpos == 3 then imgui.SameLine(cPos.x + (width - hintSize.x - 5))
else imgui.SameLine(cPos.x + 5) end
imgui.TextColored(imgui.ImVec4(1.00, 1.00, 1.00, 0.40), tostring(hint))
end
imgui.PopItemWidth()
return result
end
function imgui.OnDrawFrame()
if not main_window_state.v and not secondary_window_state.v and not eblandary_window_state.v and not pidaratry_window_state.v and not wpora_window_state.v then
imgui.Process = false
end
script_name('SWAT SCRIPT')
require 'lib.moonloader'
local imgui = require 'imgui'
local key = require 'vkeys'
local rkeys = require 'rkeys'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local ffi = require 'ffi'
local main_window_state = imgui.ImBool(false)
local test_window_state = imgui.ImBool(false)
local secondary_window_state = imgui.ImBool(false)
local eblandary_window_state = imgui.ImBool(false)
local pidaratry_window_state = imgui.ImBool(false)
local wpora_window_state = imgui.ImBool(false)
local infobar = imgui.ImBool(false)
local inicfg = require 'inicfg'
local cfg = inicfg.load({
main = {
rang = '',
frac = ''
},
settings = {
infobar
}
}, "swatscript")
--
local text = imgui.ImBuffer(tostring(cfg.main.rang), 256)
local text2 = imgui.ImBuffer(tostring(cfg.main.frac), 256)
local search = imgui.ImBuffer(256)
local fa = require 'fAwesome5'
local fa_font = nil
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
function imgui.BeforeDrawFrame()
if fa_font == nil then
local font_config = imgui.ImFontConfig() -- to use 'imgui.ImFontConfig.new()' on error
font_config.MergeMode = true
fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fa-solid-900.ttf', 13.0, font_config, fa_glyph_ranges)
end
end
local tab = 0
local isPressed = imgui.ImBool(false)
local pinfa = {
''
}
local selected_item = imgui.ImInt(0)
local sw, sh = getScreenResolution()
local tag = '{808080}[SWAT SCRIPT]{ffffff}:'
local strings = [[Бомба с дистанционным управлением
Бомба с дистанционным управлением если {008000}[Удачно]{ffffff}
Бомба с дистанционным управлением если {008000}[Нашел осн.заряд]{ffffff}
Бомба с дистанционным управлением если {ff0000}[Не нашел осн.заряд]{ffffff}
Бомба с дистанционным управлением если {ff0000}[Неудачно]{ffffff}
]]
---меню
function imgui.OnDrawFrame()
if main_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(500, 300), imgui.Cond.FirstUseEver)
imgui.SetNextWindowPos(imgui.ImVec2((sw / 2), sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.Begin(fa['ICON_FA_USER_TIE'] .. u8' SWAT SCRIPT | Главное меню | Версия: 1.00 ' .. fa['ICON_FA_USER_TIE'], main_window_state, imgui.WindowFlags.NoResize)
imgui.CenterText(u8'Скрипт для SWAT | Автор: Marcus_Kransov | Server: Underground')
imgui.Separator()
imgui.Text('')
imgui.SetCursorPos(imgui.ImVec2(150,50))
if imgui.Button(u8'Помощь по скрипту', imgui.ImVec2(200, 30)) then
secondary_window_state.v = true
end
if imgui.Button('TEST WINDOW') then
test_window_state.v = not test_window_state.v
end
imgui.SetCursorPos(imgui.ImVec2(150,84))
if imgui.Button(u8'Настройки скрипта', imgui.ImVec2(200, 30)) then
pidaratry_window_state.v = true
end
imgui.SetCursorPos(imgui.ImVec2(150,118))
if imgui.Button(u8'Шпора', imgui.ImVec2(200,30)) then
wpora_window_state.v = true
end
imgui.Separator()
if imgui.Button(u8'Инструменты') then tab = 1 end
imgui.SameLine()
if tab == 1 then
if imgui.Button(u8'Перезагрузить скрипт') then
showCursor(false)
sampAddChatMessage(tag ..' Перезагружается...', -1)
thisScript():reload()
end
if imgui.Button(u8'Выключить скрипт') then
showCursor(false)
sampAddChatMessage(tag ..' Выключен. Приятной игры')
thisScript():unload()
end
end
imgui.End()
end
if secondary_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(300, 300), imgui.Cond.FirstUseEver)
imgui.SetNextWindowPos(imgui.ImVec2((sw / 2), sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.Begin(fa['ICON_FA_USER_TIE'] .. u8' SWAT SCRIPT | Команды скрипта ' .. fa['ICON_FA_USER_TIE'], secondary_window_state, imgui.WindowFlags.NoResize)
if imgui.CollapsingHeader(u8'/swt') then
imgui.TextWrapped(u8'Описание: открыть/закрыть меню\nИспользование: /swt')
end
if imgui.CollapsingHeader(u8'/bmb') then
imgui.TextWrapped(u8'Описание: Открыть меню с разм. бомбы\nИспользование: /bmb')
end
if imgui.CollapsingHeader(u8'/pmp') then
imgui.TextWrapped(u8'Описание: Первая мед. помощь\nИспользование: /pmp')
end
if imgui.CollapsingHeader(u8'/bal') then
imgui.TextWrapped(u8'Описание: Одеть балаклаву\nИспользование: /bal')
end
if imgui.CollapsingHeader(u8'/otm') then
imgui.TextWrapped(u8'Описание: Отмычка\nИспользование: /otm')
end
if imgui.CollapsingHeader(u8'/c2') then
imgui.TextWrapped(u8'Описание: Взрывчатка\nИспользование: /c2')
end
if imgui.CollapsingHeader(u8'/showudo') then
imgui.TextWrapped(u8'Описание: Удостоверение\nИспользование: /showudo\nВыведет: "' .. nick .. ' | ' .. cfg.main.rang .. ' | ' .. cfg.main.frac .. '"')
end
if imgui.CollapsingHeader(u8'/prp') then
imgui.TextWrapped(u8'Описание: Зачитать права задержанному\nИспользование: /prp')
end
if imgui.CollapsingHeader(u8'/geat') then
imgui.TextWrapped(u8'Описание: Ест грибы до 50 сытости\nИспользование: /geat')
end
if imgui.CollapsingHeader(u8'/gheal') then
imgui.TextWrapped(u8'Описание: /grib heal\nИспользование: /gheal')
end
if imgui.Button(u8'Бинды скрипта', imgui.ImVec2(300, 30)) then
eblandary_window_state.v = true
end
imgui.End()
end
if test_window_state.v then
if imgui.Begin(u8'тест виндав', test_window_state) then
imgui.Text('123')
end
imgui.End()
end
if eblandary_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(410, 200), imgui.Cond.FirstUseEver)
imgui.SetNextWindowPos(imgui.ImVec2((sw / 2), sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.Begin(fa['ICON_FA_USER_TIE'] .. u8' SWAT SCRIPT | Бинды скрипта ' .. fa['ICON_FA_USER_TIE'], eblandary_window_state, imgui.WindowFlags.NoResize)
imgui.Text(u8'Alt + 1 - Балаклава | Alt + 3 - Требования | L - Открыть/Закрыть авто\nB + 7 - Вкл. Body Cam | B + 8 - Состояние Body Cam | B + 9 - Выкл.\n', -1)
imgui.End()
end
if pidaratry_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(459, 130), imgui.Cond.FirstUseEver)
imgui.SetNextWindowPos(imgui.ImVec2((sw / 2), sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.Begin(fa['ICON_FA_USER_TIE'] .. u8' SWAT SCRIPT | Настройки скрипта ' .. fa['ICON_FA_USER_TIE'], pidaratry_window_state, imgui.WindowFlags.NoResize)
if imgui.InputText(fa['ICON_FA_ADDRESS_CARD'] .. u8' Введите Ранг', text) then
cfg.main.rang = text.v
inicfg.save(cfg, 'swatscript.ini')
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Введите ваш ранг в организации')
imgui.EndTooltip()
end
if imgui.InputText(fa['ICON_FA_ADDRESS_CARD'] .. u8' Ваша организация', text2) then
cfg.main.frac = text2.v
inicfg.save(cfg, 'swatscript.ini')
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Введите организацию в которой состоите (на ENG)')
imgui.EndTooltip()
end
imgui.Text('')
imgui.Separator()
imgui.Text('')
if imgui.Checkbox('CheckBoxName', isPressed) then
infobar.v = not infobar.v
cfg.settings.infobar = isPressed.v
inicfg.save(cfg, 'swatscript.ini')
end
imgui.End()
end
if wpora_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(500, 300), imgui.Cond.FirstUseEver)
imgui.SetNextWindowPos(imgui.ImVec2((sw / 2), sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.Begin(fa['ICON_FA_USER_TIE'] .. u8' SWAT SCRIPT | Шпора | Версия: 1.0.0 ' .. fa['ICON_FA_USER_TIE'], wpora_window_state, imgui.WindowFlags.NoResize)
if imgui.CollapsingHeader(u8'Полезное') then
imgui.Separator()
imgui.Text('')
imgui.CenterText(u8'При нажатии на кнопку копируется ссылка. Вставлять в браузер')
imgui.Text('')
imgui.Separator()
imgui.Text('')
if imgui.Button(u8'ЕКП') then
setClipboardText("https://samp-rp.online/threads/edinyj-kodeks-pravonarushenij.2497691/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Единый кодекс правонарушений')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'ФП') then
setClipboardText("https://samp-rp.online/threads/federalnoe-postanovlenie-fp.2531396/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Федеральное постановление')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'ОПГО') then
setClipboardText("https://samp-rp.online/threads/obschee-polozhenie-dlja-gosudarstvennyx-organizacij-opgo.2501534/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Общее положение гос.структур')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'Конституция') then
setClipboardText("https://samp-rp.online/threads/konstitucija.2487411/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Конституция')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'Рейтинг SAPD') then
setClipboardText("https://samp-rp.online/threads/sistema-rejtingov-sapd.2532118/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'система рейтинга SAPD')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'FAQ') then
setClipboardText("https://samp-rp.online/threads/faq.2490746/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'FAQ')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'BadCops') then
setClipboardText("https://samp-rp.online/threads/pravila-bad-cops.2507848/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Правила BadCops')
imgui.EndTooltip()
end
if imgui.Button(u8'Похищения/Теракты') then
setClipboardText("https://samp-rp.online/threads/pravila-poxischenij-i-teraktov.2481228/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Правила похищений & терактов')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'Федеральные законы') then
setClipboardText("https://samp-rp.online/forums/federalnye-zakony.1848/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Федеральные законы')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'Форум') then
setClipboardText("https://samp-rp.online/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Форум SAMP RP')
imgui.EndTooltip()
end
imgui.SameLine()
if imgui.Button(u8'П.внедрений') then
setClipboardText("https://samp-rp.online/threads/pravila-vnedrenij-dlja-policii.2494984/")
end
imgui.SameLine()
imgui.TextDisabled('(?)')
if imgui.IsItemHovered() then
imgui.BeginTooltip()
imgui.Text(u8'Правила внедрений для полиции')
imgui.EndTooltip()
end
end
if imgui.CollapsingHeader(u8'Полезные скрипты') then
imgui.Separator()
imgui.Text(u8'Для Police/FBI: ')
imgui.SameLine()
if imgui.Button(u8'[ Нажмите ]') then
setClipboardText("https://samp-rp.online/threads/los-santos-police-department-poleznye-skripty.2480261/")
end
imgui.Text('')
imgui.Separator()
imgui.Text('')
imgui.Text(u8'© farm-exclusive / Автор: David Wilson: ')
imgui.SameLine()
if imgui.Button(u8'|| F.Exclusive ||') then
setClipboardText("https://drive.google.com/file/d/19MUNISTyHEgAhACIYqpcOh_vfSpoF61r/view?usp=sharing")
end
imgui.Text(u8'© Super Weapon / Автор: NARVELL')
imgui.SameLine()
if imgui.Button(u8'|| S.Weapon ||') then
setClipboardText("https://drive.google.com/file/d/1gpaqpRYxZdvNy7WYpW1JEYICbRsW2LEu/view?usp=sharing")
end
imgui.Text(u8'CommonPoi / Автор: Неизвестно')
imgui.SameLine()
if imgui.Button(u8'|| CPOI ||') then
setClipboardText("https://drive.google.com/file/d/1SlbQOKivVNgYDlEKr8T9weT2PXQxCDb3/view?usp=drive_link")
end
imgui.Text(u8'© SRP MultiTool / Автор: Flex Junior')
imgui.SameLine()
if imgui.Button(u8'|| S.MultiTool ||') then
setClipboardText("https://drive.google.com/file/d/1C-Dv8qy40UksCE92VkaBIxKCrNyFtep9/view")
end
imgui.Text('')
imgui.Separator()
imgui.TextDisabled(u8'Остальные скрипты для Police/FBI в')
imgui.SameLine()
imgui.TextDisabled(u8'Discord канале')
if imgui.IsItemClicked() then
setClipboardText("https://discord.gg/GJkQJu3rDs")
end
imgui.SameLine()
imgui.TextDisabled(u8'. (Нажмите на "Discord")')
end
if imgui.Combo(u8'Выберите шпору', selected_item, {u8'Ничего не выбрано', u8'ЕКП', u8'ФП', '4'}, 4) then
end
if selected_item.v == 0 then
elseif selected_item.v == 1 then
imgui.Text('TEST')
end
imgui.End()
end
if infobar.v == true then
showCursor(false)
imgui.Begin('Test')
imgui.End()
end
end
---------------------------------------------------------------------
function main()
imgui.Process = main_window_state.v or secondary_window_state.v or eblandary_window_state.v or pidaratry_window_state.v or wpora_window_state.v
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
sampAddChatMessage(tag ..' Загружен, активация: /swt', 0xFFFFFF)
_, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
nick = sampGetPlayerNickname(id)
---
sampRegisterChatCommand('swt', cmd_swt)
sampRegisterChatCommand('tst', cmd_tst)
sampRegisterChatCommand('showudo', cmd_showudo)
--
sampRegisterChatCommand('bmb', cmd_bmb)
sampRegisterChatCommand('pmp', cmd_pmp)
sampRegisterChatCommand('bal', cmd_bal)
sampRegisterChatCommand('otm', cmd_otm)
sampRegisterChatCommand('c2', cmd_c2)
sampRegisterChatCommand('pre', cmd_pre)
sampRegisterChatCommand('geat', cmd_geat)
sampRegisterChatCommand('gheal', cmd_gheal)
while true do
wait(0)
local result, button, list, input = sampHasDialogRespond(12)
if result then
if button == 1 and list == 0 then
sampSendChat('/me достал из подсумка складную отвертку и саперные щипчики')
wait(2000)
sampSendChat('/me осмотрел бомбу')
wait(2000)
sampSendChat('/do Определил тип взрывного устройства "Бомба с дистанционным управлением"')
wait(2000)
sampSendChat('/do Корпус бомбы держится на четырёх болтах.')
wait(2000)
sampSendChat('/me положил сапёрные щипчики рядом с собой')
wait(2000)
sampSendChat('/me открутил четыре болта на бомбе, положил отвёртку на пол')
wait(2000)
sampSendChat('/me двумя руками вскрыл корпус бомбы, осмотрел бомбу')
wait(2000)
sampSendChat('/try нашёл детонатор') end
if button == 1 and list == 1 then
sampSendChat('/me внимательно изучил провода ведущие к детонатору')
wait(2000)
sampSendChat('/me отрезал нужный провод')
wait(2000)
sampSendChat('/me аккуратно перевернул бомбу другой стороной')
wait(2000)
sampSendChat('/try нашёл основной заряд') end
if button == 1 and list == 2 then
sampSendChat('/me отсоединил заряд')
wait(2000)
sampSendChat('/do Бомба обезврежена')
wait(2000)
sampSendChat('/me убрал сапёрные щипчики и отвёртку в ящик')
end
if button == 1 and list == 3 then
sampSendChat('/try нашёл основной заряд')
end
if button == 1 and list == 4 then
sampSendChat('/me осмотрел бомбу')
wait(1000)
sampSendChat('/try нашёл детонатор') end
end
-----Бинды на клавишу
if wasKeyPressed(VK_L) and not sampIsChatInputActive() and not sampIsDialogActive() then
sampSendChat("/lock")
end
if isKeyDown(VK_MENU) and isKeyJustPressed(VK_3) then
sampSendChat('/s Никому не двигаться! работает SWAT')
wait(1000)
sampSendChat('/b /anim 3 7')
end
if isKeyDown(VK_MENU) and isKeyJustPressed(VK_1) then
sampSendChat('/do На голове надета балаклава, на руках тактические перчатки.')
wait(1000)
sampSendChat('/do Опознавательные знаки отсутствуют . Распознать личность невозможно.')
end
if isKeyDown(VK_B) and isKeyJustPressed(VK_O) then
sampSendChat('/me нажал на кнопку на нагрудной камере «Body Cam G-101» и включил запись.')
end
if isKeyDown(VK_B) and isKeyJustPressed(VK_O) then
sampSendChat('/do Нагрудная камера «Body Cam G-101» ведет запись с передачей на SD-карту.')
wait(1000)
sampSendChat('/time')
end
if isKeyDown(VK_B) and isKeyJustPressed(VK_O) then
sampSendChat('/me нажал на кнопку на нагрудной камере и выключил запись.')
end
end
end
-------Команды
function cmd_tst(arg)
sampSendChat('/b ' .. nick .. ' | ' .. u8:decode(cfg.main.rang) .. ' | ' .. cfg.main.frac .. '.')
end
function cmd_swt(arg)
main_window_state.v = not main_window_state.v
imgui.Process = main_window_state.v
end
function cmd_bmb(arg)
sampShowDialog(12, 'SWAT SCRIPT | Разминирование бомбы', strings, 'Выбрать', 'Закрыть', 2)
end
function cmd_pmp(arg)
lua_thread.create(
function(arg)
sampSendChat('/me осмотрел рану')
wait(1000)
sampSendChat('/do в левом подсумке жгут')
wait(1000)
sampSendChat('/me достал жгут, затем наложил его')
wait(1000)
sampSendChat('/do Кровотечение остановлено')
wait(1000)
sampSendChat('/me достал спирт, брызнул на рану')
wait(1000)
sampSendChat('/me достал бинт, наложил асептическую повязку')
end, arg)
end
function cmd_bal(arg)
lua_thread.create(
function(arg)
sampSendChat('/me достал из кармана балаклаву, натянул на голову')
wait(1000)
sampSendChat('/do На голове балаклава, на руках перчатки. Личность опознать невозможно.')
wait(1000)
sampSendChat('/clist 32')
end, arg)
end
function cmd_otm(arg)
lua_thread.create(
function(arg)
sampSendChat('/me достал из подсумка универсальный набор отмычек, осмотрел замок')
wait(1000)
sampSendChat('/do Определил тип замка, и осмотрел внимательнее')
wait(1000)
sampSendChat('/me подносит отмычку к замку')
wait(1000)
sampSendChat('/do Отмычка в руке.')
wait(1000)
sampSendChat('/me провернул манипуляцию с замком после чего тот открылся')
wait(1000)
sampSendChat('/do Замок успешно открыт.')
wait(1000)
sampSendChat('/todo Готово, можем входить*придерживая ручку двери.')
end, arg)
end
function cmd_c2(arg)
lua_thread.create(
function(arg)
sampSendChat('/me достал из подсумка взрывчатку C2')
wait(1000)
sampSendChat('/do Взрывчатка в руках')
wait(1000)
sampSendChat('/me установил взрывчатку на дверь, взвёл таймер на взрывчатке')
wait(1000)
sampSendChat('/do Взрывчатка активирована')
wait(1000)
sampSendChat('/do Взрыв произошёл успешно, Дверь открыта.')
end, arg)
end
function cmd_showudo(arg)
lua_thread.create(
function(arg)
sampSendChat('/do В заднем кармане штанов лежит удостоверение')
wait(1000)
sampSendChat('/todo Подождите секунду*сунув руку в карман')
wait(1000)
sampSendChat('/me правой рукой вытащил удостоверение из штанов')
wait(1000)
sampSendChat('/do В удостоверении написано: ' .. nick .. ' | ' .. u8:decode(cfg.main.rang) .. ' | ' .. cfg.main.frac .. '.')
end, arg)
end
function cmd_pre(arg)
lua_thread.create(
function(arg)
sampSendChat('Вы вправе не отвечать на вопросы без присутствия своего адвоката.')
wait(1500)
sampSendChat('Все сказанное вами будет использовано против вас в суде.')
wait(1500)
sampSendChat('По вашей просьбе вам предоставят государственного защитника.')
wait(1500)
sampSendChat('Вам ясны ваши права?')
end, arg)
end
function cmd_geat(arg)
lua_thread.create(
function(arg)
sampSendChat('/grib eat')
wait(1000)
sampSendChat('/grib eat')
wait(1000)
sampSendChat('/grib eat')
wait(1000)
sampSendChat('/grib eat')
wait(1000)
sampSendChat('/grib eat')
end, arg)
end
function cmd_gheal(arg)
lua_thread.create(
function(arg)
sampSendChat('/grib heal')
end, arg)
end
------------------------------------------------------------------------------------------------------------------------------------
function theme()
imgui.SwitchContext()
local style = imgui.GetStyle()
local colors = style.Colors
local clr = imgui.Col
local ImVec4 = imgui.ImVec4
local ImVec2 = imgui.ImVec2
style.WindowPadding = ImVec2(8, 8)
style.WindowRounding = 5.0
style.ChildWindowRounding = 5.0
style.FramePadding = ImVec2(2, 2)
style.FrameRounding = 5.0
style.ItemSpacing = ImVec2(5, 5)
style.ItemInnerSpacing = ImVec2(5, 5)
style.TouchExtraPadding = ImVec2(0, 0)
style.IndentSpacing = 5.0
style.ScrollbarSize = 13.0
style.ScrollbarRounding = 5.0
style.GrabMinSize = 20.0
style.GrabRounding = 5.0
style.WindowTitleAlign = ImVec2(0.5, 0.5)
colors[clr.Text] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.TextDisabled] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.WindowBg] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.ChildWindowBg] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.PopupBg] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.Border] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.BorderShadow] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.FrameBg] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.FrameBgHovered] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.FrameBgActive] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.TitleBg] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.TitleBgCollapsed] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.TitleBgActive] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.MenuBarBg] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.ScrollbarBg] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.ScrollbarGrab] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.ScrollbarGrabHovered] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.ScrollbarGrabActive] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.ComboBg] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.CheckMark] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.SliderGrab] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.SliderGrabActive] = ImVec4(1.00, 1.00, 1.00, 1.00)
colors[clr.Button] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.ButtonHovered] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.ButtonActive] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.Header] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.HeaderHovered] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.HeaderActive] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.ResizeGrip] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.ResizeGripHovered] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.ResizeGripActive] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.CloseButton] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.CloseButtonHovered] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.CloseButtonActive] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.PlotLines] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.PlotLinesHovered] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.PlotHistogram] = ImVec4(0.13, 0.13, 0.13, 1.00)
colors[clr.PlotHistogramHovered] = ImVec4(0.20, 0.20, 0.20, 1.00)
colors[clr.TextSelectedBg] = ImVec4(0.05, 0.05, 0.05, 1.00)
colors[clr.ModalWindowDarkening] = ImVec4(1.00, 1.00, 1.00, 1.00)
end
theme()
function imgui.CenterText(text)
local width = imgui.GetWindowWidth()
local size = imgui.CalcTextSize(text)
imgui.SetCursorPosX(width / 2 - size.x / 2)
imgui.Text(text)
end
function imgui.NewInputText(lable, val, width, hint, hintpos)
local hint = hint and hint or ''
local hintpos = tonumber(hintpos) and tonumber(hintpos) or 1
local cPos = imgui.GetCursorPos()
imgui.PushItemWidth(width)
local result = imgui.InputText(lable, val)
if #val.v == 0 then
local hintSize = imgui.CalcTextSize(hint)
if hintpos == 2 then imgui.SameLine(cPos.x + (width - hintSize.x) / 2)
elseif hintpos == 3 then imgui.SameLine(cPos.x + (width - hintSize.x - 5))
else imgui.SameLine(cPos.x + 5) end
imgui.TextColored(imgui.ImVec4(1.00, 1.00, 1.00, 0.40), tostring(hint))
end
imgui.PopItemWidth()
return result
end