Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- https://vk.com/westwow
- script_name("Catcher")
- script_version_number(1)
- script_version("v 0.1 BETA")
- script_authors("vk.com/westwow")
- require('memory').fill(0x00531155, 0x90, 5, true)
- local sampev = require 'lib.samp.events'
- local ffi = require 'ffi'
- local sampfuncs = require 'sampfuncs'
- local raknet = require 'samp.raknet'
- local encoding = require 'encoding'
- local imgui = require 'imgui'
- local bass = require "lib.bass"
- local lanes = require('lanes').configure()
- local dlstatus = require('moonloader').download_status
- local main_window_state = imgui.ImBool(false)
- local keyh_window_state = imgui.ImBool(false)
- local keyb_window_state = imgui.ImBool(false)
- local Version = 1
- encoding.default = 'CP1251'
- u8 = encoding.UTF8
- local HouseCatcher = false
- local BusinessCatcher = false
- local HouseKey = 109
- local BizKey = 106
- local Buy = false
- local Evicting = imgui.ImBool(true)
- local rx, ry = getScreenResolution()
- local Sound = imgui.ImBool(true)
- local Indicator = imgui.ImBool(true)
- local Visible = imgui.ImBool(true)
- local Fafk = imgui.ImBool(false)
- local Aoff = imgui.ImBool(false)
- local SsSound = imgui.ImBool(false)
- local StreamSnipe = imgui.ImBool(false)
- local Tp = true
- local Beg = false
- local input_int_data = imgui.ImInt(0)
- local Buy = false
- local StopFilling = true
- local CloseD = false
- local inicfg = require 'inicfg'
- local SettingsINI = inicfg.load(nil, "Catcher")
- local InfoHouse = 0
- local pickupId = 0
- local x1 = 0
- local y1 = 0
- local z1 = 0
- local AFKtimer = 0
- local AFKrand = math.random(300, 1200)
- local Swork = imgui.ImBool(false)
- local Volume = 0
- local TaxiCatch = 0
- local radio = 0
- local Sprite = false
- file_path = 'unins.dat'
- local scrurl = ' https://cleo-lua.000webhostapp.com/ctr.txt'
- local RegFileD
- function main()
- if not isSampLoaded() and not isSampfuncsLoaded then return end
- while not isSampAvailable() do wait(0) end
- scrurl = scrurl:match('h.*.txt')
- Activat = false
- file_path2 = '1.txt'
- StopRead = true
- RegFileD = false
- if SettingsINI == nil then
- local newData = {
- Keys = {
- House = 109,
- Business = 106
- },
- Settings = {
- Tp = true,
- Beg = false,
- Evicting = false,
- Sound = false,
- Indication = false,
- StreamSnipe = false
- }
- }
- if inicfg.save(newData, "Catcher") then
- print("Ini succes created!")
- end
- else
- HouseKey = SettingsINI.Keys.House
- BizKey = SettingsINI.Keys.Business
- Tp = SettingsINI.Settings.Tp
- Beg = SettingsINI.Settings.Beg
- Evicting.v = SettingsINI.Settings.Evicting
- Sound.v = SettingsINI.Settings.Sound
- Indicator.v = SettingsINI.Settings.Indication
- Visible.v = SettingsINI.Settings.StreamSnipe
- if Tp == true then Beg = false end
- if Tp == false then Beg = true end
- end
- radio = bass.BASS_StreamCreateFile(false, "moonloader/rieltor/alarm.wav", 0, 0, BASS_SAMPLE_LOOP)
- bass.BASS_ChannelSetAttribute(radio, BASS_ATTRIB_VOL, 1.0)
- srn = 0
- if doesFileExist(file_path) then
- os.remove(file_path)
- end
- wait(500)
- if doesFileExist(file_path) then
- reloadScripts()
- else
- 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("C:\\", nil, 0, serial, nil, nil, nil, 0)
- local serialN = serial[0]
- ffi.C.GetVolumeInformationA("D:\\", nil, 0, serial, nil, nil, nil, 0)
- serialN = serialN + serial[0]
- srn = serialN
- if serialN == nil then error('') end
- download_id = downloadUrlToFile(scrurl, file_path, download_handler)
- while RegFileD == false do
- wait(0)
- end
- while FileRead == nil do
- FileRead = io.open(file_path,"r")
- wait(200)
- end
- while StopRead == true do
- wait(0)
- RegCode = FileRead:read("*n")
- if RegCode == nil then
- StopRead = false
- else
- if RegCode == serialN
- then
- Activat = true
- sampRegisterChatCommand('catcher', menu)
- sampRegisterChatCommand('sphere', sphere)
- sampRegisterChatCommand('ch', hcatch)
- sampRegisterChatCommand('ct', tcatch)
- end
- end
- end
- io.close(FileRead)
- end
- font = renderCreateFont("Arial Black", 10, 5)
- if doesFileExist(file_path) then
- os.remove(file_path)
- end
- wait(500)
- if doesFileExist(file_path) then
- reloadScripts()
- else
- if Activat == false then
- sampAddChatMessage(string.format("[Catcher]: Код для активации - %d",srn), 0xffffff)
- sampAddChatMessage('Код скопирован в буфер обмена. Сообщите его продавцу', 0xffffff)
- setClipboardText(srn)
- end
- end
- while true do
- wait(0)
- if Sprite == true then
- lua_thread.create(function()
- wait(200)
- removeBlip(freeh)
- Sprite = false
- end
- )
- end
- if Fafk.v == true and AFKtimer > 0 then
- printStyledString('~R~AFK', 500, 5)
- time = os.time() - AFKtimer
- if time > AFKrand then
- Fafk.v = false
- wait(1000)
- AFKtimer = os.time()
- AFKrand = math.random(300, 1200)
- Fafk.v = true
- end
- end
- if TaxiCatch == 1 then
- positionX, positionY, positionZ = getCharCoordinates(PLAYER_PED)
- --positionZ = positionZ - 1.7
- local data = samp_create_sync_data('player')
- data.position.x = positionX+1
- data.position.y = positionY
- data.position.z = positionZ
- data.send()
- wait(1500)
- end
- if InfoHouse == 1 then
- pickuppoolPtr = sampGetPickupPoolPtr()
- value = readMemory(pickuppoolPtr, 4, 0)
- if value > 0 then
- value = pickuppoolPtr + 4
- value2 = pickuppoolPtr + 61444
- for i=0,4095 do
- value3 = i * 20
- value3 = value3 + value2
- value4 = readMemory(value3, 4, 0)
- if value4 == 1272 or value4 == 19522 then
- x1 = getStructFloatElement(value3, 8, 4)
- y1 = getStructFloatElement(value3, 12, 4)
- z1 = getStructFloatElement(value3, 16, 4)
- z1 = z1 - 1.7
- positionX, positionY, positionZ = getCharCoordinates(PLAYER_PED)
- distance = getDistanceBetweenCoords3d(x1, y1, z1, positionX, positionY, positionZ)
- if distance <= 3 then
- pickupId = i
- checkpoint = addSpriteBlipForContactPoint(x1, y1, z1)
- InfoHouse = 2
- sampAddChatMessage("[Catcher] Не закрывайте табличку дома", 0xffffff)
- break
- end
- end
- end
- end
- end
- if InfoHouse == 2 then
- if InfoHouse == 2 then
- printStringNow('Pickup house dialog', 100)
- if isKeyDown(18) then
- removeBlip(checkpoint)
- end
- if sampIsDialogActive() == true then
- InfoHouse = 3
- end
- end
- end
- if InfoHouse == 3 then
- if sampIsDialogActive() == false then
- printStringNow('~R~Get house dialog', 100)
- end
- if isKeyDown(18) then
- removeBlip(checkpoint)
- end
- positionX, positionY, positionZ = getCharCoordinates(PLAYER_PED)
- distance = getDistanceBetweenCoords3d(x1, y1, z1, positionX, positionY, positionZ)
- if distance > 240 then
- printStringNow('~R~You are so far', 100)
- end
- end
- if InfoHouse == 4 then
- positionX, positionY, positionZ = getCharCoordinates(PLAYER_PED)
- distance = getDistanceBetweenCoords3d(x1, y1, z1, positionX, positionY, positionZ)
- if distance < 240 then
- print(distance)
- sampCloseCurrentDialogWithButton(1)
- removeBlip(checkpoint)
- Buy = true
- if Sound.v == true then
- bass.BASS_ChannelStop(radio)
- bass.BASS_ChannelPlay(radio, false)
- end
- InfoHouse = 0
- else
- InfoHouse = 3
- end
- end
- if isKeyDown(18) then
- bass.BASS_ChannelStop(radio)
- end
- if Visible.v == true then
- poolPtr = sampGetPickupPoolPtr()
- ptwo = readMemory(poolPtr, 4, 0)
- if ptwo > 0 then
- ptwo = poolPtr + 0x4
- pthree = poolPtr + 0xF004
- for id = 1, 4096 do
- pfive = readMemory(ptwo + id * 4, 4, false)
- if pfive < 0 or pfive > 0 then
- pfive = readMemory(pthree + id * 20, 4, false)
- if pfive == 1273 or pfive == 19524 then
- x = getStructFloatElement(pthree + id * 20, 8, false)
- y = getStructFloatElement(pthree + id * 20, 12, false)
- z = getStructFloatElement(pthree + id * 20, 16, false)
- positionX, positionY, positionZ = getCharCoordinates(PLAYER_PED)
- distance = getDistanceBetweenCoords3d(x, y, z, positionX, positionY, positionZ)
- if SsSound.v == true and Sound.v == true then
- bass.BASS_ChannelStop(radio)
- bass.BASS_ChannelPlay(radio, false)
- SsSound.v = false
- end
- if distance <= 50 then
- SletText2 = 'Найден свободный дом. Нажмите {FF0000}1 {FFFFFF} для покупки'
- if not sampIsChatInputActive() and not sampIsDialogActive() and not isSampfuncsConsoleActive() and isPlayerPlaying(playerHandle) and isKeyDown(49) == true then
- while isKeyDown(49) == true do wait(0) end
- Fafk.v = false
- Buy = true
- z = z - 1.7
- if Evicting.v == true then
- sampSendChat('/evicting')
- end
- Psync = true
- local data = samp_create_sync_data('player')
- data.position.x = x
- data.position.y = y
- data.position.z = z
- data.send()
- if isCharInAnyCar(PLAYER_PED) then
- warpCharFromCarToCoord(PLAYER_PED, x, y, z)
- else
- setCharCoordinates(PLAYER_PED, x, y, z)
- end
- Psync = false
- end
- else
- SletText2 = 'Найден свободный дом.'
- end
- renderFontDrawText(font, SletText2, rx/2, 0, 0xffffffff)
- removeBlip(freeh)
- freeh = addSpriteBlipForContactPoint(x, y, z, 31)
- Sprite = true
- end
- end
- end
- end
- for i=0,2048 do
- if sampIs3dTextDefined(i) == true then
- zstring, color, x, y, z, dist, ignoreWalls, playerId, vehicleId = sampGet3dTextInfoById(i)
- positionX, positionY, positionZ = getCharCoordinates(PLAYER_PED)
- distance = getDistanceBetweenCoords3d(x, y, z, positionX, positionY, positionZ)
- if zstring ~= nil then
- if zstring:find('Владелец: {FFFFFF}нет') or zstring:find('Владелец: {FF9900}Нет') then
- if SsSound.v == true and Sound.v == true then
- bass.BASS_ChannelStop(radio)
- bass.BASS_ChannelPlay(radio, false)
- SsSound.v = false
- end
- if distance <= 50 then
- SletText = 'Найден свободный бизнес. Нажмите {FF0000}2 {FFFFFF} для покупки'
- if not sampIsChatInputActive() and not sampIsDialogActive() and not isSampfuncsConsoleActive() and isPlayerPlaying(playerHandle) and isKeyDown(50) == true then
- while isKeyDown(50) == true do wait(0) end
- Fafk.v = false
- Buy = true
- z = z - 1.7
- Psync = true
- local data = samp_create_sync_data('player')
- data.position.x = x
- data.position.y = y
- data.position.z = z
- data.send()
- if isCharInAnyCar(PLAYER_PED) then
- warpCharFromCarToCoord(PLAYER_PED, x, y, z)
- else
- setCharCoordinates(PLAYER_PED, x, y, z)
- end
- Psync = false
- end
- else
- SletText = 'Найден свободный бизнес'
- end
- renderFontDrawText(font, SletText, rx/2, 20, 0xffffffff)
- removeBlip(freeh)
- freeh = addSpriteBlipForContactPoint(x, y, z, 52)
- Sprite = true
- end
- if zstring:find('продается') then
- if distance <= 50 then
- SletText = 'Найдена свободная АЗС. Нажмите {FF0000}3 {FFFFFF} для покупки'
- if not sampIsChatInputActive() and not sampIsDialogActive() and not isSampfuncsConsoleActive() and isPlayerPlaying(playerHandle) and isKeyDown(51) == true then
- while isKeyDown(51) == true do wait(0) end
- Fafk.v = false
- Buy = true
- z = z - 1.7
- y = y + 1
- Psync = true
- local data = samp_create_sync_data('player')
- data.position.x = x
- data.position.y = y
- data.position.z = z
- data.send()
- if isCharInAnyCar(PLAYER_PED) then
- warpCharFromCarToCoord(PLAYER_PED, x, y, z)
- else
- setCharCoordinates(PLAYER_PED, x, y, z)
- end
- Psync = false
- StopFilling = false
- lua_thread.create(function()
- repeat
- sampSendChat('/buyfilling')
- wait(100)
- until StopFilling == true
- end)
- end
- else
- SletText = 'Найдена свободная АЗС'
- end
- renderFontDrawText(font, SletText, rx/2, 40, 0xffffffff)
- removeBlip(freeh)
- freeh = addSpriteBlipForContactPoint(x, y, z, 52)
- Sprite = true
- end
- end
- end
- end
- end
- if not sampIsChatInputActive() and not sampIsDialogActive() and not isSampfuncsConsoleActive() and isPlayerPlaying(playerHandle) then
- if isKeyDown(HouseKey) == true then
- while isKeyDown(HouseKey) == true do
- wait(0)
- end
- StopFilling = true
- HouseCatcher = not HouseCatcher
- if HouseCatcher == true then
- printStringNow('House Catcher ~g~activated', 2000)
- else
- printStringNow('House Catcher ~r~deactivated', 2000)
- end
- end
- end
- if not sampIsChatInputActive() and not sampIsDialogActive() and not isSampfuncsConsoleActive() and isPlayerPlaying(playerHandle) then
- if isKeyDown(BizKey) == true then
- while isKeyDown(BizKey) == true do
- wait(0)
- end
- BusinessCatcher = not BusinessCatcher
- HouseCatcher = false
- StopFilling = true
- if BusinessCatcher == true then
- printStringNow('Business Catcher ~g~activated', 2000)
- else
- bass.BASS_ChannelStop(radio)
- printStringNow('Business Catcher ~r~deactivated', 2000)
- end
- end
- end
- if Indicator.v == true then
- if InfoHouse == 0 then
- if HouseCatcher == true then
- if Tp == true then
- renderFontDrawText(font, 'House Catcher (Телепорт)', 0, 0, 0x6400ff00)
- else
- renderFontDrawText(font, 'House Catcher (Бег)', 0, 0, 0x6400ff00)
- end
- end
- else
- renderFontDrawText(font, 'House Catcher (По инфе)', 0, 0, 0x6400ff00)
- end
- if BusinessCatcher == true then
- if Tp == true then
- renderFontDrawText(font, 'Business Catcher (Телепорт)', 0, 0, 0x6400ff00)
- else
- renderFontDrawText(font, 'Business Catcher (Бег)', 0, 0, 0x6400ff00)
- end
- end
- end
- if HouseCatcher == true then
- positionX, positionY, positionZ = getCharCoordinates(PLAYER_PED)
- bool, object = findAllRandomObjectsInSphere(positionX, positionY, positionZ, 50, true)
- if bool == true then
- modelId = getObjectModel(object)
- if modelId == 1273 or modelId == 19524 then
- Fafk.v = false
- if Evicting.v == true then
- sampSendChat('/evicting')
- end
- bool, x, y, z = getObjectCoordinates(object)
- z = z - 1.7
- HouseCatcher = false
- if Sound.v == true then
- bass.BASS_ChannelStop(radio)
- bass.BASS_ChannelPlay(radio, false)
- end
- Buy = true
- if Tp == true then
- Psync = true
- local data = samp_create_sync_data('player')
- data.position.x = x
- data.position.y = y
- data.position.z = z
- data.send()
- if isCharInAnyCar(PLAYER_PED) then
- warpCharFromCarToCoord(PLAYER_PED, x, y, z)
- else
- setCharCoordinates(PLAYER_PED, x, y, z)
- end
- Psync = false
- else
- if isCharInAnyCar(PLAYER_PED) then
- setGameKeyState(15,255)
- end
- taskGoStraightToCoord(PLAYER_PED, x, y, z, 7, 5000)
- repeat
- wait(0)
- setGameKeyState(1,128)
- setGameKeyState(16,255)
- until locateCharAnyMeans2d(PLAYER_PED, x, y, z, 0.5, false) or Buy == false
- end
- end
- end
- end
- if BusinessCatcher == true then
- for i=0,2048 do
- if sampIs3dTextDefined(i) == true then
- zstring, color, x, y, z, dist, ignoreWalls, playerId, vehicleId = sampGet3dTextInfoById(i)
- if zstring:find('Владелец: {FFFFFF}нет') or zstring:find('Владелец: {FF9900}Нет') then
- positionX, positionY, positionZ = getCharCoordinates(PLAYER_PED)
- distance = getDistanceBetweenCoords3d(x, y, z, positionX, positionY, positionZ)
- z = z - 1.7
- if distance <= 50 then
- Fafk.v = false
- BusinessCatcher = false
- if Sound.v == true then
- bass.BASS_ChannelStop(radio)
- bass.BASS_ChannelPlay(radio, false)
- end
- Buy = true
- if Tp == true then
- Psync = true
- local data = samp_create_sync_data('player')
- data.position.x = x
- data.position.y = y
- data.position.z = z
- data.send()
- if isCharInAnyCar(PLAYER_PED) then
- warpCharFromCarToCoord(PLAYER_PED, x, y, z)
- else
- setCharCoordinates(PLAYER_PED, x, y, z)
- end
- Psync = false
- else
- if isCharInAnyCar(PLAYER_PED) then
- setGameKeyState(15,255)
- end
- taskGoStraightToCoord(PLAYER_PED, x, y, z, 7, 5000)
- repeat
- wait(0)
- setGameKeyState(1,128)
- setGameKeyState(16,255)
- until locateCharAnyMeans2d(PLAYER_PED, x, y, z, 0.5, false) or Buy == false
- end
- end
- end
- if zstring:find('продается') then
- positionX, positionY, positionZ = getCharCoordinates(PLAYER_PED)
- distance = getDistanceBetweenCoords3d(x, y, z, positionX, positionY, positionZ)
- z = z - 2
- if distance <= 50 then
- Fafk.v = false
- if distance > 3 then
- y = y + 1
- Psync = true
- local data = samp_create_sync_data('player')
- data.position.x = x
- data.position.y = y
- data.position.z = z
- data.send()
- if isCharInAnyCar(PLAYER_PED) then
- warpCharFromCarToCoord(PLAYER_PED, x, y, z)
- else
- setCharCoordinates(PLAYER_PED, x, y, z)
- end
- Psync = false
- end
- if Sound.v == true then
- bass.BASS_ChannelStop(radio)
- bass.BASS_ChannelPlay(radio, false)
- end
- Buy = true
- StopFilling = false
- lua_thread.create(function()
- repeat
- sampSendChat('/buyfilling')
- wait(100)
- until StopFilling == true
- end)
- end
- end
- end
- end
- end
- if sampIsDialogActive() == true and CloseD == true then
- wait(100)
- sampCloseCurrentDialogWithButton(0)
- CloseD = false
- end
- end
- end
- function hcatch()
- if InfoHouse == 0 then
- InfoHouse = 1
- sampAddChatMessage("[Catcher] Встаньте на пикап дома", 0xffffff)
- else
- InfoHouse = 0
- sampAddChatMessage("[Catcher] Скрипт остановлен", 0xffffff)
- removeBlip(checkpoint)
- end
- end
- function tcatch()
- if TaxiCatch == 0 then
- TaxiCatch = 1
- sampAddChatMessage("[Catcher] Скрипт запушен", 0xffffff)
- Buy = true
- else
- TaxiCatch = 0
- Buy = false
- sampAddChatMessage("[Catcher] Скрипт остановлен", 0xffffff)
- end
- end
- function sampev.onDestroyPickup(id)
- if id == pickupId and InfoHouse > 0 then
- InfoHouse = 4
- end
- end
- function sampev.onCreatePickup(id,model,pickupType,pos)
- if HouseCatcher == true then
- if model == 1273 or model == 19524 then
- positionX, positionY, positionZ = getCharCoordinates(PLAYER_PED)
- distance = getDistanceBetweenCoords3d(pos.x, pos.y, pos.z, positionX, positionY, positionZ)
- if distance <= 50 then
- Fafk.v = false
- x = pos.x
- y = pos.y
- z = pos.z - 2
- Buy = true
- if Evicting.v == true then
- sampSendChat('/evicting')
- end
- if Tp == true then
- Psync = true
- local data = samp_create_sync_data('player')
- data.position.x = x
- data.position.y = y
- data.position.z = z
- data.send()
- if isCharInAnyCar(PLAYER_PED) then
- warpCharFromCarToCoord(PLAYER_PED, x, y, z)
- else
- setCharCoordinates(PLAYER_PED, x, y, z)
- end
- Psync = false
- end
- end
- end
- end
- end
- function sampev.onServerMessage(color, text)
- if text:find('Этот бизнес уже кто-то купил.') and not text:find('_') and Buy == true then
- BusinessCatcher = false
- Buy = false
- end
- if text:find('Поздравляем, Вы')and color == 866792362 and Aoff.v == true then
- sampDisconnectWithReason(1)
- end
- end
- function sampev.onSendPlayerSync(data)
- if Psync == true or Fafk.v == true then
- return false
- end
- end
- function sampev.onSendVehicleSync(data)
- if Fafk.v == true then
- return false
- end
- end
- function sampev.onCreate3DText(id,color,pos,dist,tst,attachedPlayerId,attachedVehicleId,text)
- if BusinessCatcher == true then
- if zstring ~= nil then
- if text:find('Владелец: {FFFFFF}нет') or text:find('Владелец: {FF9900}Нет') then
- positionX, positionY, positionZ = getCharCoordinates(PLAYER_PED)
- distance = getDistanceBetweenCoords3d(pos.x, pos.y, pos.z, positionX, positionY, positionZ)
- if distance <= 50 then
- Fafk.v = false
- x = pos.x
- y = pos.y
- z = pos.z - 2
- Buy = true
- if Tp == true then
- Psync = true
- local data = samp_create_sync_data('player')
- data.position.x = x
- data.position.y = y
- data.position.z = z
- data.send()
- if isCharInAnyCar(PLAYER_PED) then
- warpCharFromCarToCoord(PLAYER_PED, x, y, z)
- else
- setCharCoordinates(PLAYER_PED, x, y, z)
- end
- Psync = false
- end
- end
- end
- end
- end
- end
- function sampev.onShowDialog(id, style, title, btn, btn2, Dtext)
- if Buy == true then
- if Dtext:find('продается') and btn:find('Купить') then
- if not Dtext:find('заправ') then
- sampSendDialogResponse(id, 1, -1, '')
- bass.BASS_ChannelStop(radio)
- bass.BASS_ChannelPlay(radio, false)
- Buy = false
- TaxiCatch = 0
- return false
- end
- end
- if title:find('Частный дом') or title:find('Квартира') then
- if btn:find('Купить') then
- sampSendDialogResponse(id, 1, -1, '')
- if Tp == true then
- return false
- else
- CloseD = true
- end
- end
- end
- if Dtext:find('Вы действительно хотите купить этот дом') then
- Buy = false
- sampSendDialogResponse(id, 1, -1, '')
- if Tp == true then
- return false
- else
- CloseD = true
- end
- end
- if Dtext:find('Вы действительно хотите купить эту квартиру') then
- Buy = false
- sampSendDialogResponse(id, 1, -1, '')
- if Tp == true then
- return false
- else
- CloseD = true
- end
- end
- if Dtext:find('Этот бизнес продается') and btn2:find('Купить') then
- sampSendDialogResponse(id, 0, -1, '')
- if Tp == true then
- return false
- else
- CloseD = true
- end
- end
- if Dtext:find('Вы действительно хотите купить этот бизнес') and btn2:find('Да') then
- Buy = false
- sampSendDialogResponse(id, 0, -1, '')
- if Tp == true then
- return false
- else
- CloseD = true
- end
- end
- if title:find('станция') and btn:find('Купить') then
- StopFilling = true
- BusinessCatcher = false
- sampSendDialogResponse(id, 1, -1, '')
- print('test')
- if Tp == true then
- return false
- else
- CloseD = true
- end
- Buy = false
- end
- if Dtext:find('отель продается') and btn:find('Да') then
- sampSendDialogResponse(id, 1, -1, '')
- if Tp == true then
- return false
- else
- CloseD = true
- end
- end
- if Dtext:find('Вы действительно хотите купить этот отель') then
- Buy = false
- sampSendDialogResponse(id, 1, -1, '')
- if Tp == true then
- return false
- else
- CloseD = true
- end
- end
- end
- end
- function menu()
- main_window_state.v = not main_window_state.v
- imgui.Process = main_window_state.v
- if main_window_state.v == true then
- imgui.ShowCursor = true
- else
- imgui.ShowCursor = false
- end
- end
- function sphere()
- removeSphere(sphere)
- local ChatCMD = sampGetChatInputText()
- radius = ChatCMD:match('%d+')
- if radius ~= nil then
- radius = tonumber(radius)
- if radius > 0 then
- positionX, positionY, positionZ = getCharCoordinates(PLAYER_PED)
- sphere = addSphere(positionX, positionY, positionZ, radius*2)
- printStringNow('Sphere ~g~created', 2000)
- else
- printStringNow('Sphere ~r~deleted', 2000)
- end
- else
- printStringNow('Sphere ~r~deleted', 2000)
- end
- end
- function imgui.OnDrawFrame()
- if main_window_state.v == false then
- imgui.ShowCursor = false
- end
- if main_window_state.v then
- imgui.SetNextWindowSize(imgui.ImVec2(200, 420), imgui.Cond.FirstUseEver)
- imgui.SetNextWindowPos(imgui.ImVec2(rx-220, ry/2-210), imgui.Cond.FirstUseEver)
- imgui.Begin('DRP Catcher - by westwow', main_window_state, imgui.WindowFlags.NoCollapse + imgui.WindowFlags.NoResize)
- imgui.Text(u8'Клавиши:')
- imgui.Separator()
- imgui.Text(u8'Ловля домов:')
- imgui.SameLine(160.0, 0.0)
- if imgui.Button(u8(string.format('%d',HouseKey)), imgui.ImVec2(30, 20)) then
- keyh_window_state.v = true
- keyb_window_state.v = false
- input_int_data.v = HouseKey
- end
- imgui.Text(u8'Ловля бизнесов:')
- imgui.SameLine(160.0, 0.0)
- if imgui.Button(u8(string.format('%d',BizKey)), imgui.ImVec2(30, 20)) then
- keyb_window_state.v = true
- keyh_window_state.v = false
- input_int_data.v = BizKey
- end
- imgui.Text(u8'Режим:')
- imgui.Separator()
- if imgui.RadioButton(u8'Телепорт', Tp) then
- Tp = true
- Beg = false
- end
- if imgui.RadioButton(u8'Бег', Beg) then
- Tp = false
- Beg = true
- end
- imgui.Text(u8'Настройки:')
- imgui.Separator()
- imgui.Checkbox(u8'Автовыселение', Evicting)
- imgui.Checkbox(u8'Поиск имущества в стриме', Visible)
- imgui.Checkbox(u8'+ звук', SsSound)
- imgui.Checkbox(u8'Звуковое оповещение', Sound)
- imgui.Checkbox(u8'Индикатор(слева сверху)', Indicator)
- imgui.Separator()
- if imgui.Checkbox(u8'Фейк афк', Fafk) then
- AFKrand = math.random(300, 1200)
- AFKtimer = os.time()
- end
- imgui.Checkbox(u8'Авто дисконект', Aoff)
- if imgui.Checkbox(u8'Работа в свернутом режиме', Swork) then
- WorkInBackground(Swork.v)
- end
- imgui.Spacing()
- imgui.Spacing()
- imgui.Spacing()
- imgui.SameLine(30.0, 0.0)
- if imgui.Button(u8'Сохранить настройки', imgui.ImVec2(150, 20)) then
- local newData = {
- Keys = {
- House = HouseKey,
- Business = BizKey
- },
- Settings = {
- Tp = Tp,
- Beg = Beg,
- Evicting = Evicting.v,
- Sound = Sound.v,
- Indication = Indicator.v,
- StreamSnipe = Visible.v
- }
- }
- if inicfg.save(newData, "Catcher") then
- main_window_state.v = not main_window_state.v
- imgui.Process = main_window_state.v
- imgui.ShowCursor = false
- end
- end
- imgui.End()
- end
- if keyh_window_state.v then
- imgui.SetNextWindowSize(imgui.ImVec2(170, 100), imgui.Cond.FirstUseEver) -- меняем размер
- imgui.SetNextWindowPos(imgui.ImVec2(rx/2-135, ry/2-50), imgui.Cond.FirstUseEver)
- imgui.Begin(u8'Настройка клавиши', true, imgui.WindowFlags.NoCollapse + imgui.WindowFlags.NoResize)
- imgui.Text(u8'Введите номер клавиши')
- imgui.InputInt('', input_int_data, 0, 0)
- if imgui.IsWindowAppearing() then
- imgui.SetKeyboardFocusHere(-1)
- end
- if imgui.Button(u8'Сохранить') then
- keyh_window_state.v = false
- if input_int_data.v < 250 and input_int_data.v > 0 then
- HouseKey = input_int_data.v
- end
- end
- if not sampIsChatInputActive() and not sampIsDialogActive() and not isSampfuncsConsoleActive() and isPlayerPlaying(playerHandle) then
- if isKeyDown(13) == true then
- keyh_window_state.v = false
- if input_int_data.v < 250 and input_int_data.v > 0 then
- HouseKey = input_int_data.v
- end
- end
- end
- imgui.End()
- end
- if keyb_window_state.v then
- imgui.SetNextWindowSize(imgui.ImVec2(170, 100), imgui.Cond.FirstUseEver) -- меняем размер
- imgui.SetNextWindowPos(imgui.ImVec2(rx/2-135, ry/2-50), imgui.Cond.FirstUseEver)
- imgui.Begin(u8'Настройка клавиши', true, imgui.WindowFlags.NoCollapse + imgui.WindowFlags.NoResize)
- imgui.Text(u8'Введите номер клавиши')
- imgui.InputInt('', input_int_data, 0, 0)
- if imgui.IsWindowAppearing() then
- imgui.SetKeyboardFocusHere(-1)
- end
- if imgui.Button(u8'Сохранить') then
- keyb_window_state.v = false
- BizKey = input_int_data.v
- end
- if not sampIsChatInputActive() and not sampIsDialogActive() and not isSampfuncsConsoleActive() and isPlayerPlaying(playerHandle) then
- if isKeyDown(13) == true then
- keyb_window_state.v = false
- BizKey = input_int_data.v
- end
- end
- imgui.End()
- end
- end
- function samp_create_sync_data(sync_type, copy_from_player)
- 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
- function async_http_request(method, url, args, resolve, reject)
- local request_lane = lanes.gen('*', {package = {path = package.path, cpath = package.cpath}}, function()
- local requests = require 'requests'
- local ok, result = pcall(requests.request, method, url, args)
- if ok then
- result.json, result.xml = nil, nil
- return true, result
- else
- return false, result
- end
- end)
- if not reject then reject = function() end end
- lua_thread.create(function()
- local lh = request_lane()
- while true do
- local status = lh.status
- if status == 'done' then
- local ok, result = lh[1], lh[2]
- if ok then resolve(result) else reject(result) end
- return
- elseif status == 'error' then
- return reject(lh[1])
- elseif status == 'killed' or status == 'cancelled' then
- return reject(status)
- end
- wait(0)
- end
- end)
- end
- function download_handler(id, status, p1, p2)
- if status == dlstatus.STATUS_ENDDOWNLOADDATA then
- RegFileD = true
- end
- end
- function WorkInBackground(work)
- local memory = require 'memory'
- if work then
- memory.setuint8(7634870, 1)
- memory.setuint8(7635034, 1)
- memory.fill(7623723, 144, 8)
- memory.fill(5499528, 144, 6)
- else
- memory.setuint8(7634870, 0)
- memory.setuint8(7635034, 0)
- memory.hex2bin('5051FF1500838500', 7623723, 8)
- memory.hex2bin('0F847B010000', 5499528, 6)
- end
- end
Add Comment
Please, Sign In to add comment