[Code] Some materials for your chams + my esp code
I include some materials in your chams. Some materials didn't support color change. If you want i can show my esp code(with boxes, health, snaplines, nicknames and weapon names) Chams.h
#pragma once
#include "../SDK/ModelRender.h"
class Chams {
public:
Chams() noexcept;
void render(void*, void*, const ModelRenderInfo&, matrix3x4*) const noexcept;
void renderPlayers(void*, void*, const ModelRenderInfo&, matrix3x4*) const noexcept;
void renderWeapons() const noexcept;
void renderHands() const noexcept;
private:
Material* normal;
Material* flat;
Material* palm;
Material* platinum;
Material* glass;
Material* crystal;
Material* chrome;
Material* gold;
Material* glow;
Material* plastic;
Material* blinking;
constexpr auto dispatchMaterial(int id) const noexcept
{
switch (id) {
default:
case 0: return normal;
case 1: return flat;
case 2: return palm;
case 3: return platinum;
case 4: return glass;
case 5: return chrome;
case 6: return crystal;
case 7: return gold;
case 8: return glow;
case 9: return plastic;
case 10: return blinking;
}
}
};
Chams.cpp
#include <fstream>
#include "Chams.h"
#include "../Config.h"
#include "../Hooks.h"
#include "../Interfaces.h"
Chams::Chams() noexcept
{
std::ofstream{ "csgo/materials/chamsNormal.vmt" } <<
"VertexLitGeneric { }";
std::ofstream{ "csgo/materials/chamsFlat.vmt" } <<
"UnlitGeneric { }";
normal = interfaces.materialSystem->findMaterial("chamsNormal");
normal->incrementReferenceCount();
flat = interfaces.materialSystem->findMaterial("chamsFlat");
flat->incrementReferenceCount();
palm = interfaces.materialSystem->findMaterial("models/props/de_dust/hr_dust/foliage/palm_bark_01");
palm->incrementReferenceCount();
platinum = interfaces.materialSystem->findMaterial("models/player/ct_fbi/ct_fbi_glass");
platinum->incrementReferenceCount();
glass = interfaces.materialSystem->findMaterial("models/inventory_items/cologne_prediction/cologne_prediction_glass");
glass->incrementReferenceCount();
crystal = interfaces.materialSystem->findMaterial("models/inventory_items/trophy_majors/crystal_clear");
crystal->incrementReferenceCount();
gold = interfaces.materialSystem->findMaterial("models/inventory_items/trophy_majors/gold");
gold->incrementReferenceCount();
chrome = interfaces.materialSystem->findMaterial("models/gibs/glass/glass");
chrome->incrementReferenceCount();
plastic = interfaces.materialSystem->findMaterial("models/inventory_items/trophy_majors/gloss");
plastic->incrementReferenceCount();
glow = interfaces.materialSystem->findMaterial("vgui/achievements/glow");
glow->incrementReferenceCount();
blinking = interfaces.materialSystem->findMaterial("models/inventory_items/dogtags/dogtags_outline");
blinking->incrementReferenceCount();
}
// after nothing changed
GUI.cpp
ImGui::Combo("Material", &config.chams[currentItem].material, "Normal\0Flat\0Palm\0Platinum\0Glass\0Chrome\0Crystal\0Gold\0Glow\0Plastic\0Blinking");
The esp codes would be handy.
esp.h, esp.cpp, struct for config.h and renderESPwindow() GUI.cpp ESP::render() hook at PaintTraserve ESP window needs corrections(wrong window sizes) coded for Osiris 30/03/19
you forgot ccolor.h
and blinking color should be changeable ( refrence - shonax's stickrpghook)
CColor.h
#pragma once
#include "imgui/imgui.h"
class CColor
{
public:
unsigned char RGBA[4];
CColor()
{
*((int *)this) = 0;
}
CColor(float _rgb[3])
{
SetColor((int)(_rgb[0] * 255.0f), (int)(_rgb[1] * 255.0f), (int)(_rgb[2] * 255.0f), (int)(_rgb[3] * 255.0f));
}
CColor(int color32)
{
*((int *)this) = color32;
}
CColor(int _r, int _g, int _b)
{
SetColor(_r, _g, _b, 255);
}
CColor(int _r, int _g, int _b, int _a)
{
SetColor(_r, _g, _b, _a);
}
void SetColor(int _r, int _g, int _b, int _a = 255)
{
RGBA[0] = (unsigned char)_r;
RGBA[1] = (unsigned char)_g;
RGBA[2] = (unsigned char)_b;
RGBA[3] = (unsigned char)_a;
}
void GetColor(int& _r, int& _g, int& _b, int& _a) const
{
_r = RGBA[0];
_g = RGBA[1];
_b = RGBA[2];
_a = RGBA[3];
}
void SetRawColor(int color32)
{
*((int*)this) = color32;
}
int GetRawColor() const
{
return *((int*)this);
}
int GetD3DColor() const
{
return ((int)((((RGBA[3]) & 0xff) << 24) | (((RGBA[0]) & 0xff) << 16) | (((RGBA[1]) & 0xff) << 8) | ((RGBA[2]) & 0xff)));
}
inline int r() const
{
return RGBA[0];
}
inline int g() const
{
return RGBA[1];
}
inline int b() const
{
return RGBA[2];
}
inline int a() const
{
return RGBA[3];
}
inline float rBase() const
{
return RGBA[0] / 255.0f;
}
inline float gBase() const
{
return RGBA[1] / 255.0f;
}
inline float bBase() const
{
return RGBA[2] / 255.0f;
}
inline float aBase() const
{
return RGBA[3] / 255.0f;
}
unsigned char& operator[](int index)
{
return RGBA[index];
}
const unsigned char& operator[](int index) const
{
return RGBA[index];
}
bool operator ==(const CColor& rhs) const
{
return (*((int *)this) == *((int *)&rhs));
}
bool operator !=(const CColor& rhs) const
{
return !(operator==(rhs));
}
CColor& operator=(const CColor& rhs)
{
SetRawColor(rhs.GetRawColor());
return *this;
}
float* Base()
{
float clr[3];
clr[0] = RGBA[0] / 255.0f;
clr[1] = RGBA[1] / 255.0f;
clr[2] = RGBA[2] / 255.0f;
return &clr[0];
}
float* BaseAlpha()
{
float clr[4];
clr[0] = RGBA[0] / 255.0f;
clr[1] = RGBA[1] / 255.0f;
clr[2] = RGBA[2] / 255.0f;
clr[3] = RGBA[3] / 255.0f;
return &clr[0];
}
float Hue() const
{
if (RGBA[0] == RGBA[1] && RGBA[1] == RGBA[2])
{
return 0.0f;
}
float r = RGBA[0] / 255.0f;
float g = RGBA[1] / 255.0f;
float b = RGBA[2] / 255.0f;
float max = r > g ? r : g > b ? g : b,
min = r < g ? r : g < b ? g : b;
float delta = max - min;
float hue = 0.0f;
if (r == max)
{
hue = (g - b) / delta;
}
else if (g == max)
{
hue = 2 + (b - r) / delta;
}
else if (b == max)
{
hue = 4 + (r - g) / delta;
}
hue *= 60;
if (hue < 0.0f)
{
hue += 360.0f;
}
return hue;
}
float Saturation() const
{
float r = RGBA[0] / 255.0f;
float g = RGBA[1] / 255.0f;
float b = RGBA[2] / 255.0f;
float max = r > g ? r : g > b ? g : b,
min = r < g ? r : g < b ? g : b;
float l, s = 0;
if (max != min)
{
l = (max + min) / 2;
if (l <= 0.5f)
s = (max - min) / (max + min);
else
s = (max - min) / (2 - max - min);
}
return s;
}
float Brightness() const
{
float r = RGBA[0] / 255.0f;
float g = RGBA[1] / 255.0f;
float b = RGBA[2] / 255.0f;
float max = r > g ? r : g > b ? g : b,
min = r < g ? r : g < b ? g : b;
return (max + min) / 2;
}
static CColor FromHSB(float hue, float saturation, float brightness)
{
float h = hue == 1.0f ? 0 : hue * 6.0f;
float f = h - (int)h;
float p = brightness * (1.0f - saturation);
float q = brightness * (1.0f - saturation * f);
float t = brightness * (1.0f - (saturation * (1.0f - f)));
if (h < 1)
{
return CColor(
(unsigned char)(brightness * 255),
(unsigned char)(t * 255),
(unsigned char)(p * 255)
);
}
else if (h < 2)
{
return CColor(
(unsigned char)(q * 255),
(unsigned char)(brightness * 255),
(unsigned char)(p * 255)
);
}
else if (h < 3)
{
return CColor(
(unsigned char)(p * 255),
(unsigned char)(brightness * 255),
(unsigned char)(t * 255)
);
}
else if (h < 4)
{
return CColor(
(unsigned char)(p * 255),
(unsigned char)(q * 255),
(unsigned char)(brightness * 255)
);
}
else if (h < 5)
{
return CColor(
(unsigned char)(t * 255),
(unsigned char)(p * 255),
(unsigned char)(brightness * 255)
);
}
else
{
return CColor(
(unsigned char)(brightness * 255),
(unsigned char)(p * 255),
(unsigned char)(q * 255)
);
}
}
};
GetAbsOrigin is call a 10 virtual function GetRenderBounds is call a 17 virtual function (this + 0x4, 17, Vector& mins, Vector& maxs)
Thanks for the esp code mate, appreciated
I don't have interfaces.engine->GetScreenSize()
@JohnRich1372 You can use Surface::getScreenSize()
constexpr auto getScreenSize(int& width, int& height) noexcept
{
callVirtualFunction<void, int&, int&>(this, 5, width, height);
}
Oh, okay thanks.
I'm receiving a lot of errors.
Debug them maybe
new esp.h, new esp.cpp, ccolor.h, entity.h, config.h, engine.h, renderESPwindow() GUI.cpp, weaponid.h Now for new Osiris. C4 esp didn't work. Maybe you help to fix.
Thank you for including all the files, it fixed the errors that I was having. But my CS:GO is crashing if I join a game.
@JohnRich1372 Show your settings please.
no, osiris settings
Like my config?
Yes.
I don't even have anything enabled but it still crashes.