- 44
- 2
нету 2 последних страниц хотя кнопки и тд прописаны
lua:
local waitt = 1500
local imgui = require 'mimgui'
local encoding = require 'encoding'
local ev = require "lib.samp.events"
encoding.default = 'CP1251'
local u8 = encoding.UTF8
local new = imgui.new
local status = false
local status1 = false
local status2 = false
local status3 = false
local status4 = false
local status5 = false
local status6 = false
local status7 = false
local status8 = false
local status9 = false
local status10 = false
local status11 = false
local status12 = false
local status13 = false
local status14 = false
local obhod = true
local WinState = imgui.new.bool()
local SliderOne = new.int(2)
local Slider2 = new.int(2)
local Slider3 = new.int(2)
local Slider4 = new.int(2)
local Slider5 = new.int(2)
local Slider6 = new.int(2)
local tab = 1
local ComboTest = new.int()
local item_list = {u8'������', u8'����'}
local ImItems = imgui.new['const char*'][#item_list](item_list)
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.SetNextWindowSize(imgui.ImVec2(800, 650), imgui.Cond.Always)
imgui.Begin(u8 ' qqware & langerv ', WinState, imgui.WindowFlags.NoResize)
for numberTab, nameTab in pairs({ ' ��������', ' ������', ' �������������' }) do
if imgui.Button(u8(nameTab), imgui.ImVec2(200, 180)) then
tab = numberTab
end
end
imgui.SetCursorPos(imgui.ImVec2(206,40))
if imgui.BeginChild('Name##' .. tab, imgui.ImVec2(700, 547), true) then
if tab == 1 then
imgui.Text(u8 '����� � ���.')
if imgui.Button(u8 '���� �����') then
status = not status
end
imgui.Text(u8 ' ������ ����� ����� ���� ������ ����, ������ ��� ����� ������������ ����� ���� ����� ����� ������ ')
if imgui.Button(u8 '������ �����') then
status1 = not status1
end
imgui.Text(u8 ' ���� ����� ����� ����� ����� ���� ������ ���� ')
if imgui.Button(u8 '���� �����') then
status2 = not status2
end
imgui.Text(u8 ' ����� ������ ����� ������ ���� ������, ������ ����� ��� �� ������������, ����� ��� ������������ ������ ��� ���� ����� ������, ��� �� ����� ���� ')
if imgui.Button(u8 '����� ������') then
status3 = not status3
end
imgui.Text(u8 ' ������ ����� ������ ����� ������ ���� ������, �� ����� ��� ����, ����� ���� ����� �� ������, �.� ����� ���� ����� ������� ������ ')
if imgui.Button(u8 '������ ����� ������') then
status4 = not status4
end
imgui.Text(u8 ' ���� ����� ������, ��� ����� ��� � ������ �����, �� ������ (�������� ����� ��������� ���� ������) ')
if imgui.Button(u8 '���� ����� ������') then
status5 = not status5
end
imgui.SetCursorPosX(180)
imgui.SetCursorPosY(178)
imgui.Button(u8'�������� �����')
status6 = not status6
end
elseif tab == 2 then
imgui.Text(u8 '����� � ������')
if imgui.Button(u8 '���� �����') then
status7 = not status7
end
imgui.Text(u8 ' ������ ����� ����� ���� ������ ����, ������ ��� ����� ������������ ����� ���� ����� ����� ������ ')
if imgui.Button(u8 '������ �����') then
status8 = not status8
end
imgui.Text(u8 ' ���� ����� ����� ����� ����� ���� ������ ���� ')
if imgui.Button(u8 '���� �����') then
status9 = not status9
end
imgui.Text(u8 ' ����� ������, ��� ����� ��� � ���� ����� ������ � ��� ')
if imgui.Button(u8 '����� ������') then
status10 = not status10
end
imgui.Text(u8 ' ������ ����� ������, ��� ����� ��� � ������ ����� ������ � ��� ')
if imgui.Button(u8 '������ ����� ������') then
status11 = not status11
end
imgui.Text(u8 ' ���� ����� ������, ��� ����� ��� � ���� ����� ������ � ��� ')
if imgui.Button(u8 '���� ����� ������') then
status12 = not status12
end
imgui.SliderInt(u8 '', Slider6, -130, 130)
imgui.SliderInt(u8 '2', Slider3, -130, 130)
imgui.SliderInt(u8 '3', Slider4, -130, 130)
imgui.SetCursorPosX(180)
imgui.SetCursorPosY(178)
if imgui.Button(u8'�������� �����') then
status13 = not status13
end
elseif tab == 3 then
if imgui.Button(u8'��������') then
obhod = not obhod
if obhod then
sampAddChatMessage("�������� �������, ����������� �� ������!",-1)
else
lua_thread.create(function()
sampAddChatMessage("������ ������� �����",-1)
wait(waitt)
sampSendSpawn()
sampAddChatMessage("�������� ��������",-1)
end)
imgui.Text(u8 ' ����� ������ ���� � ����������� ���, �� ������ ������ �� �� �������� �� ���, ����� ����� ������� ')
imgui.Text(u8 ' menu -> qqware')
imgui.Text(u8 ' script -> langerv')
end
imgui.EndChild()
end
end
end)
imgui.End()
-- ������ ������
imgui.OnInitialize(function()
theme()
end)
function theme()
imgui.SwitchContext()
local style = imgui.GetStyle()
local colors = style.Colors
local clr = imgui.Col
local ImVec4 = imgui.ImVec4
imgui.GetStyle().FramePadding = imgui.ImVec2(3.5, 3.5)
imgui.GetStyle().FrameRounding = 3
imgui.GetStyle().ChildRounding = 2
imgui.GetStyle().WindowTitleAlign = imgui.ImVec2(0.5, 0.5)
imgui.GetStyle().WindowRounding = 2
imgui.GetStyle().ItemSpacing = imgui.ImVec2(5.0, 4.0)
imgui.GetStyle().ScrollbarSize = 13.0
imgui.GetStyle().ScrollbarRounding = 1
imgui.GetStyle().GrabMinSize = 8.0
imgui.GetStyle().GrabRounding = 1.0
imgui.GetStyle().WindowPadding = imgui.ImVec2(4.0, 4.0)
imgui.GetStyle().ButtonTextAlign = imgui.ImVec2(0.0, 0.5)
imgui.GetStyle().WindowRounding = 14
imgui.GetStyle().Colors[imgui.Col.WindowBg] = imgui.ImVec4(0.14, 0.12, 0.16, 1.00)
imgui.GetStyle().Colors[imgui.Col.ChildBg] = imgui.ImVec4(0.30, 0.20, 0.39, 0.00)
imgui.GetStyle().Colors[imgui.Col.PopupBg] = imgui.ImVec4(0.05, 0.05, 0.10, 0.90)
imgui.GetStyle().Colors[imgui.Col.Border] = imgui.ImVec4(0.89, 0.85, 0.92, 0.30)
imgui.GetStyle().Colors[imgui.Col.BorderShadow] = imgui.ImVec4(0.00, 0.00, 0.00, 0.00)
imgui.GetStyle().Colors[imgui.Col.FrameBg] = imgui.ImVec4(0.30, 0.20, 0.39, 1.00)
imgui.GetStyle().Colors[imgui.Col.FrameBgHovered] = imgui.ImVec4(0.41, 0.19, 0.63, 0.68)
imgui.GetStyle().Colors[imgui.Col.FrameBgActive] = imgui.ImVec4(0.41, 0.19, 0.63, 1.00)
imgui.GetStyle().Colors[imgui.Col.TitleBg] = imgui.ImVec4(0.41, 0.19, 0.63, 0.45)
imgui.GetStyle().Colors[imgui.Col.TitleBgCollapsed] = imgui.ImVec4(0.41, 0.19, 0.63, 0.35)
imgui.GetStyle().Colors[imgui.Col.TitleBgActive] = imgui.ImVec4(0.41, 0.19, 0.63, 0.78)
imgui.GetStyle().Colors[imgui.Col.MenuBarBg] = imgui.ImVec4(0.30, 0.20, 0.39, 0.57)
imgui.GetStyle().Colors[imgui.Col.ScrollbarBg] = imgui.ImVec4(0.30, 0.20, 0.39, 1.00)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrab] = imgui.ImVec4(0.41, 0.19, 0.63, 0.31)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabHovered] = imgui.ImVec4(0.41, 0.19, 0.63, 0.78)
imgui.GetStyle().Colors[imgui.Col.ScrollbarGrabActive] = imgui.ImVec4(0.41, 0.19, 0.63, 1.00)
imgui.GetStyle().Colors[imgui.Col.CheckMark] = imgui.ImVec4(0.56, 0.61, 1.00, 1.00)
imgui.GetStyle().Colors[imgui.Col.SliderGrab] = imgui.ImVec4(0.41, 0.19, 0.63, 0.24)
imgui.GetStyle().Colors[imgui.Col.SliderGrabActive] = imgui.ImVec4(0.41, 0.19, 0.63, 1.00)
imgui.GetStyle().Colors[imgui.Col.Button] = imgui.ImVec4(0.41, 0.19, 0.63, 0.44)
imgui.GetStyle().Colors[imgui.Col.ButtonHovered] = imgui.ImVec4(0.41, 0.19, 0.63, 0.86)
imgui.GetStyle().Colors[imgui.Col.ButtonActive] = imgui.ImVec4(0.64, 0.33, 0.94, 1.00)
imgui.GetStyle().Colors[imgui.Col.Header] = imgui.ImVec4(0.41, 0.19, 0.63, 0.76)
imgui.GetStyle().Colors[imgui.Col.HeaderHovered] = imgui.ImVec4(0.41, 0.19, 0.63, 0.86)
imgui.GetStyle().Colors[imgui.Col.HeaderActive] = imgui.ImVec4(0.41, 0.19, 0.63, 1.00)
imgui.GetStyle().Colors[imgui.Col.ResizeGrip] = imgui.ImVec4(0.41, 0.19, 0.63, 0.20)
imgui.GetStyle().Colors[imgui.Col.ResizeGripHovered] = imgui.ImVec4(0.41, 0.19, 0.63, 0.78)
imgui.GetStyle().Colors[imgui.Col.ResizeGripActive] = imgui.ImVec4(0.41, 0.19, 0.63, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotLines] = imgui.ImVec4(0.89, 0.85, 0.92, 0.63)
imgui.GetStyle().Colors[imgui.Col.PlotLinesHovered] = imgui.ImVec4(0.41, 0.19, 0.63, 1.00)
imgui.GetStyle().Colors[imgui.Col.PlotHistogram] = imgui.ImVec4(0.89, 0.85, 0.92, 0.63)
imgui.GetStyle().Colors[imgui.Col.PlotHistogramHovered] = imgui.ImVec4(0.41, 0.19, 0.63, 1.00)
imgui.GetStyle().Colors[imgui.Col.TextSelectedBg] = imgui.ImVec4(0.41, 0.19, 0.63, 0.43)
end
function main()
sampRegisterChatCommand('muinvis', function() WinState[0] = not WinState[0] end)
wait(-1)
end
function ev.onSendPlayerSync(data)
if status == true then
local x,y,z = getCharCoordinates(PLAYER_PED)
data.position.z=data.position.z-4
end
if status1 == true then
local x,y,z = getCharCoordinates(PLAYER_PED)
data.position.z=data.position.z-20
end
if status2 == true then
local x,y,z = getCharCoordinates(PLAYER_PED)
data.position.z=data.position.z-80
end
if status3 == true then
local x,y,z = getCharCoordinates(PLAYER_PED)
data.position.z=data.position.z+50
end
if status4 == true then
local x,y,z = getCharCoordinates(PLAYER_PED)
data.position.z=data.position.z+100
end
if status5 == true then
local x,y,z = getCharCoordinates(PLAYER_PED)
data.position.z=data.position.z+130
end
if status6 == true then
local x,y,z = getCharCoordinates(PLAYER_PED)
data.position.z=data.position.z+0
end
end
function ev.onSendVehicleSync(data)
if status7 == true then
data.position.z=data.position.z-10
end
if status8 == true then
data.position.z=data.position.z-35
end
if status9 == true then
data.position.z=data.position.z-55
end
if status10 == true then
data.position.z=data.position.z+50
end
if status11 == true then
data.position.z=data.position.z+100
end
if status12 == true then
data.position.z=data.position.z+130
end
if status13 == true then
data.position.z=data.position.z+0
end
end
function ev.onTogglePlayerSpectating(toggle)
if obhod then
if not toggle then
lua_thread.create(function()
sampRequestClass(1)
wait(waitt)
sampSendSpawn()
sampSendRequestSpawn()
sampAddChatMessage('�������� �� GoxaShow ��������!', -1)
sampAddChatMessage('��������� youtube.com/goxashow', -1)
end)
end
return false
end
end
function ev.onSendPlayerSync(data)
if obhod then
local sync = samp_create_sync_data('spectator')
sync.position = data.position
sync.keysData = data.keysData
sync.send()
return false
end
end
function ev.onSendRequestSpawn() if obhod then return false end end
function ev.onSendSpawn() if obhod then return false end end
function samp_create_sync_data(sync_type, copy_from_player)
local ffi = require 'ffi'
local sampfuncs = require 'sampfuncs'
-- from SAMP.Lua
local raknet = require 'samp.raknet'
--require 'samp.synchronization'
copy_from_player = copy_from_player or true
local sync_traits = {
player = {'PlayerSyncData', raknet.PACKET.PLAYER_SYNC, sampStorePlayerOnfootData},
vehicle = {'VehicleSyncData', raknet.PACKET.VEHICLE_SYNC, sampStorePlayerIncarData},
passenger = {'PassengerSyncData', raknet.PACKET.PASSENGER_SYNC, sampStorePlayerPassengerData},
aim = {'AimSyncData', raknet.PACKET.AIM_SYNC, sampStorePlayerAimData},
trailer = {'TrailerSyncData', raknet.PACKET.TRAILER_SYNC, sampStorePlayerTrailerData},
unoccupied = {'UnoccupiedSyncData', raknet.PACKET.UNOCCUPIED_SYNC, nil},
bullet = {'BulletSyncData', raknet.PACKET.BULLET_SYNC, nil},
spectator = {'SpectatorSyncData', raknet.PACKET.SPECTATOR_SYNC, nil}
}
local sync_info = sync_traits[sync_type]
local data_type = 'struct ' .. sync_info[1]
local data = ffi.new(data_type, {})
local raw_data_ptr = tonumber(ffi.cast('uintptr_t', ffi.new(data_type .. '*', data)))
-- copy player's sync data to the allocated memory
if copy_from_player then
local copy_func = sync_info[3]
if copy_func then
local _, player_id
if copy_from_player == true then
_, player_id = sampGetPlayerIdByCharHandle(PLAYER_PED)
else
player_id = tonumber(copy_from_player)
end
copy_func(player_id, raw_data_ptr)
end
end
-- function to send packet
local func_send = function()
local bs = raknetNewBitStream()
raknetBitStreamWriteInt8(bs, sync_info[2])
raknetBitStreamWriteBuffer(bs, raw_data_ptr, ffi.sizeof(data))
raknetSendBitStreamEx(bs, sampfuncs.HIGH_PRIORITY, sampfuncs.UNRELIABLE_SEQUENCED, 1)
raknetDeleteBitStream(bs)
end
-- metatable to access sync data and 'send' function
local mt = {
__index = function(t, index)
return data[index]
end,
__newindex = function(t, index, value)
data[index] = value
end
}
return setmetatable({send = func_send}, mt)
end