Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "lib.sampfuncs"
- require "lib.moonloader"
- script_authors('Sainix',"vk.com/roma_chepiga")
- script_version("1.1")
- local mem = require "memory"
- rTp = false
- sync = false
- local keys = require "vkeys"
- local sampev = require 'lib.samp.events'
- require "lib.sampfuncs"
- require "lib.moonloader"
- local requests = require('requests')
- local verison = " 1.0, release"
- local imgui = require 'imgui'
- local events = require 'lib.samp.events'
- local encoding = require('lib.encoding')
- local aaa = "СК ТИМ НЕ КРЯКАЙТЕ ПЖ"
- local aaa1 = "СК ТИМ НЕ КРЯКАЙТЕ ПЖ"
- local aaa2 = "СК ТИМ НЕ КРЯКАЙТЕ ПЖ"
- local aaa3 = "СК ТИМ НЕ КРЯКАЙТЕ ПЖ"
- local aaa4 = "СК ТИМ НЕ КРЯКАЙТЕ ПЖ"
- local aaa5 = "СК ТИМ НЕ КРЯКАЙТЕ ПЖ"
- local car1 = imgui.ImBool(false)
- local car2 = imgui.ImBool(false)
- local car3 = imgui.ImBool(false)
- local car4 = imgui.ImBool(false)
- local car5 = imgui.ImBool(false)
- local car6 = imgui.ImBool(false)
- local car7 = imgui.ImBool(false)
- local car8 = imgui.ImBool(false)
- local car9 = imgui.ImBool(false)
- local car10 = imgui.ImBool(false)
- local car11 = imgui.ImBool(false)
- local car12 = imgui.ImBool(false)
- local car13 = imgui.ImBool(false)
- local car14 = imgui.ImBool(false)
- local car15 = imgui.ImBool(false)
- local car16 = imgui.ImBool(false)
- local car17 = imgui.ImBool(false)
- local car18 = imgui.ImBool(false)
- local car19 = imgui.ImBool(false)
- local car20 = imgui.ImBool(false)
- local car21 = imgui.ImBool(false)
- local car22 = imgui.ImBool(false)
- local car23 = imgui.ImBool(false)
- local car24 = imgui.ImBool(false)
- local car25 = imgui.ImBool(false)
- local car26 = imgui.ImBool(false)
- local car27 = imgui.ImBool(false)
- local car28 = imgui.ImBool(false)
- local car29 = imgui.ImBool(false)
- local car30 = imgui.ImBool(false)
- local car31 = imgui.ImBool(false)
- local car32 = imgui.ImBool(false)
- local car33 = imgui.ImBool(false)
- local car34 = imgui.ImBool(false)
- local car35 = imgui.ImBool(false)
- local car36 = imgui.ImBool(false)
- local car37 = imgui.ImBool(false)
- local car38 = imgui.ImBool(false)
- local car39 = imgui.ImBool(false)
- local car40 = imgui.ImBool(false)
- local car41 = imgui.ImBool(false)
- local car42 = imgui.ImBool(false)
- local car43 = imgui.ImBool(false)
- local car44 = imgui.ImBool(false)
- local car45 = imgui.ImBool(false)
- local car46 = imgui.ImBool(false)
- local car47 = imgui.ImBool(false)
- local car48 = imgui.ImBool(false)
- local car49 = imgui.ImBool(false)
- local car50 = imgui.ImBool(false)
- local car51 = imgui.ImBool(false)
- local car52 = imgui.ImBool(false)
- local car53 = imgui.ImBool(false)
- local radioState = imgui.ImInt(1)
- inputID = imgui.ImBuffer(4096)
- local maintest_window_state = imgui.ImBool(false)
- local chkAutoBuy = imgui.ImBool(false)
- local chkCatcherState = imgui.ImBool(false)
- local pX, pY, pZ = 0
- imgui.SwitchContext()
- local style = imgui.GetStyle()
- local colors = style.Colors
- local clr = imgui.Col
- local ImVec4 = imgui.ImVec4
- local ImVec2 = imgui.ImVec2
- local ev = require 'lib.samp.events'
- local isAdm = false
- local admin = -1
- local active = true
- local sms = true
- local captchaS0 = 0
- local captchaS1 = 0
- local captchaS2 = 0
- local captchaS3 = 0
- local captchaS4 = 0
- resCap = 0
- local verison = "1.6"
- local imgui = require 'imgui'
- local samp = require('samp.events')
- local q = require 'lib.samp.events'
- local q = require 'lib.samp.events'
- local vector = require 'vector3d'
- local event = require('lib.samp.events')
- local corsync = false
- local up = false
- local step = 1.9
- local samp = require('samp.events')
- gmped = false
- gmcar = false
- local q = require 'lib.samp.events'
- local delchars = imgui.ImBool(false)
- local delcars = imgui.ImBool(false)
- local kd = 34
- local incar, sync = false, false
- local events = require 'lib.samp.events'
- local s1xreq = {
- _DESCRIPTION = 'Http s1xreq made simpler',
- http_socket = http_socket,
- https_socket = https_socket
- }
- local _s1xreq = {}
- local ffi = require("ffi")
- local encoding = require('lib.encoding')
- local tp = false
- waitaenter = imgui.ImInt(0)
- local radioState = imgui.ImInt(1)
- inputID = imgui.ImBuffer(4096)
- local main_window_state = imgui.ImBool(false)
- local chkAutoBuy = imgui.ImBool(false)
- local chkAutoBuyy = imgui.ImBool(false)
- local onumbers = imgui.ImBool(false)
- local aenter = imgui.ImBool(false)
- local hook = require 'samp.events'
- local onlyfive = imgui.ImBool(false)
- local chkAutoBuyyy = imgui.ImBool(false)
- local col = imgui.ImBool(false)
- local chkAutoBuyyyy = imgui.ImBool(false)
- local chkAutoBuyyyyy = imgui.ImBool(false)
- local chkCatcherState = imgui.ImBool(false)
- local pX, pY, pZ = 0
- imgui.SwitchContext()
- local style = imgui.GetStyle()
- local colors = style.Colors
- local clr = imgui.Col
- local ImVec4 = imgui.ImVec4
- local ImVec2 = imgui.ImVec2
- encoding.default = 'CP1251'
- cp1251 = encoding.CP1251
- u8 = encoding.UTF8
- local avtonazatietwo = imgui.ImBool(false)
- waitavtonazatietwo = imgui.ImInt(250)
- style.WindowPadding = ImVec2(15, 15)
- style.WindowRounding = 6.0
- style.FramePadding = ImVec2(5, 5)
- style.FrameRounding = 4.0
- style.ItemSpacing = ImVec2(12, 8)
- style.ItemInnerSpacing = ImVec2(8, 6)
- style.IndentSpacing = 25.0
- style.ScrollbarSize = 15.0
- style.ScrollbarRounding = 9.0
- style.GrabMinSize = 5.0
- style.GrabRounding = 3.0
- colors[clr.FrameBg] = ImVec4(0.16, 0.48, 0.42, 0.54)
- colors[clr.FrameBgHovered] = ImVec4(0.26, 0.98, 0.85, 0.40)
- colors[clr.FrameBgActive] = ImVec4(0.26, 0.98, 0.85, 0.67)
- colors[clr.TitleBg] = ImVec4(0.04, 0.04, 0.04, 1.00)
- colors[clr.TitleBgActive] = ImVec4(0.16, 0.48, 0.42, 1.00)
- colors[clr.TitleBgCollapsed] = ImVec4(0.00, 0.00, 0.00, 0.51)
- colors[clr.CheckMark] = ImVec4(0.26, 0.98, 0.85, 1.00)
- colors[clr.SliderGrab] = ImVec4(0.24, 0.88, 0.77, 1.00)
- colors[clr.SliderGrabActive] = ImVec4(0.26, 0.98, 0.85, 1.00)
- colors[clr.Button] = ImVec4(0.26, 0.98, 0.85, 0.40)
- colors[clr.ButtonHovered] = ImVec4(0.26, 0.98, 0.85, 1.00)
- colors[clr.ButtonActive] = ImVec4(0.06, 0.98, 0.82, 1.00)
- colors[clr.Header] = ImVec4(0.26, 0.98, 0.85, 0.31)
- colors[clr.HeaderHovered] = ImVec4(0.26, 0.98, 0.85, 0.80)
- colors[clr.HeaderActive] = ImVec4(0.26, 0.98, 0.85, 1.00)
- colors[clr.Separator] = colors[clr.Border]
- colors[clr.SeparatorHovered] = ImVec4(0.10, 0.75, 0.63, 0.78)
- colors[clr.SeparatorActive] = ImVec4(0.10, 0.75, 0.63, 1.00)
- colors[clr.ResizeGrip] = ImVec4(0.26, 0.98, 0.85, 0.25)
- colors[clr.ResizeGripHovered] = ImVec4(0.26, 0.98, 0.85, 0.67)
- colors[clr.ResizeGripActive] = ImVec4(0.26, 0.98, 0.85, 0.95)
- colors[clr.PlotLines] = ImVec4(0.61, 0.61, 0.61, 1.00)
- colors[clr.PlotLinesHovered] = ImVec4(1.00, 0.81, 0.35, 1.00)
- colors[clr.TextSelectedBg] = ImVec4(0.26, 0.98, 0.85, 0.35)
- colors[clr.Text] = ImVec4(1.00, 1.00, 1.00, 1.00)
- colors[clr.TextDisabled] = ImVec4(0.50, 0.50, 0.50, 1.00)
- colors[clr.WindowBg] = ImVec4(0.06, 0.06, 0.06, 0.94)
- colors[clr.ChildWindowBg] = ImVec4(1.00, 1.00, 1.00, 0.00)
- colors[clr.PopupBg] = ImVec4(0.08, 0.08, 0.08, 0.94)
- colors[clr.ComboBg] = colors[clr.PopupBg]
- colors[clr.Border] = ImVec4(0.43, 0.43, 0.50, 0.50)
- colors[clr.BorderShadow] = ImVec4(0.00, 0.00, 0.00, 0.00)
- colors[clr.MenuBarBg] = ImVec4(0.14, 0.14, 0.14, 1.00)
- colors[clr.ScrollbarBg] = ImVec4(0.02, 0.02, 0.02, 0.53)
- colors[clr.ScrollbarGrab] = ImVec4(0.31, 0.31, 0.31, 1.00)
- colors[clr.ScrollbarGrabHovered] = ImVec4(0.41, 0.41, 0.41, 1.00)
- colors[clr.ScrollbarGrabActive] = ImVec4(0.51, 0.51, 0.51, 1.00)
- colors[clr.CloseButton] = ImVec4(0.41, 0.41, 0.41, 0.50)
- colors[clr.CloseButtonHovered] = ImVec4(0.98, 0.39, 0.36, 1.00)
- colors[clr.CloseButtonActive] = ImVec4(0.98, 0.39, 0.36, 1.00)
- colors[clr.PlotHistogram] = ImVec4(0.90, 0.70, 0.00, 1.00)
- colors[clr.PlotHistogramHovered] = ImVec4(1.00, 0.60, 0.00, 1.00)
- colors[clr.ModalWindowDarkening] = ImVec4(0.80, 0.80, 0.80, 0.35)
- local q = require 'lib.samp.events'
- local vector = require 'vector3d'
- local tp1 = false
- local delay = 600
- local coord = false
- local surfing2 = false
- local Surfing = false
- local font = renderCreateFont("Arial", 10, 5)
- local dlstatus = require('moonloader').download_status
- local q = require 'lib.samp.events'
- local samp = require 'lib.samp.events'
- local vector = require 'vector3d'
- local tp, sync = false, false
- local tpCount, timer = 0, 0
- local tpTime = nil
- requests = require('requests')
- function getserial()
- local ffi = require("ffi")
- ffi.cdef[[
- int __stdcall GetVolumeInformationA(
- const char* lpRootPathName,
- char* lpVolumeNameBuffer,
- uint32_t nVolumeNameSize,
- uint32_t* lpVolumeSerialNumber,
- uint32_t* lpMaximumComponentLength,
- uint32_t* lpFileSystemFlags,
- char* lpFileSystemNameBuffer,
- uint32_t nFileSystemNameSize
- );
- ]]
- local serial = ffi.new("unsigned long[1]", 0)
- ffi.C.GetVolumeInformationA(nil, nil, 0, serial, nil, nil, nil, 0)
- return serial[0]
- end
- function autoupdate(json_url, prefix, url)
- local dlstatus = require('moonloader').download_status
- local json = getWorkingDirectory() .. '\\'..thisScript().name..'-version.json'
- if doesFileExist(json) then os.remove(json) end
- downloadUrlToFile(json_url, json,
- function(id, status, p1, p2)
- if status == dlstatus.STATUSEX_ENDDOWNLOAD then
- if doesFileExist(json) then
- local f = io.open(json, 'r')
- if f then
- local info = decodeJson(f:read('*a'))
- updatelink = info.updateurl
- updateversion = info.latest
- f:close()
- os.remove(json)
- if updateversion ~= thisScript().version then
- lua_thread.create(function(prefix)
- local dlstatus = require('moonloader').download_status
- local color = -1
- msg(('Обнаружено обновление. Пытаюсь обновиться c '..thisScript().version..' на '..updateversion), color)
- wait(250)
- downloadUrlToFile(updatelink, thisScript().path,
- function(id3, status1, p13, p23)
- if status1 == dlstatus.STATUS_DOWNLOADINGDATA then
- print(string.format('Загружено %d из %d.', p13, p23))
- elseif status1 == dlstatus.STATUS_ENDDOWNLOADDATA then
- print('Загрузка обновления завершена.')
- msg(('Обновление завершено!'), color)
- goupdatestatus = true
- lua_thread.create(function() wait(500) thisScript():reload() end)
- end
- if status1 == dlstatus.STATUSEX_ENDDOWNLOAD then
- if goupdatestatus == nil then
- msg(('Обновление прошло неудачно. Запускаю устаревшую версию..'), color)
- update = false
- end
- end
- end
- )
- end, prefix
- )
- else
- update = false
- print('v'..thisScript().version..': Обновление не требуется.')
- end
- end
- else
- print('v'..thisScript().version..': Не могу проверить обновление. Смиритесь или проверьте самостоятельно на '..url)
- update = false
- end
- end
- end
- )
- while update ~= false do wait(100) end
- end
- function checkKey()
- response = requests.get('http://f0426516.xsph.ru/auth.php?code='..getserial())
- if not response.text:match("<body>(.*)</body>"):find("-1") then -- Если ключ есть в бд
- else
- msg('Отсутствует ключ для авторизации. Данные скопированы в буфер обмена. Передайте их автору: vk.com/roma_chepiga')
- os.execute("explorer \"https://vk.com/roma_chepiga\"")
- setClipboardText(getserial())
- thisScript():unload()
- sasakrack = false
- end
- end
- function q.onSetPlayerPos(p)
- if sync then
- timer = os.clock()
- return false
- end
- end
- function msg(text)
- return sampAddChatMessage('{FBFF00}| SainixTeleport | {FFFFFF}'..text, 0xFBFF00)
- end
- function pokazatel()
- lua_thread.create(function()
- while true do wait(0)
- if left ~= nil and tp1 then
- local px, py = getScreenResolution()
- renderFontDrawText(font, "Distance: " .. left .. "." .. math.random(00,99), px/5+1280, 112, -1)
- end
- end
- end)
- end
- function q.onSendPlayerSync(data)
- if tp then return false end
- end
- function sendOnfootSync(x, y, z)
- local data = samp_create_sync_data('player')
- data.position = {x, y, z}
- data.moveSpeed = {0.299999, 0.299999, -0.299999}
- data.send()
- end
- function samp_create_sync_data(sync_type, copy_from_player)
- local ffi = require 'ffi'
- local sampfuncs = require 'sampfuncs'
- local raknet = require 'samp.raknet'
- 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)))
- 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
- 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
- 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
- function getTargetBlipCoordinatesFixed()
- local bool, x, y, z = getTargetBlipCoordinates(); if not bool then return false end
- requestCollision(x, y); loadScene(x, y, z)
- local bool, x, y, z = getTargetBlipCoordinates()
- return bool, x, y, z
- end
- function SearchMarker(posX, posY, posZ)
- local ret_posX = 0.0
- local ret_posY = 0.0
- local ret_posZ = 0.0
- local isFind = false
- for id = 0, 31 do
- local MarkerStruct = 0
- MarkerStruct = 0xC7F168 + id * 56
- local MarkerPosX = representIntAsFloat(readMemory(MarkerStruct + 0, 4, false))
- local MarkerPosY = representIntAsFloat(readMemory(MarkerStruct + 4, 4, false))
- local MarkerPosZ = representIntAsFloat(readMemory(MarkerStruct + 8, 4, false))
- if MarkerPosX ~= 0.0 or MarkerPosY ~= 0.0 or MarkerPosZ ~= 0.0 then
- ret_posX = MarkerPosX
- ret_posY = MarkerPosY
- ret_posZ = MarkerPosZ
- isFind = true
- end
- end
- return isFind, ret_posX, ret_posY, ret_posZ
- end
- function ShowHelpMarker(desc)
- imgui.TextDisabled('(?)')
- if imgui.IsItemHovered() then
- imgui.BeginTooltip()
- imgui.PushTextWrapPos(450.0)
- imgui.TextUnformatted(desc)
- imgui.PopTextWrapPos()
- imgui.EndTooltip()
- end
- end
- function ShowMessageMarker(desc)
- imgui.TextDisabled('(!)')
- if imgui.IsItemHovered() then
- imgui.BeginTooltip()
- imgui.PushTextWrapPos(1000.0)
- imgui.TextUnformatted(desc)
- imgui.PopTextWrapPos()
- imgui.EndTooltip()
- end
- end
- function imgui.OnDrawFrame()
- if main_window_state.v then
- imgui.SetNextWindowSize(imgui.ImVec2(500, 500), imgui.Cond.FirstUseEver)
- local sW, sH = getScreenResolution()
- imgui.SetNextWindowPos(imgui.ImVec2(sW / 2, sH / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
- imgui.Begin(u8'Sainix Teleport | Приватный телепорт ^3', main_window_state, imgui.WindowFlags.NoResize or imgui.WindowFlags.NoCollapse or imgui.WindowFlags.NoSavedSettings)
- imgui.Columns(2, NULL, false)
- imgui.SetColumnOffset(1, 500)
- if imgui.CollapsingHeader(u8"Помощь в ловле") then
- imgui.Checkbox(u8'Коллизия', col)
- ShowHelpMarker(u8'Функция позволяет проходить без проблем через людей (не работает на машины, объекты и прочее).', imgui.SameLine())
- imgui.Checkbox(u8'Только цифры', onumbers)
- ShowHelpMarker(u8'В диалог капчи с включённой функией возможно будет ввести только цифры.', imgui.SameLine())
- imgui.Checkbox(u8'Только 5 цифр', aenter)
- ShowHelpMarker(u8'Ограничение символов в диалоге капчи.', imgui.SameLine())
- imgui.Checkbox(u8'АвтоНажатие "N"', avtonazatietwo)
- ShowHelpMarker(u8'Автоматически нажимает клавишу: "N", когда дом/бизнес слетает (поиск осуществляется по экрану).', imgui.SameLine())
- imgui.Text(u8"Введите задержку Auto N")
- imgui.SliderInt(u8"##2", waitavtonazatietwo, 0, 1000)
- imgui.Checkbox(u8'АвтоНажатие "ENTER"', onlyfive)
- ShowHelpMarker(u8'Автоматически нажимает клавишу: "ENTER", когда в окне капчи есть 5 символов.', imgui.SameLine())
- imgui.Text(u8"Введите задержку Auto Enter")
- imgui.SliderInt(u8"##3", waitaenter, 0, 1000)
- end
- if imgui.CollapsingHeader(u8"Дополнительные функции") then
- imgui.Checkbox(u8'Удаление людей', delchars)
- ShowHelpMarker(u8'Если активен чекбокс, то при нажатии клавиши "E" все люди в зоне стрима удалятся.', imgui.SameLine())
- imgui.Checkbox(u8'Удаление машин', delcars)
- ShowHelpMarker(u8'Если активен чекбокс, то при нажатии клавиши "R" все машины в зоне стрима удалятся.', imgui.SameLine())
- ShowMessageMarker(u8'Убирает все автомобили в зоне прорисовки визуально, но хочу предупредить, что после этого пока Вы не покинете данную зону прорисовки.', imgui.SameLine())
- end
- if imgui.CollapsingHeader(u8"ГМ для персонажа и машины") then
- imgui.Text(u8"Активация на клавишу `Insert`.")
- imgui.Text(u8"Защищает Вас от падений, пуль, и прочего.")
- imgui.Text(u8"Активация на клавишу `Home`.")
- imgui.Text(u8"Защищает Ваш транспорт от любых повреждений.")
- end
- if imgui.CollapsingHeader(u8"Действия после покупки") then
- ShowHelpMarker(u8'Определение последующих действий после ловли дома.', imgui.SameLine())
- imgui.RadioButton(u8' Ничего не делать', radioState, 1)
- imgui.RadioButton(u8' Отключиться от сервера', radioState, 2)
- end
- if imgui.CollapsingHeader(u8"Информация") then
- imgui.Text(u8"Автор скрипта: Sainix")
- ShowMessageMarker(u8'Вк - https://vk.com/roma_chepiga', imgui.SameLine())
- ShowMessageMarker(u8'Ютуб - https://www.youtube.com/channel/UC3ATgMtTuJ2LS6iM8RU67fw/', imgui.SameLine())
- end
- if imgui.CollapsingHeader(u8"Доп. информация") then
- imgui.RadioButton(u8' Описание команд:', radioState, 1)
- imgui.Text(u8"/stph - меню скрипта ")
- imgui.Text(u8"/stp - телепорт на метку ")
- ShowHelpMarker(u8'1 способ тп', imgui.SameLine())
- imgui.Text(u8"/stp c - телепорт на чекпоинт ")
- ShowHelpMarker(u8'1 способ тп', imgui.SameLine())
- imgui.Text(u8"/stp2 - телепорт на метку ")
- ShowHelpMarker(u8'2 способ тп', imgui.SameLine())
- ShowMessageMarker(u8'Может иногда крашить игру', imgui.SameLine())
- imgui.Text(u8"/stpc2 - телепорт на чекпоинт ")
- ShowHelpMarker(u8'2 способ тп', imgui.SameLine())
- ShowMessageMarker(u8'Может иногда крашить игру', imgui.SameLine())
- imgui.Text(u8"/stpd (номер дома) - телепорт на дом ")
- imgui.Text(u8"/stpb (номер бизнесса) - телепорт на бизнесс ")
- end
- imgui.End()
- end
- end
- function ShowMessage(text, title, style)
- ffi.cdef [[
- int MessageBoxA(
- void* hWnd,
- const char* lpText,
- const char* lpCaption,
- unsigned int uType
- );
- ]]
- local hwnd = ffi.cast('void*', readMemory(0x00C8CF88, 4, false))
- ffi.C.MessageBoxA(hwnd, text, title, style and (style + 0x50000) or 0x50000)
- end
- function nopHook(name, bool)
- local samp = require 'samp.events'
- samp[name] = function()
- if bool then
- return false
- end
- end
- end
- function sendUnoccupiedSyncBySeatId(x, y, z, seatId)
- local data = allocateMemory(67)
- local car = storeCarCharIsInNoSave(PLAYER_PED)
- local _, vehicleId = sampGetVehicleIdByCarHandle(car)
- local rx, ry, rz = getCarRoll(car)
- setStructElement(data, 0, 2, vehicleId, false)
- setStructElement(data, 2, 1, seatId, false)
- -- roll
- setStructFloatElement(data, 3, rx, false)
- setStructFloatElement(data, 7, ry, false)
- setStructFloatElement(data, 11, rz, false)
- -- direction
- setStructFloatElement(data, 15, 0.09, false)
- setStructFloatElement(data, 19, -0.8, false)
- setStructFloatElement(data, 23, 0.02, false)
- -- position
- setStructFloatElement(data, 27, x, false)
- setStructFloatElement(data, 31, y, false)
- setStructFloatElement(data, 35, z, false)
- -- speed
- setStructFloatElement(data, 39, 0.05, false)
- setStructFloatElement(data, 43, 0.05, false)
- setStructFloatElement(data, 47, 0.05, false)
- -- turning speed
- setStructFloatElement(data, 51, 0.005, false)
- setStructFloatElement(data, 55, -0.002, false)
- setStructFloatElement(data, 59, 0.3, false)
- -- car health
- setStructElement(data, 63, 4, 0, false)
- sampSendUnoccupiedData(data)
- freeMemory(data)
- end
- function sendInCarFakePosition(x, y, z)
- for i = 0, 2 do
- local data = allocateMemory(24)
- local _, pId = sampGetPlayerIdByCharHandle(PLAYER_PED)
- sampStorePlayerPassengerData(pId, data)
- local seatId = getStructElement(data, 2, 1, false)
- freeMemory(data)
- sendUnoccupiedSyncBySeatId(x, y, z, seatId)
- sendPassengerSync(x, y, z)
- end
- end
- function getAngle(x1, y1, x2, y2)
- return math.atan2(x2 - x1, y2 - y1);
- end
- function hook.onCreate3DText(i, clr, pos, distance, ignoreWalls, playerId, vehicleId, textd)
- if avtonazatietwo.v and (textd:find("*** Дом продается ***") or textd:find("Бизнес продается")) then
- lua_thread.create(function()
- wait (waitavtonazatietwo.v)
- local _, myId = sampGetPlayerIdByCharHandle(PLAYER_PED)
- local data = allocateMemory(68)
- sampStorePlayerOnfootData(myId, data)
- setStructElement(data, 36, 1, 128, false)
- sampSendOnfootData(data)
- freeMemory(data)
- end)
- end
- end
- function hook.onServerMessage(color, text)
- if text:find("{FF6347} Местом спавна автоматически назначен ваш дом. Изменить место спавна {FFFFFF}") then
- if radioState.v == 2 then
- raknetEmulPacketReceiveBitStream(PACKET_DISCONNECTION_NOTIFICATION, raknetNewBitStream())
- raknetDeleteBitStream(raknetNewBitStream())
- sampDisconnectWithReason(1)
- sampAddChatMessage("{FFFFFF} Дисконнект проведён успешно!", -1)
- radioState.v = 1
- end
- end
- end
- function hook.onShowDialog(dialogID, style, title, button1, button2, txt)
- if onumbers.v and title:find('Проверка на робота') then
- lua_thread.create(function()
- wait(0)
- while true do wait(0)
- inputtext = sampGetCurrentDialogEditboxText()
- if inputtext ~= '' then
- sampSetCurrentDialogEditboxText(string.gsub(inputtext, '[^1234567890]',''))
- end
- end
- end)
- end
- if onlyfive.v and title:find('Проверка на робота') then
- lua_thread.create(function()
- wait(0)
- while true do wait(0)
- textsumfive = sampGetCurrentDialogEditboxText()
- if col.v then kol() end
- if #textsumfive == 5 then
- wait (waitaenter.v)
- sampCloseCurrentDialogWithButton(1)
- onlyfive.v = false
- break
- end
- end
- end)
- end
- if aenter.v then
- lua_thread.create(function()
- while true do
- wait(0)
- if sampIsDialogActive() and sampGetDialogCaption():find('Проверка на робота') then
- if onumbers.v then sampSetCurrentDialogEditboxText(string.gsub(sampGetCurrentDialogEditboxText(), '[^1234567890]','')) end
- if aenter.v then
- local text = sampGetCurrentDialogEditboxText()
- if #text > 5 then sampSetCurrentDialogEditboxText(text:sub(1, 5)) end
- end
- end
- end
- end)
- end
- end
- function kol()
- for _, pedv in ipairs(getAllChars()) do
- if doesCharExist(pedv) then
- if pedv ~= playerPed then
- setCharCollision(pedv, false)
- end
- end
- end
- end
- function main()
- while not isSampAvailable() do wait(0) end
- checkKey()
- wait(0)
- msg('Статус привязки: Активен. Автор: vk.com/roma_chepiga')
- sasakrack = true
- autoupdate("http://f0426516.xsph.ru/update.php", '['..string.upper(thisScript().name)..']: ', "http://f0426516.xsph.ru/update.php")
- encoding.default = 'CP1251'
- cp1251 = encoding.CP1251
- u8 = encoding.UTF8
- imgui.Process = true
- lua_thread.create(function ()
- while true do
- wait(0)
- doKeyCheck()
- end
- end)
- sampRegisterChatCommand("stp2", function(param) state = not state
- vid = tonumber(param)
- if not param:match('%d+') then
- state = false
- return sampAddChatMessage('Используй: /stp2 [vehId]', -1)
- end
- if state then
- lua_thread.create(sit_marker)
- state = false
- end
- end)
- sampRegisterChatCommand("stpc2", function(param) state = not state
- vid = tonumber(param)
- if not param:match('%d+') then
- state = false
- return sampAddChatMessage('Используй: /stpc2 [vehId]', -1)
- end
- if state then
- lua_thread.create(sit_checkpoint)
- state = false
- end
- end)
- sampRegisterChatCommand("stpd", cmd_fhp)
- sampRegisterChatCommand("stpb", cmd_fbp)
- sampRegisterChatCommand("stph", function()
- main_window_state.v = not main_window_state.v
- end)
- lua_thread.create(function ()
- while true do
- wait(0)
- if delchars.v and isKeyDown(0x45) then dekchars() end
- if delcars.v and isKeyDown(0x52) then dekcars() end
- if col.v then kol() end
- imgui.Process = main_window_state.v
- end
- end)
- sampRegisterChatCommand('stp', function()
- if sasakrack == nil or sasakrack == false then
- return end
- lua_thread.create(function()
- if tp then return end
- blip, blipX, blipY, blipZ = getTargetBlipCoordinatesFixed()
- if blip then
- sync = true
- tpTime = os.clock()
- charPosX, charPosY, charPosZ = getCharCoordinates(playerPed)
- local distan = getDistanceBetweenCoords3d(blipX, blipY, charPosZ, charPosX, charPosY, charPosZ)
- if distan < 7 then return setCharCoordinates(playerPed, blipX, blipY, blipZ) end
- tp = true
- freezeCharPosition(playerPed, true)
- setCharCoordinates(playerPed, blipX, blipY, blipZ -0.6)
- end
- end)
- end)
- sampRegisterChatCommand('stpc', function()
- if sasakrack == nil or sasakrack == false then
- return end
- lua_thread.create(function()
- if tp then return end
- blip, blipX, blipY, blipZ = SearchMarker(getCharCoordinates(PLAYER_PED))
- if blip then
- tpTime = os.clock()
- charPosX, charPosY, charPosZ = getCharCoordinates(playerPed)
- local distan = getDistanceBetweenCoords3d(blipX, blipY, charPosZ, charPosX, charPosY, charPosZ)
- if distan < 7 then return setCharCoordinates(playerPed, blipX, blipY, blipZ) end
- tp = true
- freezeCharPosition(playerPed, true)
- setCharCoordinates(playerPed, blipX, blipY, blipZ -0.6)
- end
- end)
- end)
- while true do wait(0)
- if os.clock() - timer > 2400 and sync then
- timer, tpCount = 0, 0
- sync = true
- sampForceOnfootSync()
- sync = false
- end
- if sasakrack == nil or sasakrack == false then
- return end
- if tp then
- if getDistanceBetweenCoords3d(blipX, blipY, blipZ, charPosX, charPosY, charPosZ) > 7 then
- local distanc = getDistanceBetweenCoords3d(blipX, blipY, charPosZ, charPosX, charPosY, charPosZ)
- wait(2)
- vectorX = blipX - charPosX
- vectorY = blipY - charPosY
- vectorZ = blipZ - charPosZ
- local vec = vector(vectorX, vectorY, vectorZ)
- vec:normalize()
- charPosX = charPosX + vec.x * 7
- charPosY = charPosY + vec.y * 7
- charPosZ = charPosZ + vec.z * 2
- wait(6)
- sendOnfootSync(charPosX, charPosY, charPosZ)
- --printStringNow('~Y~dist~W~:'..math.floor(distanc), 200)
- tpCount = tpCount + 1
- if tpCount == 5 then
- sendOnfootSync(charPosX, charPosY + 55, charPosZ)
- tpCount = 0
- end
- else
- sync = 0
- sync = false
- printStringNow('~y~onfoot ~w~teleported', 4000)
- --printStringNow(string.format("teleport to [%.1f sec].", os.clock() - tpTime), 4000)
- msg('{FBFF00} Тпхнуло за: {FFFFFF} '..os.clock() - tpTime, -1)
- sendOnfootSync(charPosX, charPosY, charPosZ)
- setCharCoordinates(playerPed, blipX, blipY, blipZ)
- sendOnfootSync(charPosX, charPosY, charPosZ)
- sampForceAimSync()
- sampForceOnfootSync()
- wait(900)
- setCharCoordinates(playerPed, blipX, blipY, blipZ)
- freezeCharPosition(playerPed, false)
- tp = false
- thisScript():reload()
- end
- end
- end
- wait(-1)
- end
- function car_teleport()
- sync = true
- local veh = storeCarCharIsInNoSave(PLAYER_PED)
- local res, carid = sampGetVehicleIdByCarHandle(veh)
- if not res then
- rTp = false
- sync = false
- return
- end
- local _, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
- local data = allocateMemory(63)
- sampStorePlayerPassengerData(id, data)
- local seat = getStructElement(data, 2, 1)
- if seat == 0 then
- rTp = false
- sync = false
- sampAddChatMessage('{FF0000}Ошибка. {FFFFFF}Займите пассажирское место', -1)
- return
- end
- local myX, myY, myZ = getCharCoordinates(PLAYER_PED)
- local hand = sampGetCarHandleBySampVehicleId(veh)
- while(myZ > -1) do
- myZ = myZ -1
- if myZ <= -1 then
- freezeCharPosition(playerPed, true)
- sendUnoccupiedSync(carid, seat, myX, myY, -1)
- sendPassengerSync(myX, myY, -1)
- requestCollision(tpx, tpy)
- loadScene(tpx, tpy, tpz)
- zfix = getGroundZFor3dCoord(tpx, tpy, 100)
- tp_sync_pos = split(myX, myY, 2, tpx, tpy, 2, 2)
- myZ = -1
- clearCharTasksImmediately(PLAYER_PED)
- setCharCoordinates(playerPed, tpx, tpy, zfix)
- for i = 5, #tp_sync_pos do
- sendUnoccupiedSync(carid, seat, tp_sync_pos[i][1], tp_sync_pos[i][2], z)
- sendPassengerSync(tp_sync_pos[i][1], tp_sync_pos[i][2], z)
- wait(10)
- sendUnoccupiedSync(carid, seat, tp_sync_pos[i][1], tp_sync_pos[i][2], z)
- end
- sendUnoccupiedSync(carid, seat, tpx, tpy, zfix +15)
- sendPassengerSync(tpx, tpy, zfix +15)
- sampForceVehicleSync()
- sampForceOnfootSync()
- setCharCoordinates(playerPed, tpx, tpy, zfix)
- wait(1000)
- sendUnoccupiedSync(carid, seat, tpx, tpy, zfix +15)
- sendPassengerSync(tpx, tpy, zfix +15)
- sendUnoccupiedSync(carid, seat, myX, myY, myZ +15)
- sendPassengerSync(myX, myY, myZ +15)
- sendOnfootSync(tpx, tpy, zfix +15, carid)
- sync = false
- freezeCharPosition(playerPed, false)
- break
- else
- sendUnoccupiedSync(carid, seat, myX, myY, myZ)
- sendPassengerSync(myX, myY, myZ)
- end
- end
- wait(1000)
- rTp = false
- end
- function split(x0, y0, z0, x1, y1, z1, step)
- local direction = vector(x1 - x0, y1 - y0, z1 - z0)
- local distance = direction:normalize()
- local path = { }
- local begin = vector(x0, y0 ,z0)
- local cursor = vector(x0, y0, z0)
- path[1] = { cursor:get() }
- repeat
- cursor = cursor + direction * step
- path[#path + 1] = { cursor:get() }
- until(cursor - begin):length() > distance
- return path
- end
- function sit_marker()
- if not isCharInAnyCar(PLAYER_PED) then
- local _, veh = sampGetCarHandleBySampVehicleId(vid)
- if _ then
- local px, py, pz = getCharCoordinates(PLAYER_PED)
- local vx, vy, vz = getCarCoordinates(veh)
- local dist = getDistanceBetweenCoords3d(px, py, pz, vx, vy, vz)
- if dist < 30 then
- sampSendEnterVehicle(vid, true)
- wait(1000)
- taskEnterCarAsPassenger(PLAYER_PED, veh, 100)
- wait(2000)
- lua_thread.create(un)
- else
- sampAddChatMessage('{FF0000}Ошибка. {FFFFFF}Встаньте ближе к машине!', -1)
- end
- else
- sampAddChatMessage('{FF0000}Ошибка. {FFFFFF}Машины нет в зоне стрима!', -1)
- end
- else
- sampAddChatMessage('{FF0000}Ошибка. {FFFFFF}Вы должны быть на ногах!', -1)
- end
- end
- function sit_checkpoint()
- if not isCharInAnyCar(PLAYER_PED) then
- local _, veh = sampGetCarHandleBySampVehicleId(vid)
- if _ then
- local px, py, pz = getCharCoordinates(PLAYER_PED)
- local vx, vy, vz = getCarCoordinates(veh)
- local dist = getDistanceBetweenCoords3d(px, py, pz, vx, vy, vz)
- if dist < 30 then
- sampSendEnterVehicle(vid, true)
- wait(1000)
- taskEnterCarAsPassenger(PLAYER_PED, veh, 100)
- wait(2500)
- lua_thread.create(un1)
- else
- sampAddChatMessage('{FF0000}Ошибка. {FFFFFF}Встаньте ближе к машине!', -1)
- end
- else
- sampAddChatMessage('{FF0000}Ошибка. {FFFFFF}Машины нет в зоне стрима!', -1)
- end
- else
- sampAddChatMessage('{FF0000}Ошибка. {FFFFFF}Вы должны быть на ногах!', -1)
- end
- end
- function un()
- if rTp then
- return
- end
- res, tpx, tpy, tpz = getTargetBlipCoordinates()
- if res then
- if isCharInAnyCar(PLAYER_PED) then
- rTp = true
- lua_thread.create(car_teleport)
- else
- sampAddChatMessage('Для телепорта нужно сесть в машину.', -1)
- end
- else
- sampAddChatMessage('Отсутствует метка на карте.', -1)
- end
- end
- function un1()
- local posX, posY, posZ = getCharCoordinates(PLAYER_PED)
- res, tpx, tpy, tpz = SearchMarker(posX, posY, posZ)
- if res then
- if isCharInAnyCar(PLAYER_PED) then
- rTp = true
- lua_thread.create(car_teleport)
- else
- sampAddChatMessage('Для телепорта нужно сесть в машину.', -1)
- end
- else
- sampAddChatMessage('Отсутствует метка на карте.', -1)
- end
- end
- function nopHook(name, bool)
- local samp = require 'samp.events'
- samp[name] = function()
- if bool then
- return false
- end
- end
- end
- function dekchars()
- for _, handle in ipairs(getAllChars()) do
- if doesCharExist(handle) then
- local _, id = sampGetPlayerIdByCharHandle(handle)
- if id ~= myid then
- emul_rpc('onPlayerStreamOut', { id })
- end
- end
- end
- end
- function emul_rpc(hook, parameters)
- local bs_io = require 'samp.events.bitstream_io'
- local handler = require 'samp.events.handlers'
- local extra_types = require 'samp.events.extra_types'
- local hooks = {
- --[[ Outgoing rpcs
- ['onSendEnterVehicle'] = { 'int16', 'bool8', 26 },
- ['onSendClickPlayer'] = { 'int16', 'int8', 23 },
- ['onSendClientJoin'] = { 'int32', 'int8', 'string8', 'int32', 'string8', 'string8', 'int32', 25 },
- ['onSendEnterEditObject'] = { 'int32', 'int16', 'int32', 'vector3d', 27 },
- ['onSendCommand'] = { 'string32', 50 },
- ['onSendSpawn'] = { 52 },
- ['onSendDeathNotification'] = { 'int8', 'int16', 53 },
- ['onSendDialogResponse'] = { 'int16', 'int8', 'int16', 'string8', 62 },
- ['onSendClickTextDraw'] = { 'int16', 83 },
- ['onSendVehicleTuningNotification'] = { 'int32', 'int32', 'int32', 'int32', 96 },
- ['onSendChat'] = { 'string8', 101 },
- ['onSendClientCheckResponse'] = { 'int8', 'int32', 'int8', 103 },
- ['onSendVehicleDamaged'] = { 'int16', 'int32', 'int32', 'int8', 'int8', 106 },
- ['onSendEditAttachedObject'] = { 'int32', 'int32', 'int32', 'int32', 'vector3d', 'vector3d', 'vector3d', 'int32', 'int32', 116 },
- ['onSendEditObject'] = { 'bool', 'int16', 'int32', 'vector3d', 'vector3d', 117 },
- ['onSendInteriorChangeNotification'] = { 'int8', 118 },
- ['onSendMapMarker'] = { 'vector3d', 119 },
- ['onSendRequestClass'] = { 'int32', 128 },
- ['onSendRequestSpawn'] = { 129 },
- ['onSendPickedUpPickup'] = { 'int32', 131 },
- ['onSendMenuSelect'] = { 'int8', 132 },
- ['onSendVehicleDestroyed'] = { 'int16', 136 },
- ['onSendQuitMenu'] = { 140 },
- ['onSendExitVehicle'] = { 'int16', 154 },
- ['onSendUpdateScoresAndPings'] = { 155 },
- ['onSendGiveDamage'] = { 'int16', 'float', 'int32', 'int32', 115 },
- ['onSendTakeDamage'] = { 'int16', 'float', 'int32', 'int32', 115 },]]
- -- Incoming rpcs
- ['onInitGame'] = { 139 },
- ['onPlayerJoin'] = { 'int16', 'int32', 'bool8', 'string8', 137 },
- ['onPlayerQuit'] = { 'int16', 'int8', 138 },
- ['onRequestClassResponse'] = { 'bool8', 'int8', 'int32', 'int8', 'vector3d', 'float', 'Int32Array3', 'Int32Array3', 128 },
- ['onRequestSpawnResponse'] = { 'bool8', 129 },
- ['onSetPlayerName'] = { 'int16', 'string8', 'bool8', 11 },
- ['onSetPlayerPos'] = { 'vector3d', 12 },
- ['onSetPlayerPosFindZ'] = { 'vector3d', 13 },
- ['onSetPlayerHealth'] = { 'float', 14 },
- ['onTogglePlayerControllable'] = { 'bool8', 15 },
- ['onPlaySound'] = { 'int32', 'vector3d', 16 },
- ['onSetWorldBounds'] = { 'float', 'float', 'float', 'float', 17 },
- ['onGivePlayerMoney'] = { 'int32', 18 },
- ['onSetPlayerFacingAngle'] = { 'float', 19 },
- --['onResetPlayerMoney'] = { 20 },
- --['onResetPlayerWeapons'] = { 21 },
- ['onGivePlayerWeapon'] = { 'int32', 'int32', 22 },
- --['onCancelEdit'] = { 28 },
- ['onSetPlayerTime'] = { 'int8', 'int8', 29 },
- ['onSetToggleClock'] = { 'bool8', 30 },
- ['onPlayerStreamIn'] = { 'int16', 'int8', 'int32', 'vector3d', 'float', 'int32', 'int8', 32 },
- ['onSetShopName'] = { 'string256', 33 },
- ['onSetPlayerSkillLevel'] = { 'int16', 'int32', 'int16', 34 },
- ['onSetPlayerDrunk'] = { 'int32', 35 },
- ['onCreate3DText'] = { 'int16', 'int32', 'vector3d', 'float', 'bool8', 'int16', 'int16', 'encodedString4096', 36 },
- --['onDisableCheckpoint'] = { 37 },
- ['onSetRaceCheckpoint'] = { 'int8', 'vector3d', 'vector3d', 'float', 38 },
- --['onDisableRaceCheckpoint'] = { 39 },
- --['onGamemodeRestart'] = { 40 },
- ['onPlayAudioStream'] = { 'string8', 'vector3d', 'float', 'bool8', 41 },
- --['onStopAudioStream'] = { 42 },
- ['onRemoveBuilding'] = { 'int32', 'vector3d', 'float', 43 },
- ['onCreateObject'] = { 44 },
- ['onSetObjectPosition'] = { 'int16', 'vector3d', 45 },
- ['onSetObjectRotation'] = { 'int16', 'vector3d', 46 },
- ['onDestroyObject'] = { 'int16', 47 },
- ['onPlayerDeathNotification'] = { 'int16', 'int16', 'int8', 55 },
- ['onSetMapIcon'] = { 'int8', 'vector3d', 'int8', 'int32', 'int8', 56 },
- ['onRemoveVehicleComponent'] = { 'int16', 'int16', 57 },
- ['onRemove3DTextLabel'] = { 'int16', 58 },
- ['onPlayerChatBubble'] = { 'int16', 'int32', 'float', 'int32', 'string8', 59 },
- ['onUpdateGlobalTimer'] = { 'int32', 60 },
- ['onShowDialog'] = { 'int16', 'int8', 'string8', 'string8', 'string8', 'encodedString4096', 61 },
- ['onDestroyPickup'] = { 'int32', 63 },
- ['onLinkVehicleToInterior'] = { 'int16', 'int8', 65 },
- ['onSetPlayerArmour'] = { 'float', 66 },
- ['onSetPlayerArmedWeapon'] = { 'int32', 67 },
- ['onSetSpawnInfo'] = { 'int8', 'int32', 'int8', 'vector3d', 'float', 'Int32Array3', 'Int32Array3', 68 },
- ['onSetPlayerTeam'] = { 'int16', 'int8', 69 },
- ['onPutPlayerInVehicle'] = { 'int16', 'int8', 70 },
- --['onRemovePlayerFromVehicle'] = { 71 },
- ['onSetPlayerColor'] = { 'int16', 'int32', 72 },
- ['onDisplayGameText'] = { 'int32', 'int32', 'string32', 73 },
- --['onForceClassSelection'] = { 74 },
- ['onAttachObjectToPlayer'] = { 'int16', 'int16', 'vector3d', 'vector3d', 75 },
- ['onInitMenu'] = { 76 },
- ['onShowMenu'] = { 'int8', 77 },
- ['onHideMenu'] = { 'int8', 78 },
- ['onCreateExplosion'] = { 'vector3d', 'int32', 'float', 79 },
- ['onShowPlayerNameTag'] = { 'int16', 'bool8', 80 },
- ['onAttachCameraToObject'] = { 'int16', 81 },
- ['onInterpolateCamera'] = { 'bool', 'vector3d', 'vector3d', 'int32', 'int8', 82 },
- ['onGangZoneStopFlash'] = { 'int16', 85 },
- ['onApplyPlayerAnimation'] = { 'int16', 'string8', 'string8', 'bool', 'bool', 'bool', 'bool', 'int32', 86 },
- ['onClearPlayerAnimation'] = { 'int16', 87 },
- ['onSetPlayerSpecialAction'] = { 'int8', 88 },
- ['onSetPlayerFightingStyle'] = { 'int16', 'int8', 89 },
- ['onSetPlayerVelocity'] = { 'vector3d', 90 },
- ['onSetVehicleVelocity'] = { 'bool8', 'vector3d', 91 },
- ['onServerMessage'] = { 'int32', 'string32', 93 },
- ['onSetWorldTime'] = { 'int8', 94 },
- ['onCreatePickup'] = { 'int32', 'int32', 'int32', 'vector3d', 95 },
- ['onMoveObject'] = { 'int16', 'vector3d', 'vector3d', 'float', 'vector3d', 99 },
- ['onEnableStuntBonus'] = { 'bool', 104 },
- ['onTextDrawSetString'] = { 'int16', 'string16', 105 },
- ['onSetCheckpoint'] = { 'vector3d', 'float', 107 },
- ['onCreateGangZone'] = { 'int16', 'vector2d', 'vector2d', 'int32', 108 },
- ['onPlayCrimeReport'] = { 'int16', 'int32', 'int32', 'int32', 'int32', 'vector3d', 112 },
- ['onGangZoneDestroy'] = { 'int16', 120 },
- ['onGangZoneFlash'] = { 'int16', 'int32', 121 },
- ['onStopObject'] = { 'int16', 122 },
- ['onSetVehicleNumberPlate'] = { 'int16', 'string8', 123 },
- ['onTogglePlayerSpectating'] = { 'bool32', 124 },
- ['onSpectatePlayer'] = { 'int16', 'int8', 126 },
- ['onSpectateVehicle'] = { 'int16', 'int8', 127 },
- ['onShowTextDraw'] = { 134 },
- ['onSetPlayerWantedLevel'] = { 'int8', 133 },
- ['onTextDrawHide'] = { 'int16', 135 },
- ['onRemoveMapIcon'] = { 'int8', 144 },
- ['onSetWeaponAmmo'] = { 'int8', 'int16', 145 },
- ['onSetGravity'] = { 'float', 146 },
- ['onSetVehicleHealth'] = { 'int16', 'float', 147 },
- ['onAttachTrailerToVehicle'] = { 'int16', 'int16', 148 },
- ['onDetachTrailerFromVehicle'] = { 'int16', 149 },
- ['onSetWeather'] = { 'int8', 152 },
- ['onSetPlayerSkin'] = { 'int32', 'int32', 153 },
- ['onSetInterior'] = { 'int8', 156 },
- ['onSetCameraPosition'] = { 'vector3d', 157 },
- ['onSetCameraLookAt'] = { 'vector3d', 'int8', 158 },
- ['onSetVehiclePosition'] = { 'int16', 'vector3d', 159 },
- ['onSetVehicleAngle'] = { 'int16', 'float', 160 },
- ['onSetVehicleParams'] = { 'int16', 'int16', 'bool8', 161 },
- --['onSetCameraBehind'] = { 162 },
- ['onChatMessage'] = { 'int16', 'string8', 101 },
- ['onConnectionRejected'] = { 'int8', 130 },
- ['onPlayerStreamOut'] = { 'int16', 163 },
- ['onVehicleStreamIn'] = { 164 },
- ['onVehicleStreamOut'] = { 'int16', 165 },
- ['onPlayerDeath'] = { 'int16', 166 },
- ['onPlayerEnterVehicle'] = { 'int16', 'int16', 'bool8', 26 },
- ['onUpdateScoresAndPings'] = { 'PlayerScorePingMap', 155 },
- ['onSetObjectMaterial'] = { 84 },
- ['onSetObjectMaterialText'] = { 84 },
- ['onSetVehicleParamsEx'] = { 'int16', 'int8', 'int8', 'int8', 'int8', 'int8', 'int8', 'int8', 'int8', 'int8', 'int8', 'int8', 'int8', 'int8', 'int8', 'int8', 'int8', 24 },
- ['onSetPlayerAttachedObject'] = { 'int16', 'int32', 'bool', 'int32', 'int32', 'vector3d', 'vector3d', 'vector3d', 'int32', 'int32', 113 }
- }
- local handler_hook = {
- ['onInitGame'] = true,
- ['onCreateObject'] = true,
- ['onInitMenu'] = true,
- ['onShowTextDraw'] = true,
- ['onVehicleStreamIn'] = true,
- ['onSetObjectMaterial'] = true,
- ['onSetObjectMaterialText'] = true
- }
- local extra = {
- ['PlayerScorePingMap'] = true,
- ['Int32Array3'] = true
- }
- local hook_table = hooks[hook]
- if hook_table then
- local bs = raknetNewBitStream()
- if not handler_hook[hook] then
- local max = #hook_table-1
- if max > 0 then
- for i = 1, max do
- local p = hook_table[i]
- if extra[p] then extra_types[p]['write'](bs, parameters[i])
- else bs_io[p]['write'](bs, parameters[i]) end
- end
- end
- else
- if hook == 'onInitGame' then handler.on_init_game_writer(bs, parameters)
- elseif hook == 'onCreateObject' then handler.on_create_object_writer(bs, parameters)
- elseif hook == 'onInitMenu' then handler.on_init_menu_writer(bs, parameters)
- elseif hook == 'onShowTextDraw' then handler.on_show_textdraw_writer(bs, parameters)
- elseif hook == 'onVehicleStreamIn' then handler.on_vehicle_stream_in_writer(bs, parameters)
- elseif hook == 'onSetObjectMaterial' then handler.on_set_object_material_writer(bs, parameters, 1)
- elseif hook == 'onSetObjectMaterialText' then handler.on_set_object_material_writer(bs, parameters, 2) end
- end
- raknetEmulRpcReceiveBitStream(hook_table[#hook_table], bs)
- raknetDeleteBitStream(bs)
- end
- end
- function dekcars()
- for k, v in pairs(getAllVehicles()) do
- if doesVehicleExist(v) then
- deleteCar(v)
- end
- end
- end
- --- Телепортация к дому (пассажирка).
- function cmd_fhp(arg)
- lua_thread.create(function()
- sampSendChat("/findihouse ".. arg)
- wait(250)
- sampProcessChatInput("/stp")
- end)
- end
- --- Телепортация к бизнесу (пассажирка).
- function cmd_fbp(arg)
- lua_thread.create(function()
- sampSendChat("/findibiz ".. arg)
- wait(250)
- sampProcessChatInput("/stpc")
- end)
- end
- function nopHook(name, bool)
- local samp = require 'samp.events'
- samp[name] = function()
- if bool then
- return false
- end
- end
- end
- function sendPassengerSync(x, y, z)
- local _, myId = sampGetPlayerIdByCharHandle(PLAYER_PED)
- local data = allocateMemory(63)
- sampStorePlayerPassengerData(myId, data)
- setStructFloatElement(data, 12, x, false)
- setStructFloatElement(data, 16, y, false)
- setStructFloatElement(data, 20, z, false)
- sampSendPassengerData(data)
- freeMemory(data)
- end
- function sendUnoccupiedSync(v, s, x, y, z)
- local data = allocateMemory(67)
- setStructElement(data, 0, 2, v, false)
- setStructElement(data, 2, 1, s, false)
- setStructFloatElement(data, 3, -0.1, false)
- setStructFloatElement(data, 7, -0.2, false)
- setStructFloatElement(data, 11, -0.3, false)
- setStructFloatElement(data, 15, -0.3, false)
- setStructFloatElement(data, 19, -0.2, false)
- setStructFloatElement(data, 23, -0.1, false)
- setStructFloatElement(data, 27, x, false)
- setStructFloatElement(data, 31, y, false)
- setStructFloatElement(data, 35, z, false)
- setStructFloatElement(data, 39, -0.2, false)
- setStructFloatElement(data, 43, -0.2, false)
- setStructFloatElement(data, 47, -0.2, false)
- setStructFloatElement(data, 51, -0.1, false)
- setStructFloatElement(data, 55, -0.2, false)
- setStructFloatElement(data, 59, -0.3, false)
- setStructFloatElement(data, 63, getCarHealth(select(2, sampGetCarHandleBySampVehicleId(v))), false)
- sampSendUnoccupiedData(data)
- freeMemory(data)
- end
- function sampev.onSendUnoccupiedSync(d)
- if sync then
- return false
- end
- end
- function sampev.onSetPlayerPos()
- if sync then
- return false
- end
- end
- function sampev.onRemovePlayerFromVehicle()
- if sync then
- return false
- end
- end
- function sampev.onSetVehiclePosition()
- if sync then
- return false
- end
- end
- function doKeyCheck()
- if not isKeyCheckAvailable() then return end
- local isInVeh = isCharInAnyCar(playerPed)
- local veh = nil
- if isInVeh then veh = storeCarCharIsInNoSave(playerPed) end
- if isKeyJustPressed(VK_INSERT) then
- if gmped == false then
- setCharProofs(playerPed, true, true, true, true, true)
- writeMemory(0x96916E, 1, 1, false)
- gmped = true
- printStringNow("~g~GM enabled for player!", 2000)
- elseif gmped ~= false then
- setCharProofs(playerPed, false, false, false, false, false)
- writeMemory(0x96916E, 1, 0, false)
- gmped = false
- printStringNow("~r~GM disabled for player!", 2000)
- end
- end
- if isKeyJustPressed(VK_HOME) and isInVeh then
- if gmcar == false then
- setCarProofs(veh, true, true, true, true, true)
- gmcar = true
- printStringNow("~g~GM enabled for cars!", 2000)
- elseif gmcar ~= false then
- setCarProofs(veh, false, false, false, false, false)
- gmcar = false
- printStringNow("~r~GM disabled for cars!", 2000)
- end
- end
- doCheatWork()
- end
- function doCheatWork()
- local isInVeh = isCharInAnyCar(playerPed)
- local veh = nil
- if isInVeh then veh = storeCarCharIsInNoSave(playerPed) end
- if gmped == true and isCharDead(playerPed) then
- setCharProofs(playerPed, false, false, false, false, false)
- writeMemory(0x96916E, 1, 0, false)
- gmped = false
- printStringNow("~r~GM disabled for player!", 2000)
- end
- if gmcar == true and isInVeh then
- setCarProofs(veh, true, true, true, true, true)
- end
- end
- function isKeyCheckAvailable()
- if not isSampfuncsLoaded() then
- return true
- end
- return not isSampfuncsConsoleActive() and not sampIsChatInputActive() and not sampIsDialogActive()
- end
- function atax(par)
- id, id1, id2, id3, id4 = par:match("(.+) (%d+) (%d+) (%d+) (%d+)")
- if id ~= nil or id1 ~= nil or id2 ~= nil or id3 ~= nil or id4 ~= nil then
- function sampev.onShowDialog(dialogId, style, title, button1, button2, text)
- lua_thread.create(function()
- if title:find('робота') then
- wait(id)
- sampSetCurrentDialogEditboxText(captchaS0)
- wait(id1)
- sampSetCurrentDialogEditboxText(captchaS1..captchaS2)
- wait(id2)
- sampSetCurrentDialogEditboxText(captchaS0..captchaS1..captchaS2..captchaS3)
- wait(id3)
- sampSetCurrentDialogEditboxText(captchaS0..captchaS1..captchaS2..captchaS3..captchaS4)
- wait(id4)
- sampSendDialogResponse(23045, 1, '', ''..captchaS0..captchaS1..captchaS2..captchaS3..captchaS4..'')
- wait(1)
- sampCloseCurrentDialogWithButton(1)
- end
- end)
- end
- end
- end
Add Comment
Please, Sign In to add comment