script_name("Pascal For ARZ")
script_author("Pascal")
script_description("Imgui First")
require "lib.moonloader"
local keys = require 'vkeys'
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default - 'CP1251'
u8 = encoding.UTF8
local tag = "Zabiv Probiv"
local label = 0
local main_color = 0x5A90CE
local main_color_text = "5A90CE"
local white_color = "FFFFFF"
function mail()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand("imgui", cmd_imgui)
_, id sampGetIdByCharHandle(PLAYER_PED)
nick = sampGetPlayerNickname(id)
while true do
wait(0)
if isKeyJustPressed(VK_F3) then
sampAddChatMessege("Вы нажали клавишу {FFFFFF}F3" .. main_color_text .. "Ваш ник: {FFFFFF}" .. nick ..", " .. main_color_text .. "ваш ID: {FFFFFF}" .. id, main_color)
end
if is KeyDown(VK_MENU) and isKeyJustPressed(VK_9) then
sampAddChatMessege("Вы нажали зажали клавиши.", main_color)
wait(500)
sampAddChatMessege("Прошло пол секунды", main_color)
end
end
end
function cmd_imgui(arg)
main_window_state.v = not main_window_state.v
imgui.Process = main_windows_state.v
end
function imgui.OnDrawFrame()
imgui.Begin(u8"Привет", main_window_state)
imgui.InputText(u8"Вводить текст сюда", text_buffer)
x, y , z = getCharCoordinates(PLAYER_PED)
input.Text(u8("Позиция игрока: X:" .. math.floor(x) .. " | Y: " .. math.floor(y) .. " | Z:" .. math.floor(z)))
if imgui.Button('Press me') then
sampAddChatMessege(u8:decode(text_buffer.v), -1)
end
ingui.End()
end