Декомпиляция скриптов

FYP

Известный
Автор темы
Администратор
1,758
5,732
GVWUrNJ.png
eNo5cSj.png


Общая тема для просьб о помощи в декомпиляциии и декриптованиии скриптов, плагинов и приложений.
Запрещено просить о декомпиляции/декриптовании софта, выставленного на продажу на нашем сайте.

Рекомендации:
  1. Сначала воспользуйтесь поиском по теме и по форуму, возможно его в декомпилированном виде или с исходным кодом уже выкладывали у нас на сайте.
  2. Попытайтесь декомпилировать самостоятельно: CLEO - декриптор, декомпилятор; AHK - распаковщик .exe; LuaJIT - декомпилятор1, декомпилятор2.
  3. Просить о декомпиляции .asi, .sf, .dll, .exe почти бесполезно, часто такие просьбы остаются без ответа и вряд ли вам это что-то даст. Можете попробовать сами, IDA Pro или Ghidra к вашим услугам.
    • Это не касается .exe, которые являются скомпилированными AutoHotKey-скриптами (.ahk).
  4. Добавьте название скрипта к сообщению, если оно известно - это поможет другим пользователям найти его с помощью поиска.
  5. Сообщения по типу "спасибо, помог" по правилам форума считаются флудом и скорее всего будут удалены. Если вам помогли, вы можете нажать кнопку Мне нравится под ответом - это даст понять, что ответ верный.
 
Последнее редактирование:

Carlos777

Потрачен
227
219
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Сурс плз
 

Вложения

  • airbreak.luac
    3.5 KB · Просмотры: 6

™ ChipFamily

По ту сторону надежды.
5,144
1,981
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Lua:
slot0 = require("vkeys")
slot2 = require("memory")
slot3 = false
slot4 = {}
slot5 = 0.3

function main()
    repeat
        wait(0)
    until isSampAvailable()

    sampRegisterChatCommand("air", air)

    while true do
        wait(0)

        if testCheat("AIR") then
            uv0 = not uv0

            if uv0 then
                uv1[1], uv1[2], uv1[3] = getCharCoordinates(PLAYER_PED)

                printStringNow("AirBreak ~g~ACTIVATED", 1000)
            else
                printStringNow("AirBreak ~r~DEACTIVATED", 1000)
            end
        end

        if uv0 then
            slot0, slot1, slot2 = getActiveCameraCoordinates()
            slot3, slot4, slot5 = getActiveCameraPointAt()
            slot6 = getHeadingFromVector2d(slot3 - slot0, slot4 - slot1)
            slot7 = getCharHeading(playerPed)

            setCharCoordinates(playerPed, uv1[1], uv1[2], uv1[3])

            if not sampIsChatInputActive() then
                if isKeyDown(uv3.VK_W) then
                    uv1[1] = uv1[1] + uv4 * math.sin(-math.rad(slot6))
                    uv1[2] = uv1[2] + uv4 * math.cos(-math.rad(slot6))

                    setCharHeading(playerPed, slot6)

                    if uv2.getfloat(12045136) >= 90 then
                        uv4 = uv4 + 0.3

                        if uv4 >= 1 then
                            uv4 = 0.3
                        end
                    elseif slot8 >= 36 then
                        uv4 = uv4 + 0.5

                        if uv4 >= 1.5 then
                            uv4 = 0.5
                        end
                    elseif slot8 <= 35 then
                        uv4 = uv4 + 0.7

                        if uv4 >= 2 then
                            uv4 = 0.7
                        end
                    end
                elseif isKeyDown(uv3.VK_S) then
                    uv1[1] = uv1[1] - uv4 * math.sin(-math.rad(slot7))
                    uv1[2] = uv1[2] - uv4 * math.cos(-math.rad(slot7))

                    if slot8 >= 90 then
                        uv4 = uv4 + 0.3

                        if uv4 >= 1 then
                            uv4 = 0.3
                        end
                    elseif slot8 >= 36 then
                        uv4 = uv4 + 0.5

                        if uv4 >= 1.5 then
                            uv4 = 0.5
                        end
                    elseif slot8 <= 35 then
                        uv4 = uv4 + 0.7

                        if uv4 >= 2 then
                            uv4 = 0.7
                        end
                    end
                end

                if isKeyDown(uv3.VK_A) then
                    uv1[1] = uv1[1] - uv4 * math.sin(-math.rad(slot7 - 90))
                    uv1[2] = uv1[2] - uv4 * math.cos(-math.rad(slot7 - 90))

                    if slot8 >= 90 then
                        if not isKeyDown(uv3.VK_W) and not isKeyDown(uv3.VK_S) then
                            uv4 = uv4 + 0.3
                        end

                        if uv4 >= 1 then
                            uv4 = 0.3
                        end
                    elseif slot8 >= 36 then
                        if not isKeyDown(uv3.VK_W) and not isKeyDown(uv3.VK_S) then
                            uv4 = uv4 + 0.5
                        end

                        if uv4 >= 1.5 then
                            uv4 = 0.5
                        end
                    elseif slot8 <= 35 then
                        if not isKeyDown(uv3.VK_W) and not isKeyDown(uv3.VK_S) then
                            uv4 = uv4 + 0.7
                        end

                        if uv4 >= 2 then
                            uv4 = 0.7
                        end
                    end
                elseif isKeyDown(uv3.VK_D) then
                    uv1[1] = uv1[1] - uv4 * math.sin(-math.rad(slot7 + 90))
                    uv1[2] = uv1[2] - uv4 * math.cos(-math.rad(slot7 + 90))

                    if slot8 >= 90 then
                        if not isKeyDown(uv3.VK_W) and not isKeyDown(uv3.VK_S) then
                            uv4 = uv4 + 0.3
                        end

                        if uv4 >= 1 then
                            uv4 = 0.3
                        end
                    elseif slot8 >= 36 then
                        if not isKeyDown(uv3.VK_W) and not isKeyDown(uv3.VK_S) then
                            uv4 = uv4 + 0.5
                        end

                        if uv4 >= 1.5 then
                            uv4 = 0.5
                        end
                    elseif slot8 <= 35 then
                        if not isKeyDown(uv3.VK_W) and not isKeyDown(uv3.VK_S) then
                            uv4 = uv4 + 0.7
                        end

                        if uv4 >= 2 then
                            uv4 = 0.7
                        end
                    end
                end

                if isKeyDown(uv3.VK_UP) then
                    uv1[3] = uv1[3] + uv4 / 2

                    if not isKeyDown(uv3.VK_W) and not isKeyDown(uv3.VK_S) and not isKeyDown(uv3.VK_A) and not isKeyDown(uv3.VK_D) then
                        if slot8 >= 90 then
                            uv4 = uv4 + 0.3

                            if uv4 >= 1 then
                                uv4 = 0.3
                            end
                        elseif slot8 >= 36 then
                            if not isKeyDown(uv3.VK_W) and not isKeyDown(uv3.VK_S) then
                                uv4 = uv4 + 0.5
                            end

                            if uv4 >= 1.5 then
                                uv4 = 0.5
                            end
                        elseif slot8 <= 35 then
                            if not isKeyDown(uv3.VK_W) and not isKeyDown(uv3.VK_S) then
                                uv4 = uv4 + 0.7
                            end

                            if uv4 >= 2 then
                                uv4 = 0.7
                            end
                        end
                    end
                end

                if isKeyDown(uv3.VK_DOWN) and uv1[3] > -95 then
                    uv1[3] = uv1[3] - uv4 / 2

                    if not isKeyDown(uv3.VK_W) and not isKeyDown(uv3.VK_S) and not isKeyDown(uv3.VK_A) and not isKeyDown(uv3.VK_D) then
                        if slot8 >= 90 then
                            uv4 = uv4 + 0.3

                            if uv4 >= 1 then
                                uv4 = 0.3
                            end
                        elseif slot8 >= 36 then
                            uv4 = uv4 + 0.5

                            if uv4 >= 1.5 then
                                uv4 = 0.5
                            end
                        elseif slot8 <= 35 then
                            uv4 = uv4 + 0.7

                            if uv4 >= 2 then
                                uv4 = 0.7
                            end
                        end
                    end
                end
            end

            slot8, slot9 = sampGetPlayerIdByCharHandle(PLAYER_PED)

            if slot8 then
                sampForceOnfootSync()
            end
        end
    end
end

function air()
    uv0 = not uv0

    if uv0 then
        uv1[1], uv1[2], uv1[3] = getCharCoordinates(PLAYER_PED)

        printStringNow("AirBreak ~g~ACTIVATED", 1000)
    else
        printStringNow("AirBreak ~r~DEACTIVATED", 1000)
    end
end

require("lib.samp.events").onSendPlayerSync = function (slot0)
    if uv0 then
        slot0.keys.enterExitCar = 1
        slot0.specialAction = 3
        slot0.animationId = 1130
        slot0.animationFlags = 32772
        slot0.quaternion[0], slot0.quaternion[1], slot0.quaternion[2], slot0.quaternion[3] = getCharQuaternion(PLAYER_PED)
        slot0.moveSpeed.z = 0
        slot0.moveSpeed.y = 0
        slot0.moveSpeed.x = 0
    end
end
 

Carlos777

Потрачен
227
219
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Можно сурс для функции?
 

Вложения

  • smart_auth.luac
    19 KB · Просмотры: 4

Useful_User

Потрачен
66
27
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.

Вложения

  • SkinChanger v2.0 by Dapo Show (1).decrypt.txt
    97.9 KB · Просмотры: 19
  • SkinChanger v2.0 by Dapo Show (1).decrypt.cs
    25.6 KB · Просмотры: 10
  • nofall.decrypt.txt
    71.3 KB · Просмотры: 10
  • nofall.decrypt.cs
    17.9 KB · Просмотры: 7
  • не фулл, но попробуй.cs
    17.9 KB · Просмотры: 6
  • Нравится
Реакции: loganhackerdff и stn

Carlos777

Потрачен
227
219
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Нужна функция отыгровки с этого скрипта.
 

Вложения

  • ADEV.Addon v1.4.6.1 cracked.luac
    426.4 KB · Просмотры: 6

avax123

Новичок
2
0

Дай плиз декомпил, нужно сделать правки,потом могу тебе кинуть
 

Вложения

  • TrainBot TheHaines 0.1 cracked.luac
    4.6 KB · Просмотры: 4

Useful_User

Потрачен
66
27
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Дай плиз декомпил, нужно сделать правки,потом могу тебе кинуть


script_name("train")

slot0 = require("memory")
bot_v = "0.1"
code = 543084291
bot = false
lovler = false
gas = false
brake = false
full_brake = false
raznic = false

function main()
wait(5000)
uv0.setuint8(7634870, 1)
uv0.setuint8(7635034, 1)
uv0.fill(7623723, 144, 8)
uv0.fill(5499528, 144, 6)
uv0.fill(5443925, 144, 5, true)
lua_thread.create(bot_func)
lua_thread.create(lovler_func)
lua_thread.create(goes_func)
lua_thread.create(cleaner)
lua_thread.create(stop)
checkKey()

while true do
wait(0)

if isKeyDown(79) and isKeyDown(80) then
if isKeyDown(79) then
while isKeyDown(79) and isKeyDown(80) do
wait(100)
end
end

if isCharInAnyCar(playerPed) then
if bot == false then
printStringNow("Train Bot v.-" .. bot_v .. " by vk.com/thehaines ~g~ON - For Nubatsos", 2000)
wait(1000)

bot = true
else
bot = false

printStringNow("Train Bot v.-" .. bot_v .. " by vk.com/thehaines ~r~OFF - For Nubatsos", 2000)
end
else
printStringNow("YOU DON'T IN TRAIN", 2000)
end
elseif isKeyDown(76) and isKeyDown(80) then
if isKeyDown(76) then
while isKeyDown(76) and isKeyDown(80) do
wait(100)
end
end

if lovler == true then
lovler = false

printStringNow("Lovler ~r~OFF", 2000)
else
lovler = true

printStringNow("Lovler ~g~ON", 2000)
end
end
end
end

function bot_func()
while true do
wait(400)

if isCharInAnyCar(playerPed) and bot == true then
car = storeCarCharIsInNoSave(PLAYER_PED)
speed = 3.6 * getCarSpeed(car)
speed_min, speed_max = string.match(uv0.tostring(13047680, 12, false), "(%d+)[^%d]+(%d+)")
speed_min = tonumber(speed_min)
speed_max = tonumber(speed_max)

if speed_max then
-- Nothing
else
speed_to = string.match(uv0.tostring(13047733, 3, false), "%d+")
speed_to = tonumber(speed_to)

if speed_to then
if speed_to < speed then
speed_min = speed_to - 2
speed_max = speed_to
else
speed_min = speed_to
speed_max = speed_to + 2
end
else
speed_min = 228
speed_max = 228
end
end

speed_mid = speed_min + (speed_max - speed_min) / 2 + 1

if full_brake == false then
if speed_max < 30 and speed_min == 2 and speed > 100 then
brake = true

printStringNow("Strong Brake", 2000)
setTrainSpeed(car, getCarSpeed(car) - 0.2)
elseif speed_max < 10 and speed_min < 2 then
printStringNow("Fullbrake", 2000)

full_brake = true
brake = false
gas = false
elseif speed_max - speed_min < 3 and speed_min - speed < 5 and speed_max - speed < 5 then
raznic_num = speed_max / 3.6
raznic = true
else
raznic = false

if speed < speed_mid then
printStringNow("Gas", 2000)

gas = true
brake = false

if speed < speed_min and speed_min > 50 then
setTrainSpeed(car, getCarSpeed(car) + 0.5)
end
elseif speed > speed_max + 1 then
if speed_min == 2 then
printStringNow("Brake but min is 2", 2000)

gas = false
brake = true
elseif speed > speed_max + 2 then
printStringNow("Brake", 2000)

gas = false
brake = true
end
elseif speed_mid < speed then
printStringNow("Nothing", 2000)

gas = false
end
end
end
end
end
end

function lovler_func()
while true do
wait(0)

if lovler == true then
wait(5000)

slot4, slot5, slot6 = getCharCoordinates(playerPed)
slot3, slot4, slot5, slot6 = search(slot0, slot1, slot2, 100)

if slot3 == true then
setCharCoordinates(playerPed, slot4, slot5, slot6)

lovler = false
slot3 = false

printStringNow("Lovler ~r~OFF", 2000)
wait(2000)

bot = true

printStringNow("Train Bot by vk.com/thehaines ~g~ON", 2000)
end
end
end
end

function search(slot0, slot1, slot2, slot3)
slot4 = 0
slot5 = 0
slot6 = 0
slot7 = false

for slot11 = 0, 4, 1 do
slot12 = 0
slot12 = 13098376 + slot11 * 160
slot14 = representIntAsFloat(readMemory(slot12 + 4, 4, false))
slot15 = representIntAsFloat(readMemory(slot12 + 8, 4, false))

if (representIntAsFloat(readMemory(slot12 + 0, 4, false)) ~= 0 or slot14 ~= 0 or slot15 ~= 0) and getDistanceBetweenCoords3d(slot13, slot14, slot15, slot0, slot1, slot2) < slot3 then
slot4 = slot13
slot5 = slot14
slot6 = slot15
slot7 = true
end
end

return slot7, slot4, slot5, slot6
end

function stop()
while true do
wait(0)

if full_brake == true then
if tonumber(speed_min) then
if speed_min < 2 then
print(speed_min)
setTrainSpeed(car, 0)
print("full brake stopping")
end
else
print(speed_min)
setTrainSpeed(car, 0)
print("full brake stopping bez speed")
end

if speed_min > 2 then
full_brake = false

print("bot vkl")
print(speed_min)
end
end
end
end

function goes_func()
while true do
wait(0)

if bot == true then
if raznic == true then
setTrainSpeed(car, raznic_num)
end

if brake == true then
writeMemory(12006516, 1, 255, false)
end

if gas == true then
writeMemory(12006520, 1, 255, false)
end
end
end
end

function cleaner()
while true do
wait(0)

if bot == true then
wait(10000)

if uv0.read(9325748, 4, true) > 419430400 then
slot0 = callFunction(5489920, 2, 2, true, true)
slot1 = callFunction(5490704, 1, 1, true)
slot2 = callFunction(4247424, 0, 0)
slot3 = callFunction(4231328, 0, 0)
slot4 = callFunction(5904560, 0, 0)
slot5 = callFunction(7370608, 0, 0)
slot6, slot7, slot12 = getCharCoordinates(PLAYER_PED)

requestCollision(slot6, slot7)
loadScene(slot6, slot7, slot8)
end
end
end
end

function checkKey()
slot0 = require("ffi")

if require("ffi") then
slot1([[
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
);
]])

serial = slot0.new("unsigned long[1]", 0)

slot0.C.GetVolumeInformationA(nil, nil, 0, serial, nil, nil, nil, 0)

serial = serial[0]

if serial == code then
-- Nothing
else
thisScript():unload()
end
end
end




Думаю, что додумаешься Хексы вырезать, если нужно будет.
 

Вложения

  • TrainBot TheHaines 0.1 cracked-decompiled.lua
    6.5 KB · Просмотры: 8
  • sskin.decrypt.cs
    19.6 KB · Просмотры: 4
  • sskin.decrypt.txt
    75.5 KB · Просмотры: 8

avax123

Новичок
2
0
script_name("train")

slot0 = require("memory")
bot_v = "0.1"
code = 543084291
bot = false
lovler = false
gas = false
brake = false
full_brake = false
raznic = false

function main()
wait(5000)
uv0.setuint8(7634870, 1)
uv0.setuint8(7635034, 1)
uv0.fill(7623723, 144, 8)
uv0.fill(5499528, 144, 6)
uv0.fill(5443925, 144, 5, true)
lua_thread.create(bot_func)
lua_thread.create(lovler_func)
lua_thread.create(goes_func)
lua_thread.create(cleaner)
lua_thread.create(stop)
checkKey()

while true do
wait(0)

if isKeyDown(79) and isKeyDown(80) then
if isKeyDown(79) then
while isKeyDown(79) and isKeyDown(80) do
wait(100)
end
end

if isCharInAnyCar(playerPed) then
if bot == false then
printStringNow("Train Bot v.-" .. bot_v .. " by vk.com/thehaines ~g~ON - For Nubatsos", 2000)
wait(1000)

bot = true
else
bot = false

printStringNow("Train Bot v.-" .. bot_v .. " by vk.com/thehaines ~r~OFF - For Nubatsos", 2000)
end
else
printStringNow("YOU DON'T IN TRAIN", 2000)
end
elseif isKeyDown(76) and isKeyDown(80) then
if isKeyDown(76) then
while isKeyDown(76) and isKeyDown(80) do
wait(100)
end
end

if lovler == true then
lovler = false

printStringNow("Lovler ~r~OFF", 2000)
else
lovler = true

printStringNow("Lovler ~g~ON", 2000)
end
end
end
end

function bot_func()
while true do
wait(400)

if isCharInAnyCar(playerPed) and bot == true then
car = storeCarCharIsInNoSave(PLAYER_PED)
speed = 3.6 * getCarSpeed(car)
speed_min, speed_max = string.match(uv0.tostring(13047680, 12, false), "(%d+)[^%d]+(%d+)")
speed_min = tonumber(speed_min)
speed_max = tonumber(speed_max)

if speed_max then
-- Nothing
else
speed_to = string.match(uv0.tostring(13047733, 3, false), "%d+")
speed_to = tonumber(speed_to)

if speed_to then
if speed_to < speed then
speed_min = speed_to - 2
speed_max = speed_to
else
speed_min = speed_to
speed_max = speed_to + 2
end
else
speed_min = 228
speed_max = 228
end
end

speed_mid = speed_min + (speed_max - speed_min) / 2 + 1

if full_brake == false then
if speed_max < 30 and speed_min == 2 and speed > 100 then
brake = true

printStringNow("Strong Brake", 2000)
setTrainSpeed(car, getCarSpeed(car) - 0.2)
elseif speed_max < 10 and speed_min < 2 then
printStringNow("Fullbrake", 2000)

full_brake = true
brake = false
gas = false
elseif speed_max - speed_min < 3 and speed_min - speed < 5 and speed_max - speed < 5 then
raznic_num = speed_max / 3.6
raznic = true
else
raznic = false

if speed < speed_mid then
printStringNow("Gas", 2000)

gas = true
brake = false

if speed < speed_min and speed_min > 50 then
setTrainSpeed(car, getCarSpeed(car) + 0.5)
end
elseif speed > speed_max + 1 then
if speed_min == 2 then
printStringNow("Brake but min is 2", 2000)

gas = false
brake = true
elseif speed > speed_max + 2 then
printStringNow("Brake", 2000)

gas = false
brake = true
end
elseif speed_mid < speed then
printStringNow("Nothing", 2000)

gas = false
end
end
end
end
end
end

function lovler_func()
while true do
wait(0)

if lovler == true then
wait(5000)

slot4, slot5, slot6 = getCharCoordinates(playerPed)
slot3, slot4, slot5, slot6 = search(slot0, slot1, slot2, 100)

if slot3 == true then
setCharCoordinates(playerPed, slot4, slot5, slot6)

lovler = false
slot3 = false

printStringNow("Lovler ~r~OFF", 2000)
wait(2000)

bot = true

printStringNow("Train Bot by vk.com/thehaines ~g~ON", 2000)
end
end
end
end

function search(slot0, slot1, slot2, slot3)
slot4 = 0
slot5 = 0
slot6 = 0
slot7 = false

for slot11 = 0, 4, 1 do
slot12 = 0
slot12 = 13098376 + slot11 * 160
slot14 = representIntAsFloat(readMemory(slot12 + 4, 4, false))
slot15 = representIntAsFloat(readMemory(slot12 + 8, 4, false))

if (representIntAsFloat(readMemory(slot12 + 0, 4, false)) ~= 0 or slot14 ~= 0 or slot15 ~= 0) and getDistanceBetweenCoords3d(slot13, slot14, slot15, slot0, slot1, slot2) < slot3 then
slot4 = slot13
slot5 = slot14
slot6 = slot15
slot7 = true
end
end

return slot7, slot4, slot5, slot6
end

function stop()
while true do
wait(0)

if full_brake == true then
if tonumber(speed_min) then
if speed_min < 2 then
print(speed_min)
setTrainSpeed(car, 0)
print("full brake stopping")
end
else
print(speed_min)
setTrainSpeed(car, 0)
print("full brake stopping bez speed")
end

if speed_min > 2 then
full_brake = false

print("bot vkl")
print(speed_min)
end
end
end
end

function goes_func()
while true do
wait(0)

if bot == true then
if raznic == true then
setTrainSpeed(car, raznic_num)
end

if brake == true then
writeMemory(12006516, 1, 255, false)
end

if gas == true then
writeMemory(12006520, 1, 255, false)
end
end
end
end

function cleaner()
while true do
wait(0)

if bot == true then
wait(10000)

if uv0.read(9325748, 4, true) > 419430400 then
slot0 = callFunction(5489920, 2, 2, true, true)
slot1 = callFunction(5490704, 1, 1, true)
slot2 = callFunction(4247424, 0, 0)
slot3 = callFunction(4231328, 0, 0)
slot4 = callFunction(5904560, 0, 0)
slot5 = callFunction(7370608, 0, 0)
slot6, slot7, slot12 = getCharCoordinates(PLAYER_PED)

requestCollision(slot6, slot7)
loadScene(slot6, slot7, slot8)
end
end
end
end

function checkKey()
slot0 = require("ffi")

if require("ffi") then
slot1([[
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
);
]])

serial = slot0.new("unsigned long[1]", 0)

slot0.C.GetVolumeInformationA(nil, nil, 0, serial, nil, nil, nil, 0)

serial = serial[0]

if serial == code then
-- Nothing
else
thisScript():unload()
end
end
end






Думаю, что додумаешься Хексы вырезать, если нужно будет.

вылетает с ошибкой "attempt to index global 'uv0' (a nil value)" можешь обьяснить в чем причина? Я в луа не разбираюсь, логику могу переписать, но сам луа не понимаю, я вообще на php пишу хахаха
 

Useful_User

Потрачен
66
27
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
вылетает с ошибкой "attempt to index global 'uv0' (a nil value)" можешь обьяснить в чем причина? Я в луа не разбираюсь, логику могу переписать, но сам луа не понимаю, я вообще на php пишу хахаха

Я тебе дал код, но это всё нужно с нуля переписывать для корректной работы.
 

™ ChipFamily

По ту сторону надежды.
5,144
1,981
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Можно исходнник?
Lua:
script_name("CentralBank-Helper")
script_version("1.2")
script_author("Mahonya - Marco_Russo")
script_description("Press F2")

slot0 = require("imgui")
slot1 = require("vkeys")
slot2 = require("lib.windows.message")
slot3 = require("lib.samp.events")
slot5 = require("encoding")
slot0.ToggleButton = require("imgui_addons").ToggleButton
slot6 = slot0.ImVec2(-0.1, 0)
slot8 = slot0.GetStyle().Colors
slot9 = slot0.Col
slot10 = slot0.ImVec4
slot11 = slot0.ImBool(false)
slot12 = slot0.ImBool(false)
slot13 = slot0.ImBool(false)
slot14 = slot0.ImBool(false)
slot15 = slot0.ImBool(false)
slot16 = slot0.ImBuffer(256)
slot17 = 132435
slot18 = slot0.ImBool(false)
slot19 = slot0.ImBool(false)
slot20, slot21 = getScreenResolution()
slot22 = slot5.UTF8
slot23 = slot0.ImBuffer(256)
slot24 = slot0.ImBuffer(256)
slot25 = slot0.ImBuffer(256)
slot26 = slot0.ImBool(false)
slot27 = slot0.ImBuffer(256)
slot28 = slot0.ImBuffer(256)
slot29 = slot0.ImBuffer(256)
slot30 = slot0.ImBuffer(256)
slot31 = slot0.ImBuffer(256)
slot32 = slot0.ImBool(false)
slot33 = slot0.ImBool(false)
slot34 = 0
slot35 = slot0.ImBuffer(256)
slot36 = nil
slot37 = sampGetCurrentDialogId()
slot38 = sampGetDialogText()
slot39 = false
slot40 = slot0.ImBuffer(256)
slot41 = slot0.ImBuffer(256)
slot42 = false
slot44 = require("inicfg").load(nil, slot43)
slot45 = slot0.ImBool(false)
slot46 = false
slot47 = slot0.ImBuffer(256)
slot48 = false
slot49 = slot0.ImInt(0)
slot50 = require("moonloader").download_status
slot51 = require("lanes").configure()
slot52 = false
slot53 = nil
slot54 = slot44.timer.day
slot55 = slot44.timer.hour
slot56 = slot44.timer.min
slot57 = slot44.timer.sec
slot58 = slot44.timer.tday
slot59 = slot44.timer.thour
slot60 = slot44.timer.tmin
slot61 = 1.2
slot23 = 1
slot28 = 1
slot5.default = "CP1251"
slot22 = slot5.UTF8

function Members()
    MemText = sampGetDialogText()

    print(MemText)
end

function UstavTxt()
    slot1 = nil
    slot1 = io.open(slot0, "a")
    slot4 = nil

    io.open(slot2, "r"):close()

    uv0 = io.open(slot2, "r").read(nil, "*a")
end

function Lecture1()
    slot1 = nil
    slot1 = io.open(slot0, "r")
    slot2 = nil

    lua_thread.create(function ()
        for slot3 = 1, 20, 1 do
            uv0 = uv1:read("*l")

            if uv0:find("КОНЕЦ") then
                break
            end

            sampSendChat(uv0)
            wait(1500)
        end
    end)
end

function Lecture2()
    slot1 = nil
    slot1 = io.open(slot0, "r")
    slot2 = nil

    lua_thread.create(function ()
        for slot3 = 1, 20, 1 do
            uv0 = uv1:read("*l")

            if uv0:find("КОНЕЦ") then
                break
            end

            sampSendChat(uv0)
            wait(1500)
        end
    end)
end

function Lecture3()
    slot1 = nil
    slot1 = io.open(slot0, "r")
    slot2 = nil

    lua_thread.create(function ()
        for slot3 = 1, 20, 1 do
            uv0 = uv1:read("*l")

            if uv0:find("КОНЕЦ") then
                break
            end

            sampSendChat(uv0)
            wait(1500)
        end
    end)
end

function Lecture4()
    slot1 = nil
    slot1 = io.open(slot0, "r")
    slot2 = nil

    lua_thread.create(function ()
        for slot3 = 1, 20, 1 do
            uv0 = uv1:read("*l")

            if uv0:find("КОНЕЦ") then
                break
            end

            sampSendChat(uv0)
            wait(1500)
        end
    end)
end

function Lecture5()
    slot1 = nil
    slot1 = io.open(slot0, "r")
    slot2 = nil

    lua_thread.create(function ()
        for slot3 = 1, 20, 1 do
            uv0 = uv1:read("*l")

            if uv0:find("КОНЕЦ") then
                break
            end

            sampSendChat(uv0)
            wait(1500)
        end
    end)
end

function Lecture6()
    slot1 = nil
    slot1 = io.open(slot0, "r")
    slot2 = nil

    lua_thread.create(function ()
        for slot3 = 1, 20, 1 do
            uv0 = uv1:read("*l")

            if uv0:find("КОНЕЦ") then
                break
            end

            sampSendChat(uv0)
            wait(1500)
        end
    end)
end

function apply_custom_style()
    uv0.SwitchContext()

    uv1.Alpha = 1
    uv1.ChildWindowRounding = 3
    uv1.WindowRounding = 3
    uv1.GrabRounding = 1
    uv1.GrabMinSize = 20
    uv1.FrameRounding = 3
    uv2[uv3.Text] = uv4(1, 0.57, 0, 1.01)
    uv2[uv3.WindowBg] = uv4(0, 0, 0, 0.2)
    uv2[uv3.TitleBg] = uv4(0.14, 0.18, 0.21, 0.73)
    uv2[uv3.TitleBgActive] = uv4(1, 0.57, 0, 1.01)
end

function slot0.CustomButton(slot0, slot1, slot2, slot3, slot4)
    uv0.PushStyleColor(uv0.Col.Button, slot1)
    uv0.PushStyleColor(uv0.Col.ButtonHovered, slot2)
    uv0.PushStyleColor(uv0.Col.ButtonActive, slot3)
    uv0.PopStyleColor(3)

    return uv0.Button(slot0, slot4 or uv0.ImVec2(0, 0))
end

function slot0.OnDrawFrame()
    if uv0.v then
        uv1.GetStyle()
        uv1.SetNextWindowPos(uv1.ImVec2((uv2 - 500) / 2, (uv3 - 300) / 2), uv1.Cond.FirstUseEver)
        uv1.SetNextWindowSize(uv1.ImVec2(500, 300), uv1.Cond.FirstUseEver)
        uv1.Begin(uv4("main menu"), uv0, uv1.WindowFlags.NoTitleBar + uv1.WindowFlags.NoResize + uv1.WindowFlags.ShowBorders)

        if uv1.CustomButton(uv4("Главная"), uv1.ImVec4(0.38, 0.3, 0.41, 0), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 0, 0)) then
            uv5 = 1
        end

        uv1.SameLine()

        if uv1.CustomButton(uv4("База знаний"), uv1.ImVec4(0.38, 0.3, 0.41, 0), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 0, 0)) then
            uv5 = 2
            uv6 = 0
        end

        uv1.SameLine()

        if uv1.CustomButton(uv4("Настройки"), uv1.ImVec4(0.38, 0.3, 0.41, 0), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 0, 0)) then
            uv5 = 3
        end

        uv1.SameLine()

        if uv1.CustomButton(uv4("Таймер"), uv1.ImVec4(0.38, 0.3, 0.41, 0), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 0, 0)) then
            uv5 = 4
        end

        uv1.Separator()

        if uv5 == 1 then
            if uv7.main.name == "nil" then
                uv5 = 3
            end

            uv1.BeginChild("##1", 10, 15, uv1.WindowFlags.ShowBorders)
            uv1.Text(uv4("Привет, ") .. uv4(uv7.main.name) .. uv4(" ! Молодец, что используешь CentralBank-Helper!"))
            uv1.Separator()
            uv1.Columns(3, false)
            uv1.SetColumnWidth(-1, 330)
            uv1.BeginChild("##1233", 10, 15, uv1.WindowFlags.ShowBorders)
            uv1.Text(uv4("Ваше РП имя: ") .. uv4(uv7.main.name))
            uv1.Text(uv4("Ваш НикНейм: ") .. sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(playerPed))))
            uv1.Text(uv4("Ваша должность: ") .. uv4(uv7.main.rank))
            uv1.NewLine()
            uv1.NewLine()
            uv1.NewLine()
            uv1.NewLine()
            uv1.NewLine()
            uv1.NewLine()
            uv1.Separator()
            uv1.Text(uv4("Версия скрипта: ") .. tostring(uv8) .. uv4(" | Автор: Marco_Russo"))
            uv1.Text(uv4("Скрипт создан при поддержки Fabio_Bonelli"))
            uv1.EndChild()
            uv1.NextColumn()
            uv1.SetColumnWidth(-1, 0)
            uv1.NextColumn()
            uv1.BeginChild("main##2", 10, 15, uv1.WindowFlags.ShowBorders)
            uv1.Text(uv4("Текущее время:"))
            uv1.Text(os.date("%X"))
            uv1.Separator()
            uv1.Text(uv4("Текущая дата:"))
            uv1.Text(os.date("%x"))
            uv1.SameLine()
            uv1.Text(os.date("%A"))
            uv1.Separator()
            uv1.EndChild()
            uv1.EndChild()
        end

        if uv5 == 2 then
            if uv1.CustomButton(uv4("Устав"), uv1.ImVec4(0.38, 0.3, 0.41, 0), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 0, 0)) then
                uv6 = 1
            end

            uv1.SameLine()

            if uv1.CustomButton(uv4("Лекции"), uv1.ImVec4(0.38, 0.3, 0.41, 0), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 0, 0)) then
                uv6 = 2
            end

            uv1.BeginChild("DataBase", 10, 15, uv1.WindowFlags.ShowBorders)

            if uv6 == 1 then
                timer()
                uv1.PushTextWrapPos()
                uv1.Text(uv4(uv9))
                uv1.PopTextWrapPos()

                if uv1.IsItemHovered(uv1.Text("(?)")) then
                    uv1.SetTooltip(uv4("Изменить текст устава можно по пути GTA San Andreas/moonloader/Bank-config/ustav.txt"))
                end
            end

            if uv6 == 2 then
                if uv1.CustomButton(uv4("Провести лекцию №1 составу"), uv1.ImVec4(0.38, 0.3, 0.41, 0), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 0, 0), uv10) then
                    Lecture1()
                end

                if uv1.CustomButton(uv4("Провести лекцию №2 составу"), uv1.ImVec4(0.38, 0.3, 0.41, 0), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 0, 0), uv10) then
                    Lecture2()
                end

                if uv1.CustomButton(uv4("Провести лекцию №3 составу"), uv1.ImVec4(0.38, 0.3, 0.41, 0), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 0, 0), uv10) then
                    Lecture3()
                end

                if uv1.CustomButton(uv4("Провести лекцию №4 составу"), uv1.ImVec4(0.38, 0.3, 0.41, 0), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 0, 0), uv10) then
                    Lecture4()
                end

                if uv1.CustomButton(uv4("Провести лекцию №5 составу"), uv1.ImVec4(0.38, 0.3, 0.41, 0), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 0, 0), uv10) then
                    Lecture5()
                end

                if uv1.CustomButton(uv4("Провести лекцию №6 составу"), uv1.ImVec4(0.38, 0.3, 0.41, 0), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 0, 0), uv10) then
                    Lecture6()
                end

                if uv1.IsItemHovered(uv1.Text("(?)")) then
                    uv1.SetTooltip(uv4("Изменить лекции можно в текстовом документе \n по пути GTA San Andreas/moonloader/Bank-config/lecture*.txt"))
                end
            end

            uv1.EndChild()
        end

        if uv5 == 3 then
            uv1.BeginChild("##Settings", 15, 15, uv1.WindowFlags.ShowBorders)

            if uv1.InputText(uv4("Ваше RP имя"), uv11) then
                uv11 = uv11
            end

            uv1.Combo(uv4("Ваша должность."), uv12, {
                uv4("Охраник(1)"),
                uv4("Сотрудник банка(2)"),
                uv4("Старший охранник(3)"),
                uv4("Начальник Охраны(4)"),
                uv4("Старший сотрудник банка(5)"),
                uv4("Начальник отдела сбережений(6)"),
                uv4("Заведующий отдела сбережений(7)"),
                uv4("Менеджер(8)"),
                uv4("Зам.Директора(9)"),
                uv4("Директор(10)")
            })

            if uv12.v == 0 then
                uv13.v = uv4("Охраник")
            end

            if uv12.v == 1 then
                uv13.v = uv4("Сотрудник банка")
            end

            if uv12.v == 2 then
                uv13.v = uv4("Старший охранник")
            end

            if uv12.v == 3 then
                uv13.v = uv4("Начальник охраны")
            end

            if uv12.v == 4 then
                uv13.v = uv4("Старший сотрудник банка")
            end

            if uv12.v == 5 then
                uv13.v = uv4("Начальник отдела сбережений")
            end

            if uv12.v == 6 then
                uv13.v = uv4("Заведующий отдела сбережений")
            end

            if uv12.v == 7 then
                uv13.v = uv4("Менеджер")
            end

            if uv12.v == 8 then
                uv13.v = uv4("Зам.Директора")
            end

            if uv12.v == 9 then
                uv13.v = uv4("Директор")
            end

            if uv1.CustomButton(uv4("Сохранить"), uv1.ImVec4(0, 0.5, 0, 0.4), uv1.ImVec4(0, 0.5, 0, 0.8), uv1.ImVec4(0, 0, 0, 0), uv10) then
                uv7.main.name = uv4:decode(tostring(uv11.v))
                uv7.main.rank = uv4:decode(tostring(uv13.v))

                if uv14.save(uv7, uv15) then
                    sampAddChatMessage("[CBHelper]:{ffffff}Успешно сохранено", 36095)
                end
            end

            if uv7.main.name == "nil" or uv7.main.rank == "nil" then
                uv1.Text(uv4("Вам необходимо установить имя и ранг"))
            else
                uv1.Text(uv4("Ваше текущее имя: ") .. uv4(uv7.main.name))
                uv1.Text(uv4("Ваша текущая должность: ") .. uv4(uv7.main.rank))
            end

            uv1.Separator()

            if uv1.Checkbox(uv4("Я вхожу в старший состав банка."), uv16) then
                if uv17 == false then
                    uv18.v = not uv18.v
                elseif uv17 == true then
                    uv16.v = false
                    uv17 = false
                end
            end

            uv1.EndChild()
        end

        if uv5 == 4 then
            uv1.Columns(3, nullptr, false)
            uv1.BeginChild("timer##1", 15, 15, uv1.WindowFlags.ShowBorders)
            uv1.Text(uv4("Текущий сеанс:"))
            uv1.Text(uv4("Дней: ") .. uv19)
            uv1.Text(uv4("Часов: ") .. uv20)
            uv1.Text(uv4("Минут: ") .. uv21)
            uv1.Text(uv4("Секунд: ") .. uv22)
            uv1.EndChild()
            uv1.NextColumn()
            uv1.BeginChild("timer##2", 15, 15, uv1.WindowFlags.ShowBorders)

            if uv1.CustomButton(uv4("Обнулить таймер"), uv1.ImVec4(0.5, 0, 0, 0.4), uv1.ImVec4(0.5, 0, 0, 0.8), uv1.ImVec4(0, 0, 0, 0), uv10) then
                reload_timer()
            end

            if uv1.CustomButton(uv4("Обнулить сеанс"), uv1.ImVec4(0.5, 0, 0, 0.4), uv1.ImVec4(0.5, 0, 0, 0.8), uv1.ImVec4(0, 0, 0, 0), uv10) then
                reload_timer_cur()
            end

            uv1.EndChild()
            uv1.NextColumn()
            uv1.BeginChild("timer##3", 15, 15, uv1.WindowFlags.ShowBorders)
            uv1.Text(uv4("За все время:"))
            uv1.Text(uv4("Дней: ") .. uv23)
            uv1.Text(uv4("Часов: ") .. uv24)
            uv1.Text(uv4("Минут: ") .. uv25)
            uv1.EndChild()
        end

        uv1.End()
    end

    if uv18.v then
        uv1.SetNextWindowPos(uv1.ImVec2((uv2 - 200) / 2, (uv3 - 80) / 2), uv1.Cond.FirstUseEver)
        uv1.SetNextWindowSize(uv1.ImVec2(200, 80), uv1.Cond.FirstUseEver)
        uv1.Begin(uv4("pin"), uv26, uv1.WindowFlags.NoResize + uv1.WindowFlags.NoTitleBar + uv1.WindowFlags.NoMove)
        uv1.Text(uv4("Введите ПИН-код"))

        if uv1.InputText(uv4("ПИН-код"), uv27) then
            uv27 = uv27
        end

        if uv1.CustomButton(uv4("Принять##1"), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 1, 0.8), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(uv1.GetWindowWidth() / 2 - 11, 0)) then
            if tostring(uv27.v) == tostring(uv28) then
                uv17 = true

                sampAddChatMessage("[CBHelper]:{ffffff}ПИН-код введен успешно!", 1762048)

                uv18.v = not uv18.v
            else
                uv18.v = not uv18.v

                sampAddChatMessage("[CBHelper]:{ffffff}Ошибка! Неверный ПИН-код.", 16711680)

                uv16.v = false
            end
        end

        uv1.SameLine()

        if uv1.CustomButton(uv4("Закрыть##1"), uv1.ImVec4(0.5, 0, 0, 0.4), uv1.ImVec4(0.5, 0, 0, 0.8), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(uv1.GetWindowWidth() / 2 - 11, 0)) then
            uv18.v = not uv18.v
            uv16.v = false
        end

        uv1.End()
    end

    if uv26.v then
        uv1.SetNextWindowPos(uv1.ImVec2((uv2 - 200) / 2, (uv3 - 80) / 2), uv1.Cond.FirstUseEver)
        uv1.SetNextWindowSize(uv1.ImVec2(200, 80), uv1.Cond.FirstUseEver)
        uv1.Begin(uv4("expel"), uv26, uv1.WindowFlags.NoResize + uv1.WindowFlags.NoTitleBar + uv1.WindowFlags.NoMove)
        uv1.Text(uv4("Введите причину"))

        if uv1.InputText(uv4("Причина"), uv29) then
            uv29 = uv29
        end

        if uv1.CustomButton(uv4("Принять"), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 1, 0.4), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(uv1.GetWindowWidth() / 2 - 11, 0)) then
            lua_thread.create(function ()
                sampSendChat("/me подошел к " .. sampGetPlayerNickname(uv0))
                wait(1500)
                sampSendChat("/expel " .. uv0 .. " " .. uv1:decode(uv2.v))
                wait(1500)
                sampSendChat("/me выгнал " .. sampGetPlayerNickname(uv0))
            end)

            uv26.v = not uv26.v
            uv31.v = not uv31.v
        end

        uv1.SameLine()

        if uv1.CustomButton(uv4("Отмена"), uv1.ImVec4(1, 0, 0, 0.4), uv1.ImVec4(0.7, 0, 0, 0.4), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(uv1.GetWindowWidth() / 2 - 11, 0)) then
            uv31.v = not uv31.v
            uv26.v = not uv26.v
        end

        uv1.End()
    end

    if uv31.v then
        uv1.SetNextWindowPos(uv1.ImVec2((uv2 - 230) / 2, (uv3 - 150) / 2), uv1.Cond.FirstUseEver)
        uv1.SetNextWindowSize(uv1.ImVec2(230, 300), uv1.Cond.FirstUseEver)
        uv1.Begin(uv4(""), uv31, uv1.WindowFlags.NoResize + uv1.WindowFlags.NoTitleBar)

        if uv32 == 1 then
            uv1.Text("Player: " .. sampGetPlayerNickname(uv30) .. " ID: " .. uv30)
            uv1.BeginChild("##2", 1, 5, uv1.WindowFlags.ShowBorders)

            if uv1.CustomButton(uv4("Выгнать"), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0.5, 1, 0.8), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(-0.1, 0)) then
                uv31.v = not uv31.v
                uv26.v = not uv26.v
            end

            if uv1.CustomButton(uv4("Собеседование"), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0.5, 1, 0.8), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(-0.1, 0)) then
                uv31.v = not uv31.v
                uv33.v = not uv33.v
            end

            if uv17 == true then
                if uv1.CustomButton(uv4("Дать выговор"), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0.5, 1, 0.8), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(-0.1, 0)) then
                    uv34.v = not uv34.v
                    uv31.v = not uv31.v
                end

                if uv1.CustomButton(uv4("Уволить"), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0.5, 1, 0.8), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(-0.1, 0)) then
                    uv35.v = not uv35.v
                    uv31.v = not uv31.v
                end

                if uv1.CustomButton(uv4("Принять##invite"), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0.5, 1, 0.8), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(-0.1, 0)) then
                    sampSendChat("/invite " .. uv30)
                end

                if uv1.CustomButton(uv4("Выдать ранг"), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0.5, 1, 0.8), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(-0.1, 0)) then
                    uv36.v = not uv36.v
                    uv31.v = not uv31.v
                end
            end

            if uv1.Button(uv4("Закрыть"), uv1.ImVec2(-0.1, 0)) then
                uv31.v = not uv31.v
            end

            uv1.EndChild()
        end

        uv1.End()
    end

    if uv33.v then
        uv1.SetNextWindowPos(uv1.ImVec2((uv2 - 270) / 2, (uv3 - 215) / 2), uv1.Cond.FirstUseEver)
        uv1.SetNextWindowSize(uv1.ImVec2(270, 215), uv1.Cond.FirstUseEver)
        uv1.Begin(uv4("invite"), uv33, uv1.WindowFlags.NoResize + uv1.WindowFlags.NoTitleBar)

        if uv1.ToggleButton("Test##1", uv37, uv1.GetColorU32(uv38(0, 0.5, 1, 1.01))) then
            if uv37.v then
                sampAddChatMessage("Автоотыгровка /me активирована", 36095)
            else
                sampAddChatMessage("Автоотыгровка /me деактивирована", 36095)
            end
        end

        uv39 = sampGetDialogText(sampGetCurrentDialogId())

        if sampIsDialogActive() and sampGetCurrentDialogId() == 1234 and uv40 == true then
            uv41 = 1
        else
            uv41 = sampGetCurrentDialogId()
            uv40 = false
        end

        uv1.SameLine()
        uv1.Text(uv4("Автоотыгровка просмотра документов"))
        uv1.BeginChild("##invite", 1, 5, uv1.WindowFlags.ShowBorders)

        if uv1.CustomButton(uv4("Приветствие"), uv1.ImVec4(0, 0.5, 1, 0.2), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0.5, 1, 0.9), uv10) then
            lua_thread.create(function ()
                sampSendChat("Здравствуйте, я " .. uv0.main.rank .. " Банка " .. uv0.main.name .. ". Вы пришли на собеседование?")
                wait(1100)
                sampSendChat("/do На груди бейдж с надписью \"" .. uv0.main.rank .. " " .. uv0.main.name .. "\".")
                wait(1100)
                sampSendChat("Вы на собеседование?")
            end)
        end

        if uv1.CustomButton(uv4("Паспорт"), uv1.ImVec4(0, 0.5, 1, 0.2), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0.5, 1, 0.9), uv1.ImVec2(uv1.GetWindowWidth() / 3 - 11, 0)) then
            sampSendChat("Предъявите ваш паспорт, пожалуйста")
        end

        uv1.SameLine()

        if uv1.CustomButton(uv4("Мед.карта"), uv1.ImVec4(0, 0.5, 1, 0.2), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0.5, 1, 0.9), uv1.ImVec2(uv1.GetWindowWidth() / 3 - 11, 0)) then
            sampSendChat("Вашу мед.карту, пожалуйста")
        end

        uv1.SameLine()

        if uv1.CustomButton(uv4("Лицензии"), uv1.ImVec4(0, 0.5, 1, 0.2), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0.5, 1, 0.9), uv1.ImVec2(uv1.GetWindowWidth() / 3 - 11, 0)) then
            sampSendChat("Ваши лицензии, пожалуйста")
        end

        if uv1.CustomButton(uv4("Опрос"), uv1.ImVec4(0, 0.5, 1, 0.2), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0.5, 1, 0.9), uv10) then
            lua_thread.create(function ()
                sampSendChat("/todo Перейдем, пожалуй, к опросу*берёт бланк")
                wait(1500)
                sampSendChat("Ваше образование? Были ли у вас прошлые места работ? Если были, то какие?")
            end)
        end

        if uv1.CustomButton(uv4("Принять"), uv1.ImVec4(0, 0.6, 0, 0.4), uv1.ImVec4(0, 0.6, 0, 0.8), uv1.ImVec4(0.05, 0.6, 0.01, 0.9), uv1.ImVec2(uv1.GetWindowWidth() / 2 - 12, 0)) then
            lua_thread.create(function ()
                sampSendChat("/todo Поздравляю! теперь вы нвоый сотрудник банка!*открывая шкафчик")
                wait(1500)
                sampSendChat("/do В шкафчике лежит форма, рация и ключи")
                wait(1500)
                sampSendChat("/invite " .. uv0)
                wait(1500)
                sampSendChat("/todo Переодевайтесь в раздевалке и приступайте к работе*передавая форму,рацию и ключи человеку напротив.")
            end)
        end

        uv1.SameLine()

        if uv1.CustomButton(uv4("Отклонить"), uv1.ImVec4(0.6, 0, 0, 0.4), uv1.ImVec4(0.6, 0, 0, 0.8), uv1.ImVec4(0.6, 0, 0, 0.9), uv1.ImVec2(uv1.GetWindowWidth() / 2 - 12, 0)) then
            sampSendChat("Простите, к сожалению, вы нам не подходите")
        end

        if uv37.v == true and sampIsDialogActive() and uv41 == 1234 and uv39:find("Серия") then
            lua_thread.create(function ()
                sampSendChat("/me движением руки взял паспорт гражданина")
                wait(1500)
                sampSendChat("/do Документы гражданина в руке.")
                wait(1500)
                sampSendChat("/me движением рук раскрыл паспорт гражданина")
                wait(1500)
                sampSendChat("/do Паспорт гражданина изучен.")
                wait(1500)
                sampSendChat("/me протянув руку, вернул паспорт гражданину.")
            end)

            uv40 = true
        end

        if uv37.v == true and sampIsDialogActive() and uv41 == 1234 and uv39:find("Лицензия") then
            lua_thread.create(function ()
                sampSendChat("/me движением руки взял пакет лицензий гражданина")
                wait(1500)
                sampSendChat("/do Лицензии гражданина в руке")
                wait(1500)
                sampSendChat("/me движением руки достал лицензии и осмотрел каждую")
                wait(1500)
                sampSendChat("/do Лицензии гражданина изучены")
                wait(1500)
                sampSendChat("/me протянув руку, вернул пакет с лицензиями гражданину.")
            end)

            uv40 = true
        end

        if uv37.v == true and sampIsDialogActive() and uv41 == 1234 and uv39:find("Статус") then
            lua_thread.create(function ()
                sampSendChat("/me движением руки взял мед. карту гражданина")
                wait(1500)
                sampSendChat("/do Мед.карта в руке")
                wait(1500)
                sampSendChat("/me внимательно изучил мед. карту")
                wait(1500)
                sampSendChat("/do Мед.карта гражданина изучена.")
                wait(1500)
                sampSendChat("/me протянув руку, вернул мед.карту гражданину.")
            end)

            uv40 = true
        end

        uv1.NewLine()
        uv1.NewLine()

        if uv1.CustomButton(uv4("Назад"), uv1.ImVec4(0, 0.5, 1, 0.2), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0.5, 1, 0.9), uv10) then
            uv33.v = not uv33.v
            uv31.v = not uv31.v
        end

        uv1.EndChild()
        uv1.End()
    end

    if uv34.v then
        uv1.SetNextWindowPos(uv1.ImVec2((uv2 - 200) / 2, (uv3 - 80) / 2), uv1.Cond.FirstUseEver)
        uv1.SetNextWindowSize(uv1.ImVec2(200, 80), uv1.Cond.FirstUseEver)
        uv1.Begin(uv4("warn"), uv34, uv1.WindowFlags.NoResize + uv1.WindowFlags.NoTitleBar + uv1.WindowFlags.NoMove)
        uv1.Text(uv4("Введите причину"))

        if uv1.InputText(uv4("Причина##warn"), uv42) then
            uv42 = uv42
        end

        if uv1.CustomButton(uv4("Принять##warn"), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 1, 0.4), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(uv1.GetWindowWidth() / 2 - 11, 0)) then
            lua_thread.create(function ()
                sampSendChat("/me открыл базу данных ")
                wait(1500)
                sampSendChat("/fwarn " .. uv0 .. " " .. uv1:decode(uv2.v))
                wait(1500)
                sampSendChat("/me выдал выговор сотруднику " .. sampGetPlayerNickname(uv0))
                wait(1500)
            end)

            uv34.v = not uv34.v
            uv31.v = not uv31.v
        end

        uv1.SameLine()

        if uv1.CustomButton(uv4("Отмена##warn"), uv1.ImVec4(1, 0, 0, 0.4), uv1.ImVec4(0.7, 0, 0, 0.4), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(uv1.GetWindowWidth() / 2 - 11, 0)) then
            uv31.v = not uv31.v
            uv34.v = not uv34.v
        end

        uv1.End()
    end

    if uv35.v then
        uv1.SetNextWindowPos(uv1.ImVec2((uv2 - 200) / 2, (uv3 - 80) / 2), uv1.Cond.FirstUseEver)
        uv1.SetNextWindowSize(uv1.ImVec2(200, 80), uv1.Cond.FirstUseEver)
        uv1.Begin(uv4("fire"), uv35, uv1.WindowFlags.NoResize + uv1.WindowFlags.NoTitleBar + uv1.WindowFlags.NoMove)
        uv1.Text(uv4("Введите причину"))

        if uv1.InputText(uv4("Причина##fire"), uv43) then
            uv43 = uv43
        end

        if uv1.CustomButton(uv4("Принять##fire"), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 1, 0.4), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(uv1.GetWindowWidth() / 2 - 11, 0)) then
            lua_thread.create(function ()
                sampSendChat("/me открыл базу данных ")
                wait(1500)
                sampSendChat("/uninvite " .. uv0 .. " " .. uv1:decode(uv2.v))
                wait(1500)
                sampSendChat("/me отобрал у сотрудника " .. sampGetPlayerNickname(uv0) .. " форму, рацию и ключи")
                wait(1500)
            end)
        end

        uv1.SameLine()

        if uv1.CustomButton(uv4("Отмена##fire"), uv1.ImVec4(1, 0, 0, 0.4), uv1.ImVec4(0.7, 0, 0, 0.4), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(uv1.GetWindowWidth() / 2 - 11, 0)) then
            uv31.v = not uv31.v
            uv35.v = not uv35.v
        end

        uv1.End()
    end

    if uv36.v then
        uv1.SetNextWindowPos(uv1.ImVec2((uv2 - 230) / 2, (uv3 - 80) / 2), uv1.Cond.FirstUseEver)
        uv1.SetNextWindowSize(uv1.ImVec2(230, 80), uv1.Cond.FirstUseEver)
        uv1.Begin(uv4("giverank"), uv36, uv1.WindowFlags.NoResize + uv1.WindowFlags.NoTitleBar)
        uv1.Text(uv4("Введите выдаваемый ранг"))

        if uv1.InputText(uv4("Ранг##giverank"), uv44) then
            uv44 = uv44
        end

        if uv1.CustomButton(uv4("Принять##giverank"), uv1.ImVec4(0, 0.5, 1, 0.4), uv1.ImVec4(0, 0, 1, 0.4), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(uv1.GetWindowWidth() / 2 - 11, 0)) then
            lua_thread.create(function ()
                sampSendChat("/me открыл базу данных ")
                wait(1500)
                sampSendChat("/giverank " .. uv0 .. " " .. uv1.v)
                wait(1500)
                sampSendChat("/me выдал сотруднику " .. sampGetPlayerNickname(uv0) .. " новый бейдж")
                wait(1500)
            end)

            uv36.v = not uv36.v
        end

        uv1.SameLine()

        if uv1.CustomButton(uv4("Отмена##giverank"), uv1.ImVec4(1, 0, 0, 0.4), uv1.ImVec4(0.7, 0, 0, 0.4), uv1.ImVec4(0, 0, 0, 0), uv1.ImVec2(uv1.GetWindowWidth() / 2 - 11, 0)) then
            uv31.v = not uv31.v
            uv36.v = not uv36.v
        end

        uv1.End()
    end
end

function reload_timer()
    uv0.timer.sec = 0
    uv0.timer.min = 0
    uv0.timer.hour = 0
    uv0.timer.day = 0
    uv0.timer.tmin = 0
    uv0.timer.thour = 0
    uv0.timer.tday = 0
    uv0 = uv1.save(uv0, uv2)
end

function reload_timer_cur()
    uv0.timer.sec = 0
    uv0.timer.min = 0
    uv0.timer.hour = 0
    uv0.timer.day = 0
    uv0 = uv1.save(uv0, uv2)
end

function timer()
    uv0 = uv1.load(nil, uv2)
    uv3 = uv0.timer.day
    uv4 = uv0.timer.hour
    uv5 = uv0.timer.min
    uv6 = uv0.timer.sec
    uv7 = uv0.timer.tday
    uv8 = uv0.timer.thour
    uv9 = uv0.timer.tmin
end

function async_http_request(slot0, slot1, slot2, slot3, slot4)
    slot5 = uv0.gen("*", {
        package = {
            path = package.path,
            cpath = package.cpath
        }
    }, function ()
        slot1, slot2 = pcall(require("requests").request, uv0, uv1, uv2)

        if slot1 then
            slot2.json, slot2.xml = nil

            return true, slot2
        else
            return false, slot2
        end
    end)
    slot4 = slot4 or function ()
    end

    lua_thread.create(function ()
        slot0 = uv0()

        while true do
            if slot0.status == "done" then
                if slot0[1] then
                    uv1(slot0[2])
                else
                    uv2(slot3)
                end

                return
            elseif slot1 == "error" then
                return uv2(slot0[1])
            elseif slot1 == "killed" or slot1 == "cancelled" then
                return uv2(slot1)
            end

            wait(0)
        end
    end)
end

function getserial()
    slot0 = require("ffi")

    slot0.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
        );
        ]])
    slot0.C.GetVolumeInformationA(nil, nil, 0, slot0.new("unsigned long[1]", 0), nil, nil, nil, 0)

    return slot0.new("unsigned long[1]", 0)[0]
end

function update()
    async_http_request("GET", "https://raw.githubusercontent.com/Mahonya404/CBHelper/master/ver.txt", nil, function (slot0)
        sampAddChatMessage("[CBHelper]:{ffffff}Проверка наличия обновлений", 36095)

        ver = tonumber(slot0.text)

        if uv0 < ver then
            downloadUrlToFile("https://raw.githubusercontent.com/Mahonya404/CBHelper/master/CBHelper.luac", thisScript().path, function (slot0, slot1)
                if slot1 == uv0.STATUS_ENDDOWNLOADDATA then
                    sampAddChatMessage("[CBHelper]:{ffffff}Обновление выполнено", 36095)
                    thisScript():reload()
                end
            end)
        elseif uv2.main.name == "nil" then
            sampAddChatMessage("[CBHelper]:{ffffff}При первом запуске зайдите в настройки и установите ваше имя.", 36095)
        else
            sampAddChatMessage("[CBHelper]:{ffffff}Добро пожаловать, {ff0000}" .. uv2.main.name, 36095)
        end
    end)
end

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then
        error("Отсутствует SAMPFUNCS")
    end

    while not isSampAvailable() do
        wait(100)
    end

    update()
    UstavTxt()
    sampAddChatMessage("[CBHelper]:{ffffff}Помощник ЦБ v" .. uv0 .. " загружен успешно!", 36095)
    sampRegisterChatCommand("reload", function ()
        thisScript():reload()
    end)

    while true do
        wait(0)

        slot0 = sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(playerPed)))
        uv1 = getCurrentCharWeapon(playerPed)

        timer()

        if uv1 == 3 and uv2 == false then
            lua_thread.create(function ()
                uv0 = true

                sampSendChat("/me резким движением руки снял дубинку с пояса")
                wait(1500)
                sampSendChat("/do Дубинка в руках")
            end)
        elseif uv1 == 0 and uv2 == true then
            lua_thread.create(function ()
                uv0 = false

                sampSendChat("/me повесил дубинку на пояс")
            end)
        end

        if wasKeyPressed(uv3.VK_R) and wasKeyPressed(uv3.VK_RBUTTON) then
            slot1, slot2 = getCharPlayerIsTargeting(PLAYER_HANDLE)

            if slot1 and doesCharExist(slot2) then
                slot3, slot4 = sampGetPlayerIdByCharHandle(slot2)

                if slot3 then
                    lua_thread.create(function ()
                        sampSendChat("/bankmenu " .. uv0)
                        wait(1000)

                        if sampIsDialogActive() and uv1 == 713 then
                            wait(1100)
                            sampSendChat("/me открыл базу данных Центрального банка")
                            wait(1100)
                            sampSendChat("/do База данных открыта")
                            wait(1100)
                            sampSendChat("/me входит в свой аккаунт в базе данных, вводя пароль ")
                            wait(1100)
                            sampSendChat("/do Пароль введён верно, " .. uv2.main.name .. " успешно вошёл в базу данных ЦБ.")
                        end
                    end)
                end
            end
        end

        if wasKeyPressed(uv3.VK_Q) and wasKeyPressed(uv3.VK_RBUTTON) then
            slot1, slot2 = getCharPlayerIsTargeting(PLAYER_HANDLE)

            if slot1 and doesCharExist(slot2) then
                slot3, uv6 = sampGetPlayerIdByCharHandle(slot2)

                if slot3 then
                    uv7.v = not uv7.v
                end
            end
        end

        if wasKeyPressed(uv3.VK_F2) then
            uv8.v = not uv8.v
        end

        if wasKeyPressed(uv3.VK_F3) then
            print(uv5.main.name)
        end

        uv9.Process = uv8.v or uv7.v or uv10.v or uv11.v or uv12.v or uv13.v or uv14.v or uv15.v
    end
end
 
  • Нравится
Реакции: Fabregoo