Полезные сниппеты и функции

Fomikus

Известный
Проверенный
472
341
Описание: бог знает как такое обьяснить, но можно создавать условия по средствам массива (Можно будет сделать NoCode создание правил/условий для скриптов)

Из минусов нет проверки на существование условного ".name" у обьекта и не поддерживает группы правил в группах правил (Рекурсия не работала, бог знает с чем связано), а еще там всякие штуки с пустым массивом, вообще просто как пример
Если вкратце представляет вот такое:
Lua:
local my_rule = {
    between_groups = "or",
    {index = "name", operator = "equals", value = "Popa Murav`ya", oper = "or"}, -- oper = "or" тут ни на что не влияет, так как это первое правило
    {
        {index = "name", operator = "contains", value = "Code",oper = "and"}, -- oper = "and" тут ни на что не влияет, так как это первое правило в группе-правил
        {index = "top", operator = "is", value = true, oper = "and"}
    },
    {
        {index = "name", operator = "equals", value = "Admin",oper = "and"}, -- не влияет
        {index = "donate", operator = "equals", value = true, oper = "and"},
    },
    {index = "sex", operator = "equals", value = "Yes", oper = "or"} -- тут уже влияет
}

В виде условия на луа, то есть из массива сверху получится примерно это
Lua:
-- obj - наш обьект
-- obj.name.contains нет луа(или я не видел, поэтому это своя функция, не важно)
if obj.name == "Popa Murav`ya" or (obj.name.contains("Code") and obj.top == true) or (obj.name == "Admin" and obj.donate == true) or obj.sex == "Yes" then
--code
end
Но при этом сразу выдает вам true или false
Lua:
local operators = {
    equals = function (a, b) return a == b end,
    not_equals = function (a, b) return a ~= b end,
    is =  function (a, b) return a == b end,
    greater= function (a, b) return a > b end,
    less = function (a, b) return a < b end,
    equals_or_less = function (a, b) return a <= b end,
    equals_or_greater = function (a, b) return a >= b end,
    contains = function (a, b)
                if type(a) == "table" then
                    for _, v in pairs(a) do
                        if v == b then return true end
                    end
                    return false
                elseif type(a) == "string" then
                    return a:find(b) and true or false -- так надо чтобы красиво были бул только
                else
                    return false
                end
    end,
       
}

function GenerateCondition(rule, object)
    local condition = nil
    for k, v in pairs(rule) do
        if type(v) == "table" then
            if #v == 0 then
                local rule_condition = operators[v['operator']](object[v['index']], v['value'])
                if not condition then
                     condition = rule_condition
                else
                    condition = v['oper'] == "or" and (rule_condition or condition) or (rule_condition and condition)
                end
            else
                local group_condition = nil
                for m_k, m_v in pairs(v) do
                    if type(m_v) ~= "string" then
                        local rule_condition = operators[m_v['operator']](object[m_v['index']],     m_v['value'])
                        if group_condition == nil then
                            group_condition = rule_condition
                        else
                            group_condition = m_v['oper'] == "or" and (rule_condition or group_condition) or (rule_condition and group_condition)
                        end
                    end
                end
                if not condition then
                    condition = group_condition
                else
                    condition = (rule['between_groups'] == "or" and (group_condition or condition) or (group_condition and condition))
                end
            end
        end
    end
    return condition
end
Lua:
local my_mini_object = {
    name = "Admin",
    level = 5,
    donate = true,
    top = false,
    sex = "Yes"
}

local my_mini_object2 = {
    name = "Yuriy Code",
    level = 7,
    donate = true,
    top = true,
    sex = "No"
}

local my_mini_object3 = {
    name = "Popa Murav`y сode",
    level = 1,
    donate = true,
    top = true,
    sex = "No"
}

local my_rule = {
    between_groups = "or",
    {index = "name", operator = "equals", value = "Popa Murav`ya", oper = "or"}, -- oper = "or" тут ни на что не влияет, так как это первое правило
    {
        {index = "name", operator = "contains", value = "Code",oper = "and"}, -- oper = "and" тут ни на что не влияет, так как это первое правило в группе-правил
        {index = "top", operator = "is", value = true, oper = "and"}
    },
    {
        {index = "name", operator = "equals", value = "Admin",oper = "and"}, -- не влияет
        {index = "donate", operator = "equals", value = true, oper = "and"},
    },
    {index = "sex", operator = "equals", value = "Yes", oper = "or"} -- тут уже влияет
}


if GenerateCondition(my_rule, my_mini_object) then
    print("1st true")  -- true, потому-что Админ + donate, а так-же sex = "Yes"
else
    print("1st false")
end

print(GenerateCondition(my_rule, my_mini_object2)) -- true (Потому-что name содержит Code и top = true
print(GenerateCondition(my_rule, my_mini_object3)) -- false (code написан в нижнем регистре)
27vLLRk.png
 

Gorskin

I shit on you
Проверенный
1,247
1,043
Описание: Меняет цвет рамки карты когда зажимаешь Z
Lua:
memory.setuint8(0x57579A + 1, 0xFF, true) -- цвет рамки R
memory.setuint8(0x575798 + 1, 0xAA, true) -- цвет рамки G
memory.setuint8(0x575792 + 1, 0xFF, true) -- цвет рамки B
memory.setuint8(0x57578D + 1, 0xFF, true) -- цвет рамки A
Screenshot_1.png
 

Gorskin

I shit on you
Проверенный
1,247
1,043
Описание: Отключает подсказки в меню.
Screenshot_18.png
Screenshot_19.png
Код:
Lua:
local memory = require("memory")
memory.fill(0x57E3AE, 0x90, 5, true)-- подсказки

Описание: Отключает заголовки в меню.
Screenshot_20.png
Screenshot_21.png
Код:
Lua:
local memory = require("memory")
memory.fill(0x579698, 0x90, 5, true) -- отключает надпись на меню сверху
 

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,771
11,214
Описание: позволяет выводить текст с HEX кодами цветов в DrawList
Код:
Lua:
function imgui.AddTextColoredHex(DL, pos, color, text, out, outcol, fontsize, font)
    local function explode_argb(argb)
        local a = bit.band(bit.rshift(argb, 24), 0xFF)
        local r = bit.band(bit.rshift(argb, 16), 0xFF)
        local g = bit.band(bit.rshift(argb, 8), 0xFF)
        local b = bit.band(argb, 0xFF)
        return a, r, g, b
    end
    local DL, fontsize, out, outcol = DL or imgui.GetWindowDrawList(), fontsize or 14, out or 0, outcol or imgui.ImVec4(0, 0, 0, 0.5)
    local charIndex, lastColorCharIndex, lastColor = 0, -100, color
    if font then
        imgui.PushFont(font)
    end
    for Char in text:gmatch('.') do
        charIndex = charIndex + 1
        if Char == '{' and text:sub(charIndex + 7, charIndex + 7) == '}' then
            lastColorCharIndex, lastColor = charIndex, text:sub(charIndex + 1, charIndex + 6)
        end
        if charIndex < lastColorCharIndex or charIndex > lastColorCharIndex+7 then
            local a,r,g,b = explode_argb(type(lastColor) == 'string' and '0xFF'..lastColor or color)
            if out > 0 then
                DL:AddTextFontPtr(font, fontsize, imgui.ImVec2(pos.x + out, pos.y + out), imgui.GetColorU32Vec4(outcol), u8(Char))
                DL:AddTextFontPtr(font, fontsize, imgui.ImVec2(pos.x - out, pos.y - out), imgui.GetColorU32Vec4(outcol), u8(Char))
                DL:AddTextFontPtr(font, fontsize, imgui.ImVec2(pos.x + out, pos.y - out), imgui.GetColorU32Vec4(outcol), u8(Char))
                DL:AddTextFontPtr(font, fontsize, imgui.ImVec2(pos.x - out, pos.y + out), imgui.GetColorU32Vec4(outcol), u8(Char))
            end
            DL:AddTextFontPtr(font, fontsize, pos, imgui.GetColorU32Vec4(imgui.ImVec4(r / 255, g / 255, b / 255, 1)), u8(Char))          
            pos.x = pos.x + imgui.CalcTextSize(u8(Char)).x + (Char == ' ' and 2 or 0)
        end
    end
    if font then
        imgui.PopFont()
    end
end
Аргументы функции:
Lua:
imgui.AddTextColoredHex(DL, pos, color, text, out, outcol, fontsize, font)
--[[
    DL - дравлист (опционально)
    pos - положение
    color - цвет (AABBGGRR)
    text - текст
    out - размер обводки (опционально)
    outcol - размер обводки (ImVec4) (опционально)
    fontsize - размер шрифта  (опционально)
    font - шрифт (опционально)
]]
Пример использования:
Lua:
local DL = imgui.GetBackgroundDrawList()
imgui.AddTextColoredHex(DL, imgui.ImVec2(500, 700), 0xFFffffff, 'hello {ff0000}world')
1663255981292.png






Описание: возвращает таблицу со всеми файлами с определенным расширением из указанной папки
Код:
Lua:
function getFilesInPath(path, ftype)
    local Files, SearchHandle, File = {}, findFirstFile(path.."\\"..ftype)
    table.insert(Files, File)
    while File do File = findNextFile(SearchHandle) table.insert(Files, File) end
    return Files
end
Пример использования:
Lua:
--table files = getFilesInPath(string path, string extension)
local files = getFilesInPath(getWorkingDirectory(), '*.lua')
for _, file in ipairs(files) do
    print(file)
end
-- или
sampRegisterChatCommand('getfonts', function()
    for index, name in ipairs(getFilesInPath(getFolderPath(0x14), '*.ttf'))
        print('[Font] #'..index, name)
    end
end)
 
Последнее редактирование:

ARMOR

kjor32 is legend
Модератор
4,851
6,081
Описание: Меняет цвет и прозрачность обводки чата.

Код:
Lua:
-- R1
function changeChatBorder(argb)
    memory.setuint32(sampGetBase() + 0x6392F, argb, true)
    memory.setuint32(sampGetBase() + 0x63973, argb, true)
    memory.setuint32(sampGetBase() + 0x639AC, argb, true)
    memory.setuint32(sampGetBase() + 0x639E8, argb, true)
    memory.setuint32(sampGetBase() + 0x63A24, argb, true)
    memory.setuint32(sampGetBase() + 0x63A5D, argb, true)
    memory.setuint32(sampGetBase() + 0x63A99, argb, true)
    memory.setuint32(sampGetBase() + 0x63ADC, argb, true)
end

--R3
function changeChatBorder(argb)
    memory.setuint32(sampGetBase() + 0x66D7F, argb, true)
    memory.setuint32(sampGetBase() + 0x66DC3, argb, true)
    memory.setuint32(sampGetBase() + 0x66DFC, argb, true)
    memory.setuint32(sampGetBase() + 0x66E38, argb, true)
    memory.setuint32(sampGetBase() + 0x66E74, argb, true)
    memory.setuint32(sampGetBase() + 0x66EAD, argb, true)
    memory.setuint32(sampGetBase() + 0x66EE9, argb, true)
    memory.setuint32(sampGetBase() + 0x66F2C, argb, true)
end

Пример использования:
Lua:
function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end

    changeChatBorder(0xFFFF0000)
 

    wait(-1)
end

function changeChatBorder(argb)
    memory.setuint32(sampGetBase() + 0x6392F, argb, true)
    memory.setuint32(sampGetBase() + 0x63973, argb, true)
    memory.setuint32(sampGetBase() + 0x639AC, argb, true)
    memory.setuint32(sampGetBase() + 0x639E8, argb, true)
    memory.setuint32(sampGetBase() + 0x63A24, argb, true)
    memory.setuint32(sampGetBase() + 0x63A5D, argb, true)
    memory.setuint32(sampGetBase() + 0x63A99, argb, true)
    memory.setuint32(sampGetBase() + 0x63ADC, argb, true)
end

Скриншот:
1663503926915.png
 
Последнее редактирование:

Vespan

loneliness
Проверенный
2,101
1,633
IMGUI*
Описание: imgui.ProgressBar но с анимацией
код:
Lua:
function imgui.AnimProgressBar(label,int,duration,size)
local function bringFloatTo(from, to, start_time, duration)
    local timer = os.clock() - start_time
    if timer >= 0.00 and timer <= duration then; local count = timer / (duration / 100); return from + (count * (to - from) / 100),timer,false
    end; return (timer > duration) and to or from,timer,true
end
    if int > 100 then imgui.TextColored(imgui.ImVec4(1,0,0,0.7),'error func imgui.AnimProgressBar(*),int > 100') return end
    if IMGUI_ANIM_PROGRESS_BAR == nil then IMGUI_ANIM_PROGRESS_BAR = {} end
    if IMGUI_ANIM_PROGRESS_BAR ~= nil and IMGUI_ANIM_PROGRESS_BAR[label] == nil then
        IMGUI_ANIM_PROGRESS_BAR[label] = {int = (int or 0),clock = 0}
    end
    local mf = math.floor
    local p = IMGUI_ANIM_PROGRESS_BAR[label];
    if (p['int']) ~= (int) then
        if p.clock == 0 then; p.clock = os.clock(); end
        local d = {bringFloatTo(p.int,int,p.clock,(duration or 2.25))}
        if d[1] > int  then
            if ((d[1])-0.01) < (int) then; p.clock = 0; p.int = mf(d[1]-0.01); end
        elseif d[1] < int then
            if ((d[1])+0.01) > (int) then; p.clock = 0; p.int = mf(d[1]+0.01); end
        end
        p.int = d[1];
    end
    imgui.PushStyleVar(6,15)
    imgui.PushStyleColor(imgui.Col.Text, imgui.ImVec4(0,0,0,0))
    imgui.PushStyleColor(imgui.Col.FrameBg, imgui.ImVec4(1, 1, 1, 0.20)) -- background color progress bar
    imgui.PushStyleColor(imgui.Col.PlotHistogram, imgui.ImVec4(1, 1, 1, 0.30)) -- fill color progress bar
    imgui.ProgressBar(p.int / 100,size or imgui.ImVec2(-1,15))
    imgui.PopStyleColor(3)
    imgui.PopStyleVar()
end
пример:
Lua:
        imgui.SliderInt('slider1',sliderInt,0,101)--int
        imgui.InputInt('input1*',input2)--duration
       
        imgui.AnimProgressBar('bruh',sliderInt.v,input2.v)
 

ARMOR

kjor32 is legend
Модератор
4,851
6,081
Описание: Смещает текст чата по оси X. ( R1, R3

Code:
Lua:
--R1
memory.setuint8(sampGetBase() + 0x63B09, int, true) -- Стандарт значение 2

--R3
memory.setuint8(sampGetBase() + 0x66F59, int, true) -- Стандарт значение 2

С использованием кода можно получить вот такой прикольный чат с эффектом "3D":
1663810260744.png
 
Последнее редактирование:

Vespan

loneliness
Проверенный
2,101
1,633
Описание:Кнопка без заливки типа
Код:
Lua:
function imgui.OutlineButton(text,size,set)
    if text == nil or type(text) ~= 'string' then imgui.Text('func imgui.OutlineButton(text,size,set); text = nil-not type string ') return end
    
    size = size or imgui.ImVec2((imgui.CalcTextSize(text).x*2),(imgui.CalcTextSize(text).y*2))
    set = set or {}
    set.Thickness = set.Thickness or 2
    set.Rounding = set.Rounding or 2
    set.Button = set.Button or imgui.GetStyle().Colors[23]
    set.ButtonHovered = set.ButtonHovered or imgui.GetStyle().Colors[24]
    set.Text = set.Text or imgui.GetStyle().Colors[1]

    local p = imgui.GetCursorScreenPos()
    local DL = imgui.GetWindowDrawList()
    local Color = set.Button
    local bool = false

    if imgui.InvisibleButton(text,size) then;    bool = true;    end
    if imgui.IsItemHovered() then;    Color = set.ButtonHovered;    end

    DL:AddText(imgui.ImVec2(p.x+5,p.y+(size.y/2/2)),imgui.ColorConvertFloat4ToU32(set.Text),text)
    DL:AddRect(imgui.ImVec2(p.x,p.y), imgui.ImVec2(p.x+(size.x/2)+10,p.y+size.y), imgui.ColorConvertFloat4ToU32(Color), set.Rounding, nil, set.Thickness)

    return bool
end
Пример использования:
Lua:
imgui.OutlineButton('imgui.OutlineButton by skuter Vespa LX 50',nil)
imgui.OutlineButton('example 2',nil,{Button=imgui.ImVec4(1,0,1,0.8),Rounding=10,Thickness=3})
1664385410070.png
 
  • Нравится
Реакции: ARMOR и why ega

Rice.

https://t.me/riceoff
Модератор
1,688
1,425
Описание: ToggleButton из админ тулса от Cosmo и Hatiko (скрин) (это не вырезано из скрипта, а сделано своими руками, может отличаться от оригинала)
Lua:
function imgui.custom_togglebutton(name, bool, size)
    local function bringFloatTo(from, to, start_time, duration)
        local timer = os.clock() - start_time
        if timer >= 0.00 and timer <= duration then
            local count = timer / (duration / 100)
            return from + (count * (to - from) / 100), true
        end
        return (timer > duration) and to or from, false
    end

    local rounding = imgui.GetStyle().FrameRounding
    local size = size or imgui.ImVec2(60, 25)
    local dl = imgui.GetWindowDrawList()
    local p = imgui.GetCursorScreenPos()

    if UI_CUSTOM_TOGGLEBUTTON == nil then UI_CUSTOM_TOGGLEBUTTON = {} end

    if UI_CUSTOM_TOGGLEBUTTON[name] == nil then
        UI_CUSTOM_TOGGLEBUTTON[name] = {
            argument = bool[0],
            bool = false,
            alignment = {bool[0] and size.x / 1.5 - 5 or 0, true},
            clock = 0
        }
    end

    local go_anim = true
    if UI_CUSTOM_TOGGLEBUTTON[name].argument ~= bool[0] then
        UI_CUSTOM_TOGGLEBUTTON[name].argument = bool[0]
        if go_anim then
            UI_CUSTOM_TOGGLEBUTTON[name].bool = true
            UI_CUSTOM_TOGGLEBUTTON[name].clock = os.clock()
        else
            UI_CUSTOM_TOGGLEBUTTON[name].alignment = {bool[0] and size.x / 1.5 - 5 or 0, true}
        end
    end

    local color = {
        constant_color = bool[0] and imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.CheckMark]) or imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.FrameBg]),
        temp_color = bool[0] and imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.CheckMark]) or imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.FrameBg])
    }

    local get_cursor_y = imgui.GetCursorPosY()
    if imgui.InvisibleButton(name, imgui.ImVec2(size)) then UI_CUSTOM_TOGGLEBUTTON[name].bool = true; UI_CUSTOM_TOGGLEBUTTON[name].clock = os.clock(); bool[0] = not bool[0] end
    if imgui.IsItemHovered() then color.temp_color = imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.FrameBgHovered]) end
    if imgui.IsItemActive() then color.temp_color = imgui.GetColorU32Vec4(imgui.GetStyle().Colors[imgui.Col.FrameBgActive]) end
    imgui.SameLine()
    imgui.BeginGroup()
    imgui.SetCursorPosY(get_cursor_y + (size.y - imgui.CalcTextSize(name).y) / 2)
    imgui.Text(name)
    imgui.EndGroup()

    if UI_CUSTOM_TOGGLEBUTTON[name].bool then
        UI_CUSTOM_TOGGLEBUTTON[name].alignment = {bringFloatTo((bool[0] and 0 or size.x / 1.5 - 5), (bool[0] and size.x / 1.5 - 5 or 0), UI_CUSTOM_TOGGLEBUTTON[name].clock, 0.3)}
        if UI_CUSTOM_TOGGLEBUTTON[name].alignment[2] == false then UI_CUSTOM_TOGGLEBUTTON[name].bool = false end
    end

    dl:AddRect(p, imgui.ImVec2(p.x + size.x, p.y + size.y), color.temp_color, rounding, nil, 2)
    dl:AddRectFilled(imgui.ImVec2(p.x + 5 + UI_CUSTOM_TOGGLEBUTTON[name].alignment[1], p.y + 5), imgui.ImVec2(p.x + size.x - size.x / 1.5 + UI_CUSTOM_TOGGLEBUTTON[name].alignment[1], p.y + size.y - 5), color.constant_color, rounding)
end
[!] Анимация при изменение значения bool другими средставами. Анимация будет воспроизводиться (во время открытия окна с ToggleButton), если изменить значение в одном меню, а потом открыть, меню с самим ToggleButton. Если Вы хотите это убрать, то УСТАНОВИТЕ переменной "go_anim" значение "false" [!]
Пример использования:
Lua:
imgui.Checkbox('[1] Checkbox', bool)
imgui.Text('[1] Bool: ' .. tostring(bool[0]))
imgui.custom_togglebutton('[1] Test', bool)
imgui.Separator()
imgui.Checkbox('[2] Checkbox', bool2)
imgui.Text('[2] Bool: ' .. tostring(bool2[0]))
imgui.custom_togglebutton('[2] Test', bool2, imgui.ImVec2(100, 100))
 

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,771
11,214
Описание: меняет атрибуты файла (например можно сделать файл скрытым или доступным только для чтения)
Код:
Lua:
function SetFileAttributes(file, ATTRIBUTE)
    local ffi = require('ffi')
    ffi.cdef([[
        bool SetFileAttributesA(
            const char* lpFileName,
            int  dwFileAttributes
        );
    ]])
    ffi.C.SetFileAttributesA(file, ATTRIBUTE)
end
Пример использования:
Lua:
local FILE_ATTRIBUTE = {
    ARCHIVE = 32, -- (0x20)
    HIDDEN = 2, -- (0x2)
    NORMAL = 128, -- (0x80)
    NOT_CONTENT_INDEXED = 8192, -- (0x2000)
    OFFLINE = 4096, -- (0x1000)
    READONLY = 1, -- (0x1)
    SYSTEM = 4, -- (0x4)
    TEMPORARY = 256, -- (0x100)
}

function SetFileAttributes(file, ATTRIBUTE)
    local ffi = require('ffi')
    ffi.cdef([[
        bool SetFileAttributesA(
            const char* lpFileName,
            int  dwFileAttributes
        );
    ]])
    ffi.C.SetFileAttributesA(file, ATTRIBUTE)
end

function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('hide', function()
        SetFileAttributes(thisScript().path, FILE_ATTRIBUTE.HIDDEN)
        sampAddChatMessage('Done!', -1)
    end)
    wait(-1)
end
список атрибутов
 
Последнее редактирование:

ARMOR

kjor32 is legend
Модератор
4,851
6,081
Описание: Изменяет цвет карты на радаре
Lua:
function editRadarMapColor(R, G, B)
    memory.setuint8(0x5864CC, R, true)
    memory.setuint8(0x5864C7, G, true)
    memory.setuint8(0x5864C2, B, true)
    -- еще есть Alpha канал, но эффекта нету после изменения
end
Пример использования:
Lua:
editRadarMapColor(255, 0, 0)
Посмотреть вложение 70078
Всмысле нет эффекта после изменения?
Всё есть.
1664817113387.png

Lua:
memory = require 'memory'

memory.setuint8(0x5864BD, Alpha, true)
 
  • Нравится
Реакции: g305noobo

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,771
11,214
Описание: позволяет узнать цвет пикселя
Код:
Lua:
local ffi = require("ffi")
ffi.cdef([[
    int GetDC(void* hWnd);
    unsigned long GetPixel(int hdc,int x,int y);
]])
function getPixelColor(x, y)
    return ffi.C.GetPixel(ffi.C.GetDC(nil), x, y)
end
Пример использования:
Lua:
print(string.format("0x%x", getPixelColor(200, 200)))
 
Последнее редактирование модератором:

ARMOR

kjor32 is legend
Модератор
4,851
6,081
Описание: Устанавливает выравнивание 3DText'а ( Типо центрирование, с левой стороны и т.д )

Код:
Lua:
local memory = require 'memory'

memory.setuint16(getModuleHandle("samp.dll") + 0x676D5, int, true)
--[[
Параметры:
256 - С левой стороны
257 - Центрирование ( Стандартный параметр )
258 - С правой сторны
Вообще там можно и другие ставить, и искать параметры, но мне лень
]]

1.jpg
2.jpg

Описание: Отключает обводку ников в неймтегах

Код:
Lua:
local memory = require 'memory'

memory.setuint8(getModuleHandle("samp.dll") + 0x6884A, 0, true)

Описание: Меняет цвет картинки того что игрок в АФК

Код:
Lua:
local memory = require 'memory'
memory.setuint32(getModuleHandle("samp.dll") + 0x6897B, ARGB, true) -- Картинка песочных часов
memory.setuint32(getModuleHandle("samp.dll") + 0x6895C, ARGB, true) -- Фон

Скриншот:
1665525774804.png


Описание: Отключает картинку которая показывает что игрок АФК

Код:
Lua:
local memory = require 'memory'
memory.setuint8(getModuleHandle("samp.dll") + 0x68990, 0, true) -- Картинка песочных часов
memory.setuint8(getModuleHandle("samp.dll") + 0x6896B, 0, true) -- Фон

-- Стандартные значения: 1

Описание: Смещает ники игроков по высоте

Код:
Lua:
local memory = require 'memory'

memory.setuint8(sampGetBase() + 0x6885F, int, true) -- Чем больше значение, тем ниже будет опускаться ник. Стандартное значение: 17.

Скриншот:
1665563412934.png
 
Последнее редактирование:

Savchik Blazer

Но я, мечту свою лелея...
Проверенный
671
293
функции позволяют работать с RCON командами без rcon.exe, вне зависимости от версии SA-MP

функции
Lua:
RL.init(ip, host, password) --вход в rcon
Lua:
RL.sendRconCommand(команда) --тут думаю понятно

Lua:
local RL = require("RconLUA")
function main()
     if not isSampLoaded() or not isSampfuncsLoaded() then return end
        while not isSampAvailable() do wait(100) end
        RL.init("127.0 0.1", "7777", "parol")
        sampRegisterChatCommand("kick", kickPlayer)
           while true do
             wait(0)
  end
end

function kickPlayer(playerid)
    RL.sendRconCommand(string.format("kick %d", playerid))
end

функции позволяют работать с RCON командами без rcon.exe, вне зависимости от версии SA-MP

функции
Lua:
RL.init(ip, host, password) --вход в rcon
Lua:
RL.sendRconCommand(команда) --тут думаю понятно

Lua:
local RL = require("RconLUA")
function main()
     if not isSampLoaded() or not isSampfuncsLoaded() then return end
        while not isSampAvailable() do wait(100) end
        RL.init("127.0 0.1", "7777", "parol")
        sampRegisterChatCommand("kick", kickPlayer)
           while true do
             wait(0)
  end
end

function kickPlayer(playerid)
    RL.sendRconCommand(string.format("kick %d", playerid))
end
Забыл еще упомянуть, в отличии от sampSendRconCommand, вы можете отправить rcon команду серверу вне зависимости от вашего текущего сервера
 

Вложения

  • RconLUA.dll
    13 KB · Просмотры: 11
Последнее редактирование: