Эксперт
- Статус
- Оффлайн
- Регистрация
- 24 Апр 2018
- Сообщения
- 1,507
- Реакции
- 933
Всем привет! Делаю тут пасту стакхака. Хочу добавить металик чамсы.
Пастил код из темы Opai(https://yougame.biz/threads/38660)
Вот сам код от туда.
Мой код чамсов из стакхака
Нихрена не разобрался. Хеееелп.
Пастил код из темы Opai(https://yougame.biz/threads/38660)
Вот сам код от туда.
Код:
std::ofstream("csgo\\materials\\simple_ignorez_reflective.vmt") << R"#("VertexLitGeneric"
{
"$basetexture" "vgui/white_additive"
"$ignorez" "1"
"$envmap" "env_cubemap"
"$normalmapalphaenvmapmask" "1"
"$envmapcontrast" "1"
"$nofog" "1"
"$model" "1"
"$nocull" "0"
"$selfillum" "1"
"$halflambert" "1"
"$znearer" "0"
"$flat" "1"
}
)#";
std::ofstream("csgo\\materials\\simple_regular_reflective.vmt") << R"#("VertexLitGeneric"
{
"$basetexture" "vgui/white_additive"
"$ignorez" "0"
"$envmap" "env_cubemap"
"$normalmapalphaenvmapmask" "1"
"$envmapcontrast" "1"
"$nofog" "1"
"$model" "1"
"$nocull" "0"
"$selfillum" "1"
"$halflambert" "1"
"$znearer" "0"
"$flat" "1"
}
)#";
materialMetall = g_pMaterialSystem->FindMaterial("simple_ignorez_reflective", TEXTURE_GROUP_MODEL);
materialMetallnZ = g_pMaterialSystem->FindMaterial("simple_regular_reflective", TEXTURE_GROUP_MODEL);
Мой код чамсов из стакхака
Код:
void CChams::InitKeyValues(SDK::KeyValues* kv_, std::string name_)
{
static auto address = UTILS::FindSignature("client.dll", "55 8B EC 51 33 C0 C7 45");
using Fn = void(__thiscall*)(void* thisptr, const char* name);
reinterpret_cast< Fn >(address)(kv_, name_.c_str());
}
void CChams::LoadFromBuffer(SDK::KeyValues* vk_, std::string name_, std::string buffer_)
{
static auto address = UTILS::FindSignature("client.dll", "55 8B EC 83 E4 F8 83 EC 34 53 8B 5D 0C 89 4C 24 04");
using Fn = void(__thiscall*)(
void* thisptr, const char* resourceName,
const char* pBuffer, void* pFileSystem,
const char* pPathID, void* pfnEvaluateSymbolProc);
reinterpret_cast< Fn >(address)(
vk_, name_.c_str(), buffer_.c_str(), nullptr, nullptr, nullptr);
}
SDK::IMaterial* CChams::CreateMaterial(bool ignorez, bool lit, bool wireframe)
{
static auto created = 0;
std::string type = lit ? "VertexLitGeneric" : "UnlitGeneric";
auto matdata =
"\"" + type + "\"\
\n{\
\n\t\"$basetexture\" \"vgui/white_additive\"\
\n\t\"$envmap\" \"\"\
\n\t\"$model\" \"1\"\
\n\t\"$flat\" \"1\"\
\n\t\"$nocull\" \"0\"\
\n\t\"$selfillum\" \"1\"\
\n\t\"$halflambert\" \"1\"\
\n\t\"$nofog\" \"0\"\
\n\t\"$ignorez\" \"" + std::to_string(ignorez) + "\"\
\n\t\"$znearer\" \"0\"\
\n\t\"$wireframe\" \"" + std::to_string(wireframe) + "\"\
\n}\n";
auto matname = "custom_" + std::to_string(created);
++created; auto keyValues = static_cast< SDK::KeyValues* >(malloc(sizeof(SDK::KeyValues)));
InitKeyValues(keyValues, type.c_str());
LoadFromBuffer(keyValues, matname, matdata);
auto material =
INTERFACES::MaterialSystem->CreateMaterial(matname.c_str(), keyValues);
material->IncrementReferenceCount();
return material;
}
CChams* chams = new CChams();
Нихрена не разобрался. Хеееелп.