function getConfigListNames()
local configListNames = {}
for k, config in pairs(configs) do
table.insert(configListNames, config.name)
end
return configListNames
end
function loadSettings()
local date = os.date('*t')
local dir = getWorkingDirectory() .. '/config/bypasser/'
local ini = inicfg.load(nil, dir .. 'settings.ini')
selectedConfig.v = ini.settings.selectedConfig
disableSnowForeverV = ini.settings.disableThisShitSnowfall
snowEnabled = not disableSnowForeverV and ((date.month == 12 and date.day >= 24) or (date.month == 1 and date.day <= 7))
preConfig = selectedConfig.v
if selectedConfig.v > table.getn(configs) - 1 then
selectedConfig.v = 0
end
setConfig(getConfigByIndex(selectedConfig.v).name)
end
function loadConfigs()
local dir = getWorkingDirectory() .. '/config/bypasser'
dir = getWorkingDirectory() .. '/config/bypasser/configs'
local handle, name = findFirstFile(dir .. '/*.json')
while name do
if handle then
if not name then
findClose(name)
else
loadConfig(name)
name = findNextFile(handle)
end
end
end
if table.getn(configs) == 0 then
local config = createConfig('Default')
saveConfig(config)
end
end
function convertTableToJsonString(data)
return (neatJSON(data, {sort = true, wrap = 40}))
end
function setConfig(name)
-- sampAddChatMessage('set: ' .. name, -1)
local config = getConfig(name)
if config ~= nil then
disableAllNops()
settingsSaveNops.v = config.settings.saveNops
settingsSaveSend.v = config.settings.saveSend
settingsSaveLog.v = config.settings.saveLog
settingsSaveBrute.v = config.settings.saveBrute
settingsSaveAnother.v = config.settings.saveAnother
local nops = config.settings.nops.enabled
for k, nop in pairs(nops) do
if nop:find('##incomingPacket', 1, true) then
for j, packet in pairs(data.packets.incoming) do
if nop:find(packet.name, 1, true) then
packet.isNopped = true
break
end
end
end
if nop:find('##incomingRPC', 1, true) then
for j, packet in pairs(data.rpc.incoming) do
if nop:find(packet.name, 1, true) then
packet.isNopped = true
break
end
end
end
if nop:find('##outcomingPacket', 1, true) then
for j, packet in pairs(data.packets.outcoming) do
if nop:find(packet.name, 1, true) then
packet.isNopped = true
break
end
end
end
if nop:find('##outcomingRPC', 1, true) then
for j, packet in pairs(data.rpc.outcoming) do
if nop:find(packet.name, 1, true) then
sampAddChatMessage('nopped', -1)
packet.isNopped = true
break
end
end
end
end
nopFilerBox.v = config.settings.nops.filter
sendInterior.v = config.settings.send.interior
sendPickup.v = config.settings.send.pickupId
sendTextdraw.v = config.settings.send.textdrawId
sendConvertOnfootToSpectator.v = config.settings.send.convertOnfootToSpectator
sendRC.v = config.settings.send.sendRC == nil and 0 or config.settings.send.sendRC
logRenderPickups.v = config.settings.log.renderPickups
logRenderTextdraws.v = config.settings.log.renderTextdraws
logPickedUpPickups.v = config.settings.log.logPickups
logClickedTextdraws.v = config.settings.log.logTextdraws
bruteMin.v = config.settings.brute.min
bruteMax.v = config.settings.brute.max
bruteDelay.v = config.settings.brute.delay
bruteFilterBox.v = config.settings.brute.filter
anotherRandomAmmo.v = config.settings.another.randomAmmo
anotherAmmoAmount.v = config.settings.another.ammo
anotherSelectedWeapon.v = config.settings.another.selectedWeapon
settingsSelectedTheme.v = config.settings.selectedTheme
menuPos.x, menuPos.y = config.windows.main.x, config.windows.main.y
nopsMenu.v = config.windows.nops.active
nopsMenuPos.x, nopsMenuPos.y = config.windows.nops.x, config.windows.nops.y
sendMenu.v = config.windows.send.active
sendMenuPos.x, sendMenuPos.y = config.windows.send.x, config.windows.send.y
logMenu.v = config.windows.log.active
logMenuPos.x, logMenuPos.y = config.windows.log.x, config.windows.log.y
bruteMenu.v = config.windows.brute.active
bruteMenuPos.x, bruteMenuPos.y = config.windows.brute.x, config.windows.brute.y
anotherMenu.v = config.windows.another.active
anotherMenuPos.x, anotherMenuPos.y = config.windows.another.x, config.windows.another.y
configMenu.v = config.windows.configs.active
configMenuPos.x, configMenuPos.y = config.windows.configs.x, config.windows.configs.y
settingsMenu.v = config.windows.settings.active
settingsMenuPos.x, settingsMenuPos.y = config.windows.settings.x, config.windows.settings.y
settingsShowMenuCode.v = config.settings.codes.showMenu
settingsHideCursorCode.v = config.settings.codes.hideCursor
setTheme(settingsSelectedTheme.v)
needsInit = 1
end
end
function getConfigByIndex(index)
return configs[index + 1]
end
function isConfigNameAvailable(name)
for k, config in pairs(configs) do
if rusLower(config.name):lower() == rusLower(name):lower() then
return false
end
end
return true
end
function getConfig(name)
for k, config in pairs(configs) do
if config.name == name then
return config
end
end
return nil
end
function loadConfig(fileName)
local dir = getWorkingDirectory() .. '/config/bypasser/configs/'
local f = io.open(dir .. fileName, 'r')
local jsonData = f:read('*a')
f:close()
local config = decodeJson(jsonData)
table.insert(configs, config)
end
function deleteConfig(index)
local dir = getWorkingDirectory() .. '/config/bypasser/configs/'
local configName = configs[index + 1].name
table.remove(configs, index + 1)
os.remove(dir .. u8:decode(configName) .. '.json')
end
function updateConfig(name)
local config = getConfig(name)
if config ~= nil then
config.settings.saveNops = settingsSaveNops.v
config.settings.saveSend = settingsSaveSend.v
config.settings.saveLog = settingsSaveLog.v
config.settings.saveBrute = settingsSaveBrute.v
config.settings.saveAnother = settingsSaveAnother.v
if settingsSaveNops.v then
config.settings.nops.enabled = getNoppedPackets()
config.settings.nops.filter = nopFilerBox.v
end
if settingsSaveSend.v then
config.settings.send.interior = sendInterior.v
config.settings.send.pickupId = sendPickup.v
config.settings.send.sendRC = sendRC.v
config.settings.send.textdrawId = sendTextdraw.v
config.settings.send.convertOnfootToSpectator = sendConvertOnfootToSpectator.v
end
if settingsSaveLog.v then
config.settings.log.renderPickups = logRenderPickups.v
config.settings.log.renderTextdraws = logRenderTextdraws.v
config.settings.log.logPickups = logPickedUpPickups.v
config.settings.log.logTextdraws = logClickedTextdraws.v
end
if settingsSaveBrute.v then
config.settings.brute.min = bruteMin.v
config.settings.brute.max = bruteMax.v
config.settings.brute.delay = bruteDelay.v
config.settings.brute.filter = bruteFilterBox.v
end
if settingsSaveAnother.v then
config.settings.another.randomAmmo = anotherRandomAmmo.v
config.settings.another.ammo = anotherAmmoAmount.v
config.settings.another.selectedWeapon = anotherSelectedWeapon.v
end
config.settings.selectedTheme = settingsSelectedTheme.v
config.settings.codes.showMenu = settingsShowMenuCode.v
config.settings.codes.hideCursor = settingsHideCursorCode.v
config.windows.main.x, config.windows.main.y = menuPos.x, menuPos.y
config.windows.nops.active = nopsMenu.v
config.windows.nops.x, config.windows.nops.y = nopsMenuPos.x, nopsMenuPos.y
config.windows.send.active = sendMenu.v
config.windows.send.x, config.windows.send.y = sendMenuPos.x, sendMenuPos.y
config.windows.log.active = logMenu.v
config.windows.log.x, config.windows.log.y = logMenuPos.x, logMenuPos.y
config.windows.brute.active = bruteMenu.v
config.windows.brute.x, config.windows.brute.y = bruteMenuPos.x, bruteMenuPos.y
config.windows.another.active = anotherMenu.v
config.windows.another.x, config.windows.another.y = anotherMenuPos.x, anotherMenuPos.y
config.windows.configs.active = configMenu.v
config.windows.configs.x, config.windows.configs.y = configMenuPos.x, configMenuPos.y
config.windows.settings.active = settingsMenu.v
config.windows.settings.x, config.windows.settings.y = settingsMenuPos.x, settingsMenuPos.y
end
end
function saveConfig(config)
local dir = getWorkingDirectory() .. '/config/bypasser/configs'
local jsonData = convertTableToJsonString(config)
local f = io.open(dir .. '/' .. u8:decode(config.name) .. '.json', 'w')
f:write(jsonData)
f:close()
end
function createConfig(name)
local xw, yw = getScreenResolution()
local config = {
name = name,
settings = {
nops = {
enabled = {},
filter = ''
},
send = {
interior = 0,
pickupId = 0,
textdrawId = 0,
convertOnfootToSpectator = false
},
log = {
renderPickups = false,
renderTextdraws = false,
logPickups = false,
logTextdraws = false
},
brute = {
min = 1,
max = 1000,
delay = 100,
filter = ''
},
another = {
randomAmmo = false,
ammo = 1000,
selectedWeapon = 0
},
codes = {
showMenu = 'BP',
hideCursor = 'BC'
},
saveNops = false,
saveSend = false,
saveLog = false,
saveBrute = false,
saveAnother = false,
selectedTheme = 0,
},
windows = {
main = {
active = false,
x = xw / 2,
y = yw / 2
},
nops = {
active = false,
x = xw / 2,
y = yw / 2
},
send = {
active = false,
x = xw / 2,
y = yw / 2
},
log = {
active = false,
x = xw / 2,
y = yw / 2
},
brute = {
active = false,
x = xw / 2,
y = yw / 2
},
another = {
active = false,
x = xw / 2,
y = yw / 2
},
configs = {
active = false,
x = xw / 2,
y = yw / 2
},
settings = {
active = false,
x = xw / 2,
y = yw / 2
}
}
}
table.insert(configs, config)
return config
end
function brute()
bruteMode = bruteSelectedRpc.v
if bruteMin.v > bruteMax.v then
local t = bruteMin.v
bruteMin.v = bruteMax.v
bruteMax.v = t
end
for i = bruteMin.v, bruteMax.v do
while brutePaused do
wait(0)
end
if not bruteEnabled then
break
end
bruteCurrent = i
if bruteMode == 0 then
sampSendClickTextdraw(bruteCurrent)
end
if bruteMode == 1 then
sampSendPickedUpPickup(bruteCurrent)
end
if bruteMode == 2 then
sampRequestClass(bruteCurrent)
end
wait(bruteDelay.v)
end
bruteEnabled = false
end
function bruteGetFilteredString()
local filter = bruteFilterBox.v
bruteFilteredBox.v = ''
if filter ~= '' then
local lines = split(bruteBox.v, '\n')
for k, v in pairs(lines) do
if v:lower():find(filter:lower(), 1, true) then
bruteFilteredBox.v = bruteFilteredBox.v .. v .. '\n'
end
end
else
bruteFilteredBox.v = bruteBox.v
end
return bruteFilteredBox
end
function bruteAddLog(text)
bruteBox.v = bruteBox.v .. '[ID: ' .. bruteCurrent .. '] - ' .. text .. '\n'
end
function main()
repeat wait(0) until isSampAvailable()
while not sapi.GetIsAvailable() do wait(0) end
if sampGetGamestate() == 3 then
server.ip, server.port = sampGetCurrentServerAddress()
for pickupId = 1, 4096 do
local pickup = sampGetPickupHandleBySampId(pickupId)
if pickup ~= nil then
local x, y, z = getPickupCoordinates(pickup)
table.insert(pickups, {id = pickupId, pos = {x = x, y = y, z = z}})
end
end
end
for k, v in pairs(sf) do
local packet = {name = k, id = v, isNopped = false}
if k:find('PACKET_', 1, true) then
table.insert(data.packets.outcoming, packet)
table.insert(data.packets.incoming, clone(packet))
elseif k:find('RPC_SCR', 1, true) then
table.insert(data.rpc.incoming, packet)
elseif k:find('RPC_', 1, true) then
table.insert(data.rpc.outcoming, packet)
end
end
loadConfigs()
loadSettings()
table.sort(data.packets.outcoming, function(a, b) return a.name:upper() < b.name:upper() end)
table.sort(data.packets.incoming, function(a, b) return a.name:upper() < b.name:upper() end)
table.sort(data.rpc.incoming, function(a, b) return a.name:upper() < b.name:upper() end)
table.sort(data.rpc.outcoming, function(a, b) return a.name:upper() < b.name:upper() end)
lua_thread.create(function()
while true do
wait(500)
local gamestate = sampGetGamestate()
if sendGamestate.v ~= gamestate then
sendGamestate.v = gamestate
end
end
end)
if snowEnabled then lua_thread.create(SnowAI) end
while true do
wait(0)
if snowEnabled then renderSnow() end
imgui.Process = menuActive.v
if preMenuActive ~= menuActive.v then
preMenuActive = menuActive.v
if not preMenuActive then
local dir = getWorkingDirectory() .. '/config/bypasser/'
--sampAddChatMessage('saving...', -1)
updateConfig(getConfigByIndex(selectedConfig.v).name)
saveConfig(getConfigByIndex(selectedConfig.v))
local ini = inicfg.save({
settings = {
selectedConfig = selectedConfig.v,
disableThisShitSnowfall=disableSnowForeverV
}
}, dir .. 'settings.ini')
end
end
if imgui.Process then
imgui.ShowCursor = not menuHideCursor.v
end
if testCheat(settingsShowMenuCode.v) then
menuActive.v = not menuActive.v
end
if testCheat(settingsHideCursorCode.v) then
menuHideCursor.v = not menuHideCursor.v
end
if logRenderPickups.v then
local x, y, z = getCharCoordinates(PLAYER_PED)
for k, pickup in pairs(pickups) do
local pos = pickup.pos
if isPointOnScreen(pos.x, pos.y, pos.z, 0) then
if getDistanceBetweenCoords3d(x, y, z, pos.x, pos.y, pos.z) <= 1000 then
local pxw, pyw = convert3DCoordsToScreen(pos.x, pos.y, pos.z)
local xw, yw = convert3DCoordsToScreen(x, y, z)
renderDrawLine(xw, yw, pxw, pyw, 1, getActualTheme()[3])
renderFontDrawText(font, 'Pickup: ' .. pickup.id, pxw, pyw, getActualTheme()[3])
end
end
end
end
if logRenderTextdraws.v then
for id = 1, 2048 do
if sampTextdrawIsExists(id) then
local x, y = sampTextdrawGetPos(id)
local xw, yw = convertGameScreenCoordsToWindowScreenCoords(x, y)
renderFontDrawText(font, 'Textdraw: ' .. id, xw, yw, getActualTheme()[3])
end
end
end
end
end