Исходник Weapon Chams (Local)

Начинающий
Статус
Оффлайн
Регистрация
13 Авг 2022
Сообщения
132
Реакции[?]
12
Поинты[?]
5K
Base Used: asphyxia
Note; I'm using a custom version of asphyxia, I've rewritten about 79% of the code so I won't give source until it's finished completely. Unless you request to purchase it and offer a good price.

If you see anything regarding 'Local Chams' just ignore it. I have it working just won't give it out yet.

chams.h:
bool OverrideWeaponMaterial(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2);
chams.cpp:
// add this in your OnDrawObject
if (CRT::StringCompare(pClassInfo->szName, CS_XOR("C_CSPlayerPawn")) == 0)
{
    if (pEntity == SDK::LocalPawn)
    {
        if (C_GET(bool, Vars.bVisualLocalChams))
            return OverrideLocalPlayerMaterial(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);
    }
    else if (C_GET(bool, Vars.bVisualChams))
    {
        return OverrideMaterial(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);
    }
}
else if (CRT::StringCompare(pClassInfo->szName, CS_XOR("C_CSGOViewModel")) == 0)
{
    if (C_GET(bool, Vars.bVisualWeaponChams))
        return OverrideWeaponMaterial(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);
}

// add this after your 'OnDrawObject' function
bool F::VISUALS::CHAMS::OverrideWeaponMaterial(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2)
{
    if (arrMeshDraw->pSceneAnimatableObject == nullptr)
        return false;

    CBaseHandle hOwner = arrMeshDraw->pSceneAnimatableObject->hOwner;

    auto pEntity = I::GameResourceService->pGameEntitySystem->Get<C_BaseEntity>(hOwner);
    if (pEntity == nullptr)
        return false;

    SchemaClassInfoData_t* pClassInfo;
    pEntity->GetSchemaClassInfo(&pClassInfo);
    if (pClassInfo == nullptr || CRT::StringCompare(pClassInfo->szName, CS_XOR("C_CSGOViewModel")) != 0)
        return false;

    // Apply weapon chams here
    const auto oDrawObject = H::hkDrawObject.GetOriginal();
    const CustomMaterial_t customMaterial = arrMaterials[C_GET(int, Vars.nVisualWeaponChamMaterial)];

    arrMeshDraw->pMaterial = customMaterial.pMaterial;
    arrMeshDraw->colValue = C_GET(Color_t, Vars.colVisualWeaponChams);
    oDrawObject(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);

    return true;
}
 
Сверху Снизу