- 117
- 13
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
- Версия MoonLoader
- Другое
Lua:
local ffi = require 'ffi'
local imgui = require 'mimgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
local u8 = encoding.UTF8
local new = imgui.new
local faicons = require('fAwesome6')
local new, str = imgui.new, ffi.string
local samp = require('samp.events')
local on = require 'lib.samp.events'
local sf = require 'sampfuncs'
local moonloader = require 'moonloader'
local sampev = require 'lib.samp.events'
local imgui = require 'mimgui' -- подключаем библиотеку мимгуи
local sampev = require('samp.events')
local encoding = require 'encoding' -- подключаем библиотеку для работы с разными кодировками
encoding.default = 'CP1251' -- задаём кодировку по умолчанию
local u8 = encoding.UTF8 -- это позволит нам писать задавать названия/текст на кириллице
require 'widgets' -- подключить айди виджетов
local sampev = require 'samp.events' -- samp events для подмены синхры
local sf = require 'sampfuncs' -- sampfuncs для айди пакетов
local WinState = new.bool()
local font = renderCreateFont("Arial", 10, 13)
function getPlayer()
local nick = {
"Ek",
"Alexandr_Morton",
"Patsoha",
"Rdc",
"jN.Lepton.",
"CoCuCo4Ka",
".nevermore",
"jN.Kamik@dze.",
"Sereja_Qcold",
"[Q]EvGenyi"
}
local connectedPlayers = {}
for id = 0, sampGetMaxPlayerId() do
if sampIsPlayerConnected(id) then
local playerName = sampGetPlayerNickname(id):lower()
local playerColor = sampGetPlayerColor(id)
for _, nickPlayer in ipairs(nick) do
if string.find(playerName, nickPlayer:lower(), 1, true) then
local playerText = string.format("{%06X}%s[%d]", playerColor, sampGetPlayerNickname(id), id)
table.insert(connectedPlayers, playerText)
break
end
end
end
end
return connectedPlayers
end
imgui.OnFrame(function() return WinState[0] end, function(player)
imgui.SetNextWindowPos(imgui.ImVec2(500,500), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.Begin('##Window', WinState)
if imgui.Button(u8'Чекер', imgui.ImVec2(155, 40)) then
tab = 1
end
imgui.SetCursorPos(imgui.ImVec2(165, 33))
if imgui.BeginChild('Name', imgui.ImVec2(-1, -1), true) then
if tab == 1 then
end
imgui.EndChild() -- обязательно следите за тем, чтобы каждый чайлд был закрыт
end
imgui.End()
end)
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand('fh', function() WinState[0] = not WinState[0] end)
while true do wait(0)
local connectedPlayers = getPlayer()
local text = table.concat(connectedPlayers, "\n")
local finalText = "ЧЕКЕР:" .. "\n" .. text
renderFontDrawText(font, finalText, 2, 300, -1)
end
wait(-1)
end
как сделать чтобы в окне вводить Ники кого хочешь видеть в чекере