Проверка на лаунчер.

tapaem po xomyaku

Новичок
Автор темы
14
3
Версия MoonLoader
.026-beta
Всем привет, возможно ли сделать проверку на лаунчер. т.е если игрок с лаунчера - main(), если с клиента
thisScript():unload() ??
 
Решение
Lua:
if samp_version == r1 then
        thisScript():unload()
end
так? или я не шарю
Lua:
local ffi = require("ffi")

function get_samp_version()
    if samp_base == nil or samp_base == 0 then
        samp_base = getModuleHandle("samp.dll")
    end

    if samp_base ~= 0 then
        local e_lfanew = ffi.cast("long*", samp_base + 60)[0]
        local nt_header = samp_base + e_lfanew
        local entry_point_addr = ffi.cast("unsigned int*", nt_header + 40)[0]
        if entry_point_addr == 0x31DF13 then
            return "r1"
        elseif entry_point_addr == 0xCC4D0 then
            return "r3"
        end
    end

    return "unknown"
end

function main()
    while not isSampAvailable() do wait(0) end
    local samp_version =...

chromiusj

C Y N T H O N I
Модератор
5,059
3,322
Можно по версии сампа
Если речь про шедевроаризону, делаешь проверку на версию R3,если не она, отклоняешь
 

chromiusj

C Y N T H O N I
Модератор
5,059
3,322
Lua:
if samp_version == r1 then
        thisScript():unload()
end
так? или я не шарю
Lua:
local ffi = require("ffi")

function get_samp_version()
    if samp_base == nil or samp_base == 0 then
        samp_base = getModuleHandle("samp.dll")
    end

    if samp_base ~= 0 then
        local e_lfanew = ffi.cast("long*", samp_base + 60)[0]
        local nt_header = samp_base + e_lfanew
        local entry_point_addr = ffi.cast("unsigned int*", nt_header + 40)[0]
        if entry_point_addr == 0x31DF13 then
            return "r1"
        elseif entry_point_addr == 0xCC4D0 then
            return "r3"
        end
    end

    return "unknown"
end

function main()
    while not isSampAvailable() do wait(0) end
    local samp_version = get_samp_version()
    if samp_version == "r3" then
        print("SA-MP версия: r3")
    elseif samp_version == "r1" then
        print("SA-MP версия: r1")
    else
        print("SA-MP версия неизвестна или не найдена")
    end
    wait(-1)
end
1716751998032.png
 
  • Нравится
Реакции: tapaem po xomyaku

tapaem po xomyaku

Новичок
Автор темы
14
3
Lua:
local ffi = require("ffi")

function get_samp_version()
    if samp_base == nil or samp_base == 0 then
        samp_base = getModuleHandle("samp.dll")
    end

    if samp_base ~= 0 then
        local e_lfanew = ffi.cast("long*", samp_base + 60)[0]
        local nt_header = samp_base + e_lfanew
        local entry_point_addr = ffi.cast("unsigned int*", nt_header + 40)[0]
        if entry_point_addr == 0x31DF13 then
            return "r1"
        elseif entry_point_addr == 0xCC4D0 then
            return "r3"
        end
    end

    return "unknown"
end

function main()
    while not isSampAvailable() do wait(0) end
    local samp_version = get_samp_version()
    if samp_version == "r3" then
        print("SA-MP версия: r3")
    elseif samp_version == "r1" then
        print("SA-MP версия: r1")
    else
        print("SA-MP версия неизвестна или не найдена")
    end
    wait(-1)
end
Посмотреть вложение 241665
Спасибо тебе 💋