Поменять цвет ника визуально

plalkeo

Известный
Автор темы
834
332
Версия MoonLoader
.026-beta
Всем привет, играю на аризоне
Хотелось бы узнать, можно ли поменять цвет ника у игрока поблизости, но оставить цвет его ника в табе?
например состоит игрок в грувах - когда я к нему подъезжаю цвет ника меняется на синий, но в табе он продолжает быть зеленым
такое возможно?
 
Решение
Lua:
local hooks = require("hooks")


local originalPlayerTagsDrawLabel


function main()
    originalPlayerTagsDrawLabel = hooks.jmp.new(
        "void(__thiscall*)(void *this, void *pPosition, const char *szText, char color, float fDistanceToCamera, bool bDrawStatus, int nStatus)",
        PlayerTagsDrawLabelHooked, getModuleHandle("samp.dll") + 0x6C630 -- R3
    )
end

function PlayerTagsDrawLabelHooked(this, pPosition, szText, color, ...)
    color = -1 -- ARGB
    return originalPlayerTagsDrawLabel(this, pPosition, szText, color, ...)
end

whyega52

Eblang головного мозга
Модератор
2,846
2,802
Lua:
local hooks = require("hooks")


local originalPlayerTagsDrawLabel


function main()
    originalPlayerTagsDrawLabel = hooks.jmp.new(
        "void(__thiscall*)(void *this, void *pPosition, const char *szText, char color, float fDistanceToCamera, bool bDrawStatus, int nStatus)",
        PlayerTagsDrawLabelHooked, getModuleHandle("samp.dll") + 0x6C630 -- R3
    )
end

function PlayerTagsDrawLabelHooked(this, pPosition, szText, color, ...)
    color = -1 -- ARGB
    return originalPlayerTagsDrawLabel(this, pPosition, szText, color, ...)
end
 
  • Нравится
Реакции: plalkeo

plalkeo

Известный
Автор темы
834
332
Lua:
local hooks = require("hooks")


local originalPlayerTagsDrawLabel


function main()
    originalPlayerTagsDrawLabel = hooks.jmp.new(
        "void(__thiscall*)(void *this, void *pPosition, const char *szText, char color, float fDistanceToCamera, bool bDrawStatus, int nStatus)",
        PlayerTagsDrawLabelHooked, getModuleHandle("samp.dll") + 0x6C630 -- R3
    )
end

function PlayerTagsDrawLabelHooked(this, pPosition, szText, color, ...)
    color = -1 -- ARGB
    return originalPlayerTagsDrawLabel(this, pPosition, szText, color, ...)
end
спасибо большое!

Lua:
local hooks = require("hooks")


local originalPlayerTagsDrawLabel


function main()
    originalPlayerTagsDrawLabel = hooks.jmp.new(
        "void(__thiscall*)(void *this, void *pPosition, const char *szText, char color, float fDistanceToCamera, bool bDrawStatus, int nStatus)",
        PlayerTagsDrawLabelHooked, getModuleHandle("samp.dll") + 0x6C630 -- R3
    )
end

function PlayerTagsDrawLabelHooked(this, pPosition, szText, color, ...)
    color = -1 -- ARGB
    return originalPlayerTagsDrawLabel(this, pPosition, szText, color, ...)
end
а не подскажешь, можно ли как-то добавлять свои картинки к плэер тегам этим?)
типо справа или слева от ника свою картиночку)
 

whyega52

Eblang головного мозга
Модератор
2,846
2,802
Lua:
local hooks = require("hooks")


local originalPlayerTagsDrawLabel


function main()
    originalPlayerTagsDrawLabel = hooks.jmp.new(
        "void(__thiscall*)(void *this, void *pPosition, const char *szText, char color, float fDistanceToCamera, bool bDrawStatus, int nStatus)",
        PlayerTagsDrawLabelHooked, getModuleHandle("samp.dll") + 0x6C630 -- R3
    )
end

function PlayerTagsDrawLabelHooked(this, pPosition, szText, color, ...)
    color = -1 -- ARGB
    return originalPlayerTagsDrawLabel(this, pPosition, szText, color, ...)
end
Используй mimgui или рисуй текстуру через https://wiki.blast.hk/ru/moonloader/lua/renderDrawTexture
Lua:
local hooks = require("hooks")


ffi.cdef[[
    typedef struct {
        float x;
        float y;
        float z;
    } Vector3D;
]]


local originalPlayerTagsDrawLabel


function main()
    originalPlayerTagsDrawLabel = hooks.jmp.new(
        "void(__thiscall*)(void *this, Vector3D *position, const char *text, char color, float distanceToCamera, bool drawStatus, int status)",
        PlayerTagsDrawLabelHooked, getModuleHandle("samp.dll") + 0x6C630 -- R3
    )
end

function PlayerTagsDrawLabelHooked(this, position, text, color, ...)
    color = -1 -- ARGB
    local x, y = convert3DCoordsToScreen(position.x, position.y, position.z)
    -- рендеришь на этих координатах то, что тебе надо
    return originalPlayerTagsDrawLabel(this, pPosition, szText, color, ...)
end
 
  • Нравится
Реакции: plalkeo