Article ChatPrintF

DREDD

Administrator
Administrator

DREDD

Administrator
Administrator
Status
Offline
Joined
Apr 18, 2019
Messages
191
Reaction score
323
Initialize g_ChatElement
Code:
g_ChatElement = FindHudElement<CHudChat>("CHudChat");

Initialize class CHudChat:
Code:
class CHudChat
{
public:
    void ChatPrintf(int iPlayerIndex, int iFilter, const char* fmt, ...)
    {

        call_vfunc<void(__cdecl*)(void*, int, int, const char*, ...)>(this, 27)(this, iPlayerIndex, iFilter, fmt);

    }
};

Initialize FindHudElement:
Code:
static T* FindHudElement(const char* name)
{

    static auto pThis = *reinterpret_cast<DWORD**>(U::pattern_scan(GetModuleHandleA(U::ClientModule()), "B9 ? ? ? ? 68 ? ? ? ? E8 ? ? ? ? 89 46 24") + 1);

    static auto find_hud_element = reinterpret_cast<DWORD(__thiscall*)(void*, const char*)>(U::pattern_scan(GetModuleHandleA(U::ClientModule()), "55 8B EC 53 8B 5D 08 56 57 8B F9 33 F6 39"));

    return (T*)find_hud_element(pThis, name);

}

Self conclusion:
Code:
g_ChatElement->ChatPrintf(0, 0, " ""\x04""%s bought %s\n", pinfo.name, gun.c_str());

You can also use different colors:
g0aQh2X.png

Example:
Code:
g_ChatElement->ChatPrintf(0, 0, " \x01""[""\x03""OurPaste""\x01""]""\x04""Config Saved");
 
Top