Верны ли эти оффсеты помогите пожалуйста

pa$$Ter
Начинающий
Статус
Оффлайн
Регистрация
5 Янв 2018
Сообщения
75
Реакции[?]
14
Поинты[?]
0
Код:
DWORD m_hMyWeapons = 0x2DF8;
    DWORD m_hMyWearables = 0x2F04;
    DWORD m_hViewModel = 0x0000;
    DWORD m_nTickBase = 0x342C;
    DWORD m_flFlashMaxAlpha = 0xA3DC;
    DWORD m_iObserverMode = 0x3374;
    DWORD m_hObserverTarget = 0x3348;

    DWORD deadflag = 0x31D4;

    DWORD m_lifeState = 0x025F;
    DWORD m_flFlashDuration = 0xA3E0;

    DWORD m_iAccount = 0xB314;

    DWORD m_bHasHelmet = 0xB31C;
    DWORD m_bHasDefuser = 0xB338;

    DWORD m_flDefuseCountDown = 0x29AC;
    DWORD m_flC4Blow = 0x2990;
    DWORD m_hBombDefuser = 0x29B4;
    DWORD m_bBombDefused = 0x29B0;

    DWORD m_bIsScoped = 0x390A;

    DWORD m_iFOVStart = 0x31E8;
    DWORD m_fFlags = 0x0104;

    DWORD m_iHealth = 0x0100;
    DWORD m_ArmorValue = 0xB328;
    DWORD m_iTeamNum = 0x0B68;
    DWORD m_iShotsFired = 0xA370;

    DWORD m_aimPunchAngle = 0x302C;
    DWORD m_viewPunchAngle = 0x3020;


    DWORD m_flSimulationTime = 0x0268;


    DWORD m_vecVelocity = 0x0114;
    DWORD m_vecViewOffset = 0x0108;
    DWORD m_vecPunchAngles = 0;

    DWORD m_vecOrigin = 0x09D8;

    DWORD m_bIsDefusing = 0x3914;

    DWORD m_angEyeAngles = 0xB32C;

    DWORD m_hActiveWeapon = 0x2EF8;

    DWORD m_iClip1 = 0x3244;
    DWORD m_iClip2 = 0x3248;
    DWORD m_flNextPrimaryAttack = 0x3218;
    DWORD m_iWorldModelIndex = 0x3224;
    DWORD m_bCanReload = 0;

    DWORD m_iItemDefinitionIndex = 0x2FAA;
    DWORD m_iItemIDHigh = 0x2FC0;
    DWORD m_iAccountID = 0x2FC8;
    DWORD m_iEntityQuality = 0x2FAC;
    DWORD m_OriginalOwnerXuidLow = 0x31B0;
    DWORD m_OriginalOwnerXuidHigh = 0x31B4;
    DWORD m_nFallbackPaintKit = 0x31B8;
    DWORD m_flFallbackWear = 0x31C0;
    DWORD m_nFallbackSeed = 0x31BC;
    DWORD m_nFallbackStatTrak = 0x31C4;
    DWORD m_szCustomName = 0x303C;
    DWORD m_hWeaponWorldModel = 0x3234;
    DWORD m_bIsAutoaimTarget = 0x0060;

    DWORD m_nModelIndex = 0x0258;
    DWORD m_iViewModelIndex = 0x3220;
    DWORD m_hOwner = 0x3210;
    DWORD m_hWeapon = 0x29C8;
    DWORD m_bSpotted = 0x093D;

    DWORD m_zoomLevel = 0x3390;

    DWORD KeyValues_KeyValues = 0;
    DWORD KeyValues_LoadFromBuffer = 0;

    DWORD m_CollisionGroup = 0x0474;
    DWORD m_rgflCoordinateFrame = 0x0044;

    DWORD m_vecMins = 0x0324;
    DWORD m_vecMaxs = 0x0330;
 
Последнее редактирование:
pa$$Ter
Начинающий
Статус
Оффлайн
Регистрация
5 Янв 2018
Сообщения
75
Реакции[?]
14
Поинты[?]
0
если да, то почему не работает вх, если нет, то укажите в каком месте я даун
 
0ldB8y
Пользователь
Статус
Оффлайн
Регистрация
8 Дек 2018
Сообщения
133
Реакции[?]
63
Поинты[?]
0
pa$$Ter
Начинающий
Статус
Оффлайн
Регистрация
5 Янв 2018
Сообщения
75
Реакции[?]
14
Поинты[?]
0
pa$$Ter
Начинающий
Статус
Оффлайн
Регистрация
5 Янв 2018
Сообщения
75
Реакции[?]
14
Поинты[?]
0
pa$$Ter
Начинающий
Статус
Оффлайн
Регистрация
5 Янв 2018
Сообщения
75
Реакции[?]
14
Поинты[?]
0
C++:
#include "Entity.h"
#include "../Initialize/Offsets.h"

#define ptr( x, x1, x2 ) *(x*)( (DWORD)x1 + (DWORD)x2 )

using namespace Engine;

namespace SDK
{
    int& IClientEntity::GetModelIndex()
    {
        // DT_BaseViewModel -> m_nModelIndex
        return *(int*)((DWORD)this + offsets["m_nModelIndex"]);
    }

    CBaseEntity *IClientEntityList::GetClientEntityFromHandleknife(HANDLE hEnt)
    {
        typedef CBaseEntity* (__thiscall* OriginalFn)(PVOID, HANDLE);
        return GetFunction<OriginalFn>(this, 4)(this, hEnt);
    }
}

namespace Engine
{

    char* CBaseEntity::GetPlayerName()
    {
        if ( IsPlayer() )
        {
            static PlayerInfo Info;

            if ( I::Engine()->GetPlayerInfo( EntIndex() , &Info ) )
                return Info.m_szPlayerName;
        }

        return "";
    }


    bool CBaseEntity::IsPlayer()
    {
        typedef bool( __thiscall* IsPlayerFn )( void* );
        return GetMethod<IsPlayerFn>( this , 152 )( this );
    }


    bool CBaseEntity::m_bIsDefusing()
    {

        return *(bool*)((DWORD)this + offsets["m_bIsDefusing"]);
        //Main::NetVar->GetOffset(XorStr("DT_CSPlayer"), XorStr("m_bIsDefusing"));
    }

    Vector CBaseEntity::GetOrigin()
    {
        return *(Vector*)((DWORD)this + offsets["m_vecOrigin"]);
    }
    bool CBaseEntity::IsValid()
    {
        if (!this)
            return false;
        else
            return (!IsDead() && GetHealth() > 0 && !IsDormant());
    }

    bool CBaseEntity::IsDead()
    {
        BYTE LifeState = *(PBYTE)( ( DWORD )this + offsets["m_lifeState"]);//m_flFlashDuration
        return ( LifeState != LIFE_ALIVE );
    }
    float CBaseEntity::GetFlashDuration()
    {
        return *(float*)((DWORD)this + offsets["m_flFlashDuration"]);
    }
    bool CBaseEntity::IsFlashed()
    {
        return GetFlashDuration() > 0;
    }

    int CBaseEntity::GetMoney()
    {
        return *(int*)((DWORD)this + offsets["m_iAccount"]);
    }

    bool CBaseEntity::IsVisible( CBaseEntity* pLocalEntity )
    {
        if ( !pLocalEntity->IsValid() )
            return false;

        Vector vSrcOrigin = pLocalEntity->GetEyePosition();

        if ( vSrcOrigin.IsZero() || !vSrcOrigin.IsValid() )
            return false;

        BYTE bHitBoxCheckVisible[6] = {
            HITBOX_HEAD,
            HITBOX_LOWER_CHEST,
            HITBOX_RIGHT_FOOT,
            HITBOX_LEFT_FOOT,
            HITBOX_RIGHT_HAND,
            HITBOX_LEFT_HAND,
        };

        CTraceFilter filter;

        filter.pSkip = pLocalEntity;

        for ( int nHit = 0; nHit < 6; nHit++ )
        {
            Vector vHitBox = GetBonePosition( bHitBoxCheckVisible[nHit] );

            if ( vHitBox.IsZero() || !vHitBox.IsValid() )
                continue;

            trace_t tr;
            Ray_t ray;

            ray.Init( vSrcOrigin , vHitBox );

            I::EngineTrace()->TraceRay( ray , PlayerVisibleMask , &filter , &tr );

            if ( tr.m_pEnt == (IClientEntity*)this && !tr.allsolid )
                return true;
        }

        return false;
    }

    bool CBaseEntity::IsVisibleHitBox(CBaseEntity* pLocalEntity, Vector& vecAbsStart, Vector& vecAbsEnd, bool smokeCheck , bool flashcheck )
    {

        if (!I::Engine()->IsInGame())
            return false;

        CTraceFilter filter;

        filter.pSkip = pLocalEntity;

        trace_t tr;
        Ray_t ray;

        ray.Init(vecAbsStart, vecAbsEnd);

        I::EngineTrace()->TraceRay(ray, MASK_VISIBLE, &filter, &tr);

        bool visible = false;

        if (tr.m_pEnt == (IClientEntity*)this && !tr.allsolid)
            visible = true;

        if (visible && smokeCheck)visible = !CGlobal::LineGoesThroughSmoke(vecAbsStart, vecAbsEnd);
        
        return visible;
    }

    float CBaseEntity::GetC4BlowTime()
    {
        return *(float*)((uintptr_t)this + offsets["m_flC4Blow"]);
        //return (float)((DWORD)this + (DWORD)offsets["m_flC4Blow);
    }

    float CBaseEntity::GetC4DefuseCountDown()
    {
        return *(float*)((uintptr_t)this + offsets["m_flDefuseCountDown"]);
        //return (float)((DWORD)this + (DWORD)offsets["m_flDefuseCountDown);
    }

    int CBaseEntity::GetBombDefuser()
    {
        return *(int*)((uintptr_t)this + offsets["m_hBombDefuser"]);
        //return *(PINT)((DWORD)this + offsets["m_hBombDefuser);
    }

    int CBaseEntity::GetMoveType()
    {
        if (this != NULL && this != nullptr && (DWORD)this != 0xE)
        {
            return ptr(int, this, 0x258);
        }
        else
        {
            return 0;
        }
    }

    bool CBaseEntity::IsBombDefused()
    {
        return *(bool*)((uintptr_t)this + offsets["m_bBombDefused"]);
        //return *(bool*)((DWORD)this + offsets["m_bBombDefused);
    }


    bool CBaseEntity::HasHelmet()
    {
        return *(bool*)( ( DWORD )this + offsets["m_bHasHelmet"]);
    }

    bool CBaseEntity::HasDefuser()
    {
        return *(bool*)( ( DWORD )this + offsets["m_bHasDefuser"]);
    }

    bool* CBaseEntity::IsSpotted()
    {
        return (bool*)( ( DWORD )this + offsets["m_bSpotted"]);
    }

    int    CBaseEntity::GetFovStart()
    {
        return *(PINT)( ( DWORD )this + offsets["m_iFOVStart"]);
    }

    int    CBaseEntity::GetFlags()
    {
        return *(PINT)( ( DWORD )this + offsets["m_fFlags"]);
    }
    
    int CBaseEntity::GetHealth()
    {
        return *(PINT)( ( DWORD )this + offsets["m_iHealth"]);
    }

    int    CBaseEntity::GetArmor()
    {
        return *(PINT)( ( DWORD )this + offsets["m_ArmorValue"]);
    }

    int    CBaseEntity::GetTeam()
    {
        return *(PINT)( ( DWORD )this + offsets["m_iTeamNum"]);
    }

    int CBaseEntity::GetShotsFired()
    {
        return *(PINT)( ( DWORD )this + (DWORD)offsets["m_iShotsFired"]);
    }


    int CBaseEntity::GetIsScoped()
    {
        return *(PINT)( ( DWORD )this + (DWORD)offsets["m_bIsScoped"]);
    }

    int    CBaseEntity::GetTickBase()
    {
        if (this == nullptr)
            return 0;
        return *(PINT)( ( DWORD )this + (DWORD)offsets["m_nTickBase"]);
    }

    float* CBaseEntity::GetFlashMaxAlpha()
    {
        return (float*)((DWORD)this + (DWORD)offsets["m_flFlashMaxAlpha"]);
    }



    ObserverMode_t CBaseEntity::GetObserverMode()
    {
        return *(ObserverMode_t*)( ( DWORD )this + (DWORD)offsets["m_iObserverMode"]);
    }

    PVOID CBaseEntity::GetObserverTarget()
    {
        return ( PVOID )*(PDWORD)( ( DWORD )this + (DWORD)offsets["m_hObserverTarget"]);
    }
    
    PVOID CBaseEntity::GetActiveWeapon()
    {
        if (!this)
            return nullptr;

        return (PVOID)( ( DWORD )this + (DWORD)offsets["m_hActiveWeapon"]);
    }
    
    CBaseWeapon* CBaseEntity::GetBaseWeapon()
    {
        if (!GetActiveWeapon() || !I::EntityList())
            return nullptr;

        return (CBaseWeapon*)I::EntityList()->GetClientEntityFromHandle( ( PVOID )*(PDWORD)GetActiveWeapon() );
    }

    UINT* CBaseEntity::GetWeapons()
    {
        // DT_BasePlayer -> m_hMyWeapons
        return (UINT*)( ( DWORD )this + offsets["m_hMyWeapons"]);
    }

    CBaseHandle* CBaseEntity::m_hMyWeapons()
    {
        return (CBaseHandle*)((uintptr_t)this + 0x2DE8);
    }

    //std::array<CBaseHandle, 48> GetWeapons();

    //std::array<CBaseHandle, 48> CBaseEntity::GetWeapons()
    //{
    //    // DT_BasePlayer -> m_hMyWeapons
    //    return (std::array<CBaseHandle, 48>*)( ( DWORD )this + offsets["m_hMyWeapons );
    //}

    UINT* CBaseEntity::GetWearables()
    {
        return (UINT*)( ( DWORD )this + offsets["m_hMyWearables"]);
    }

    CBaseViewModel* CBaseEntity::GetViewModel()
    {
        // DT_BasePlayer -> m_hViewModel
        return (CBaseViewModel*)I::EntityList()->GetClientEntityFromHandle( ( PVOID )*(PDWORD)( ( DWORD )this + offsets["m_hViewModel"]) );
    }

    Vector CBaseEntity::GetAimPunchAngle()
    {
        return *(Vector*)( ( DWORD )this + offsets["m_aimPunchAngle"]);
    }

    float CBaseEntity::GetSimTime()
    {
        return *(float*)((DWORD)this + offsets["m_flSimulationTime"]);
    }

    Vector CBaseEntity::GetViewPunchAngle()
    {
        return *(Vector*)( ( DWORD )this + offsets["m_viewPunchAngle"]);
    }

    Vector CBaseEntity::GetVelocity()
    {
        return *(Vector*)( ( DWORD )this + offsets["m_vecVelocity"]);
    }

    Vector CBaseEntity::GetViewOffset()
    {
        if (this == (CBaseEntity*)0xA)
            return Vector(0, 0, 0);

        if (this == (CBaseEntity*)0xE)
            return Vector(0, 0, 0);

        return *(Vector*)( ( DWORD )this + offsets["m_vecViewOffset"]);
    }

    Vector CBaseEntity::GetEyePosition()
    {
        if (this == (CBaseEntity*)0xA)
            return Vector(0, 0, 0);

        if (this == (CBaseEntity*)0xE)
            return Vector(0, 0, 0);

        if(IsBadReadPtr(this,sizeof(Vector)))
            return Vector(0, 0, 0);

        return GetRenderOrigin() + GetViewOffset();
    }
    /*Vector3 CBaseEntity::GetEyePosition3()
    {
        return GetRenderOrigin() + GetViewOffset();
    }*/
    Vector CBaseEntity::GetPunchAngles()
    {
        if (!this)
            return Vector(0, 0, 0);

        if (IsBadReadPtr(this, sizeof(CBaseEntity*)))
            return Vector(0, 0, 0);

        return *(Vector*)((DWORD)this + offsets["m_vecPunchAngles"]);
    }

    QAngle CBaseEntity::GetEyeAngles()
    {
        return *reinterpret_cast<QAngle*>( ( DWORD )this + offsets["m_angEyeAngles"]);
    }

    /*static void ForcedMaterialOverride(IMaterial* material, OverrideType_t type = OVERRIDE_NORMAL, int idk = NULL)
    {
        typedef void(__thiscall* Fn)(void*, IMaterial*, OverrideType_t, int);
        return call_vfunc<Fn>(this, 1)(this, material, type, idk);
    }*/

    /*QAngle CBaseEntity::GetPunch()
    {
        return *(QAngle*)((DWORD)this + offsets["m_aimPunchAngle);
    }*/

    
    Vector CBaseEntity::GetBonePosition( int nBone )
    {
        Vector vRet;
        matrix3x4_t MatrixArray[MAXSTUDIOBONES];

        if ( !SetupBones( MatrixArray , MAXSTUDIOBONES , BONE_USED_BY_HITBOX , I::GlobalVars()->curtime ) )
            return vRet;

        matrix3x4_t HitboxMatrix = MatrixArray[nBone];

        vRet = Vector( HitboxMatrix[0][3] , HitboxMatrix[1][3] , HitboxMatrix[2][3] );

        return vRet;
    }

    studiohdr_t* CBaseEntity::GetStudioModel()
    {
        const model_t* model = nullptr;

        if(!this->IsValid())
            return nullptr;


        model = GetModel();
        
        if ( !model )
            return nullptr;

        if(IsBadReadPtr(model,sizeof(model_t*)))
            return nullptr;


        studiohdr_t* pStudioModel = I::ModelInfo()->GetStudioModel( model );

        if ( !pStudioModel )
            return nullptr;

        return pStudioModel;
    }

    mstudiobone_t* CBaseEntity::GetBone( int nBone )
    {
        mstudiobone_t* pBoneBox = nullptr;

        studiohdr_t* pStudioModel = GetStudioModel();

        if ( !pStudioModel )
            return pBoneBox;

        mstudiobone_t* pBone = pStudioModel->pBone( nBone );

        if ( !pBone )
            return nullptr;

        return pBone;
    }

    mstudiobbox_t* CBaseEntity::GetHitBox( int nHitbox )
    {
        if ( nHitbox < 0 || nHitbox >= 19 )
            return nullptr;

        mstudiohitboxset_t* pHitboxSet = nullptr;
        mstudiobbox_t* pHitboxBox = nullptr;

        pHitboxSet = GetHitBoxSet();

        if ( !pHitboxSet )
            return pHitboxBox;

        pHitboxBox = pHitboxSet->pHitbox( nHitbox );

        if ( !pHitboxBox )
            return nullptr;

        return pHitboxBox;
    }

    mstudiohitboxset_t* CBaseEntity::GetHitBoxSet()
    {
        studiohdr_t* pStudioModel = nullptr;
        mstudiohitboxset_t* pHitboxSet = nullptr;

        pStudioModel = GetStudioModel();

        if ( !pStudioModel )
            return pHitboxSet;

        pHitboxSet = pStudioModel->pHitboxSet( 0 );

        if ( !pHitboxSet )
            return nullptr;

        return pHitboxSet;
    }

    Vector CBaseEntity::GetHitboxPosition( int nHitbox )
    {
        matrix3x4_t MatrixArray[MAXSTUDIOBONES];
        Vector vRet , vMin , vMax;

        vRet = Vector( 0 , 0 , 0 );

        mstudiobbox_t* pHitboxBox = GetHitBox( nHitbox );

        if ( !pHitboxBox || !IsValid() )
            return vRet;

        if ( !SetupBones( MatrixArray , MAXSTUDIOBONES , BONE_USED_BY_HITBOX , 0) )
            return vRet;

        if ( !pHitboxBox->m_Bone || !pHitboxBox->m_vBbmin.IsValid() || !pHitboxBox->m_vBbmax.IsValid() )
            return vRet;
                        
        VectorTransform( pHitboxBox->m_vBbmin , MatrixArray[pHitboxBox->m_Bone] , vMin );
        VectorTransform( pHitboxBox->m_vBbmax , MatrixArray[pHitboxBox->m_Bone] , vMax );

        vRet = ( vMin + vMax ) * 0.5f;

        return vRet;
    }

    void CBaseViewModel::SetModelIndex( int nModelIndex )
    {
        VirtualFn( void )( PVOID , int );
        GetMethod< OriginalFn >( this , 75 )( this , nModelIndex );
        // DT_BaseViewModel -> m_nModelIndex
        //*(int*)( ( DWORD )this + offsets["m_nModelIndex ) = nModelIndex;
    }

    void CBaseViewModel::SetWeaponModel( const char* Filename , IClientEntity* Weapon )
    {
        typedef void( __thiscall* SetWeaponModelFn )( void* , const char* , IClientEntity* );
        return GetMethod<SetWeaponModelFn>( this , 242 )( this , Filename , Weapon );
    }

    DWORD CBaseViewModel::GetOwner()
    {
        // DT_BaseViewModel -> m_hOwner
        return *(PDWORD)( ( DWORD )this + offsets["m_hOwner"]);
    }

    DWORD CBaseViewModel::GetWeapon()
    {
        // DT_BaseViewModel -> m_hWeapon
        return *(PDWORD)( ( DWORD )this + offsets["m_hWeapon"]);
    }

    template <class T>
    static T GetFunction(void* instance, int index)
    {
        const auto vtable = *static_cast<void***>(instance);
        return reinterpret_cast<T>(vtable[index]);
    }

}
 
pa$$Ter
Начинающий
Статус
Оффлайн
Регистрация
5 Янв 2018
Сообщения
75
Реакции[?]
14
Поинты[?]
0
C++:
#include "Esp.h"
#include "../Setup.h"
//#include "../../Hooks/Tables.h"

namespace HookTables
{
    //cDetour<DrawModelExecuteFn>* pDrawModelExecute;  //параша
}

void CEsp::DrawPlayerEx(CEntityPlayer* Entity, CEntityPlayer* Local, bool IsDormant)
{
    auto LDrawPlayerEx = [&]()->void
    {
        Vector OriginScreen;
        Vector HeadScreen, HeadScreenOrig;

        Vector OrignWorld = Entity->RenderOrigin;
        Vector HeadWorld, HeadWorldOrig;

        HeadWorld = Entity->HitBoxes[HITBOX_HEAD];

        if (HeadWorld.IsZero() && !IsDormant)
            return;

        if (IsDormant)
        {
            OrignWorld = Entity->OldRenderOrigin;
            HeadWorld = Entity->OldHead;
        }
        else
        {
            Entity->OldRenderOrigin = OrignWorld;
            Entity->OldHead = HeadWorld;
        }

        if (!Team && Entity->Team == Local->Team)
            return;

        if (!Enemy && Entity->Team != Local->Team)
            return;

        if ((BoxVisbleOnly && !Local->IsDead) && !Entity->IsVisble)
            return;

        HeadWorldOrig = HeadWorld;
        HeadWorld.z += BoxSize;
        OrignWorld.z -= BoxSize;

        if (CGlobal::WorldToScreen(HeadWorld, HeadScreen) && CGlobal::WorldToScreen(OrignWorld, OriginScreen))
        {
            float Height = OriginScreen.y - HeadScreen.y;
            if (Height < 18)
                Height = 18;

            float Width = Height / 2.f;
            Vector BoxScreen = Vector(HeadScreen.x - (Width / 2.f), HeadScreen.y, 0);

            /*    if (BoxStyle == 2)
                    GetBox(Entity, BoxScreen.x, BoxScreen.y, Width, Height);
    */
            if (Skeleton)
            {
                DrawSkeletonLine(0, 1, Entity);
                DrawSkeletonLine(1, 6, Entity);
                DrawSkeletonLine(6, 5, Entity);
                DrawSkeletonLine(5, 4, Entity);
                DrawSkeletonLine(4, 3, Entity);

                DrawSkeletonLine(6, 15, Entity);
                DrawSkeletonLine(15, 16, Entity);
                DrawSkeletonLine(16, 13, Entity);
                DrawSkeletonLine(6, 17, Entity);
                DrawSkeletonLine(17, 18, Entity);
                DrawSkeletonLine(18, 14, Entity);

                DrawSkeletonLine(3, 8, Entity);
                DrawSkeletonLine(8, 10, Entity);
                DrawSkeletonLine(10, 12, Entity);
                DrawSkeletonLine(3, 7, Entity);
                DrawSkeletonLine(7, 9, Entity);
                DrawSkeletonLine(9, 11, Entity);

            }

            if (Line)
                GP_Render->DrawLine(CGlobal::iScreenWidth / 2.f, CGlobal::iScreenHeight, BoxScreen.x + Width / 2, OriginScreen.y, LineColor);

            if (FillBox && BoxStyle != 2)
                GP_Render->DrawFilledBox((int)BoxScreen.x, (int)BoxScreen.y, (int)Width, (int)Height, FillBoxColor, BoxStyle != 3 ? 0.0f : Width / 5.f);

            if (BoxEnable)
            {
                Color BoxColor = Color::White();

                if (Entity->IsVisble)
                {
                    switch (Entity->Team)
                    {
                    case PLAYER_TEAM::TEAM_CT: BoxColor = BoxVisbleCT; break;
                    case PLAYER_TEAM::TEAM_TT: BoxColor = BoxVisbleTT; break;
                    default: break;
                    }
                }
                else
                {
                    switch (Entity->Team)
                    {
                    case PLAYER_TEAM::TEAM_CT: BoxColor = BoxCT; break;
                    case PLAYER_TEAM::TEAM_TT: BoxColor = BoxTT; break;
                    default: break;
                    }
                }

                Color Black = Color::Black();
                Black[3] = BoxColor[3];

                switch (BoxStyle)
                {
                case 0:
                {
                    GP_Render->DrawBox((int)BoxScreen.x, (int)BoxScreen.y, (int)Width, (int)Height, 1, BoxColor);
                    if (BoxOutline)
                    {
                        GP_Render->DrawBox((int)BoxScreen.x + 1, (int)BoxScreen.y + 1, (int)Width - 2, (int)Height - 2, 1, Black);
                        GP_Render->DrawBox((int)BoxScreen.x - 1, (int)BoxScreen.y - 1, (int)Width + 2, (int)Height + 2, 1, Black);
                    }
                    break;
                }
                case 1:
                {
                    GP_Render->DrawCoalBox((int)BoxScreen.x, (int)BoxScreen.y, (int)Width, (int)Height, 1, BoxColor, BoxOutline);
                    break;
                }
                case 2:
                {
                    Draw3DBox(Entity, BoxColor);
                    break;
                }
                case 3:
                {
                    GP_Render->DrawBox((int)BoxScreen.x, (int)BoxScreen.y, (int)Width, (int)Height, 1, BoxColor, Width / 5.f);
                    if (BoxOutline)
                    {
                        GP_Render->DrawBox((int)BoxScreen.x + 1, (int)BoxScreen.y + 1, (int)Width - 2, (int)Height - 2, 1, Black, Width / 5.f);
                        GP_Render->DrawBox((int)BoxScreen.x - 1, (int)BoxScreen.y - 1, (int)Width + 2, (int)Height + 2, 1, Black, Width / 5.f);
                    }
                    break;
                }
                default:break;
                }
            }

            if (HeadEsp)
            {
                float radius = (Height / 13.4);
                if (radius >= 140)
                    radius = 140;

                if (CGlobal::WorldToScreen(HeadWorldOrig, HeadScreenOrig))
                    GP_Render->DrawRing(HeadScreenOrig.x, HeadScreenOrig.y, radius, 64, HeadEspColor);
            }

            //все что ниже перепсать вот это все

            static MoveStruct *MV_Hp = &MVItemList[MI_HEALTH_BAR];
            static MoveStruct *MV_Armor = &MVItemList[MI_ARMOR_BAR];

            static MoveStruct *MV_Hp_Text = &MVItemList[MI_HEALTH_TEXT];
            static MoveStruct *MV_Armor_Text = &MVItemList[MI_ARMOR_TEXT];

            static MoveStruct *MV_Distance = &MVItemList[MI_DISTANCE_TEXT];
            static MoveStruct *MV_Money = &MVItemList[MI_MONEY_TEXT];

            static MoveStruct *MV_Weapon = &MVItemList[MI_WEAPON_TEXT];
            static MoveStruct *MV_Ammo = &MVItemList[MI_AMMO_TEXT];
            static MoveStruct *MV_Scoped = &MVItemList[MI_SCOPE_TEXT];
            static MoveStruct *MV_Flashed = &MVItemList[MI_FLASHED_TEXT];
            static MoveStruct *MV_Name = &MVItemList[MI_NAME_TEXT];

            int y = BoxScreen.y;
            int x = BoxScreen.x;

            auto ChangeSidePosText = [](MoveStruct* Curt, Vec2 Size, Vec2 BoxPos, int boxSizeX, int boxSizeY) -> Vec2
            {
                switch (Curt->Side)
                {
                case LEFT_S: return Vec2(BoxPos.x - Size.x - Curt->CorrectPadding.x, BoxPos.y + Curt->CorrectPadding.y);
                case RIGHT_S:return Vec2(BoxPos.x + boxSizeX + Curt->CorrectPadding.x, BoxPos.y + Curt->CorrectPadding.y);
                case TOP_S:  return Vec2(BoxPos.x + (boxSizeX / 2) - (Size.x / 2), BoxPos.y - Size.y - Curt->CorrectPadding.y);
                case DOWN_S: return Vec2(BoxPos.x + (boxSizeX / 2) - (Size.x / 2), BoxPos.y + boxSizeY + Curt->CorrectPadding.y);
                case LEFT_TOP_S:  return Vec2(BoxPos.x, BoxPos.y - Size.y - Curt->CorrectPadding.y);
                case RIGHT_TOP_S: return Vec2(BoxPos.x + boxSizeX - Size.x, BoxPos.y - Size.y - Curt->CorrectPadding.y);
                case LEFT_DOWN_S: return Vec2(BoxPos.x, BoxPos.y + boxSizeY + Curt->CorrectPadding.y);
                case RIGHT_DOWN_S:return Vec2(BoxPos.x + boxSizeX - Size.x, BoxPos.y + boxSizeY + Curt->CorrectPadding.y);
                case CENTER_LEFT_S:    return Vec2(BoxPos.x - Size.x - Curt->CorrectPadding.x, BoxPos.y + (boxSizeY / 2 + Curt->CorrectPadding.y));
                case CENTER_RIGHT_S:   return Vec2(BoxPos.x + boxSizeX + Curt->CorrectPadding.x, BoxPos.y + (boxSizeY / 2) + Curt->CorrectPadding.y);
                case DOWN_LEFT_DOWN_S: return Vec2(BoxPos.x - Size.x - Curt->CorrectPadding.x, BoxPos.y + boxSizeY - Size.y + Curt->CorrectPadding.y);
                case DOWN_RIGHT_DOWN_S:return Vec2(BoxPos.x + boxSizeX + Curt->CorrectPadding.x, BoxPos.y + boxSizeY - Size.y + Curt->CorrectPadding.y);
                default: return Vec2(0, 0);
                }
            };


            if (Name && MV_Name)
            {
                Color f1 = NameColorBack;
                Color f2(255, 255, 255, 0);

                float Name_X = 0;
                float Name_Y = 0;

                Vec2 TextPos = ChangeSidePosText(MV_Name, GP_Render->CalcTextSize(Entity->Name, GP_Render->SzFonts[TextNameSize]), Vec2(x, y), Width, Height);

                TextPos.x -= (Width / MV_Name->CorrectOfst.x);
                TextPos.y -= (Height / MV_Name->CorrectOfst.y);

                TextPos.x = int(TextPos.x);
                TextPos.y = int(TextPos.y);

                if (NameBackground)
                {
                    Vec2 TextSize = GP_Render->CalcTextSize(Entity->Name, GP_Render->SzFonts[TextNameSize]);

                    Rect BackLeft = Rect(Vec2(TextPos.x - 15, TextPos.y), Vec2(TextPos.x + TextSize.x / 3, TextPos.y + TextSize.y));
                    Rect BackCenter = Rect(Vec2(BackLeft.max.x, BackLeft.min.y), Vec2(BackLeft.max.x + TextSize.x / 3, BackLeft.max.y));
                    Rect BackRight = Rect(Vec2(BackCenter.max.x, BackLeft.min.y), Vec2(BackCenter.max.x + (TextSize.x / 3) + 15, BackLeft.max.y));

                    GP_Render->DrawGradientBox(BackLeft.min, BackLeft.max, Color(0, 0, 0, 0), NameColorBack, false);
                    GP_Render->DrawGradientBox(BackCenter.min, BackCenter.max, NameColorBack, NameColorBack, false);
                    GP_Render->DrawGradientBox(BackRight.min, BackRight.max, NameColorBack, Color(0, 0, 0, 0), false);
                }

                GP_Render->DrawString(TextPos.x, TextPos.y, TextNameSize, NameColor, true, false, Entity->Name.c_str());
            }

            if (Health && MV_Hp && MV_Hp_Text)
            {
                Color Minus;
                Color DinColor;
                int iHealth = Entity->Health;
                if (iHealth)
                {
                    float health_tik = MV_Hp->NumParam2;

                    int healthpos_X = 0;
                    int healthpos_Y = 0;

                    switch (MV_Hp->Side)
                    {
                    case LEFT_S:
                        healthpos_X = x - (Width / MV_Hp->CorrectOfst.x) - health_tik - MV_Hp->CorrectPadding.x;
                        healthpos_Y = y - (Height / MV_Hp->CorrectOfst.y);
                        break;
                    case RIGHT_S:
                        healthpos_X = x - (Width / MV_Hp->CorrectOfst.x) + MV_Hp->CorrectPadding.x;
                        healthpos_Y = y - (Height / MV_Hp->CorrectOfst.y);
                        break;
                    case TOP_S:
                        healthpos_X = x - (Width / MV_Hp->CorrectOfst.x);
                        healthpos_Y = y - (Height / MV_Hp->CorrectOfst.y) - health_tik - MV_Hp->CorrectPadding.y;
                        break;
                    case DOWN_S:
                        healthpos_X = x - (Width / MV_Hp->CorrectOfst.x);
                        healthpos_Y = y - (Height / MV_Hp->CorrectOfst.y) + Height + MV_Hp->CorrectPadding.y;
                        break;
                    }

                    switch (HealthStyle)
                    {
                    case 0:
                    {
                        bool vertical = (MV_Hp->Side == LEFT_S || MV_Hp->Side == RIGHT_S);
                        DrawBar(
                            vertical ? VERTICAL : HORIZONTAL, healthpos_X, healthpos_Y,
                            vertical ? health_tik : Width, vertical ? Height : health_tik,
                            iHealth, MV_Hp->boolParam2, HealthColor, HealthColor2,
                            MV_Hp->boolParam1, MV_Hp->NumParam1, MV_Hp->boolParam3, HealthColor3);
                        break;
                    }
                    case 1:
                    {
                        string HPText = to_string(iHealth) + XorStr("HP");
                        Vec2 TextPos = ChangeSidePosText(MV_Hp_Text, GP_Render->CalcTextSize(
                            HPText, GP_Render->SzFonts[TextHealthSize]), Vec2(x, y), Width, Height);
                        GP_Render->DrawString(
                            (int)TextPos.x - (Width / MV_Hp_Text->CorrectOfst.x),
                                (int)TextPos.y - (Height / MV_Hp_Text->CorrectOfst.y),
                                TextHealthSize, HealthColor, true, false, HPText.c_str());
                        break;
                    }
                    }
                }
            }

        

            if (Armor && MV_Armor &&  MV_Armor_Text)
            {
                int iArmor = Entity->Armor;

                if (iArmor)
                {
                    float health_tik = MV_Armor->NumParam2;

                    int healthpos_X = 0;
                    int healthpos_Y = 0;

                    switch (MV_Armor->Side)
                    {
                    case LEFT_S:
                        healthpos_X = x - (Width / MV_Armor->CorrectOfst.x) - health_tik - MV_Armor->CorrectPadding.x;
                        healthpos_Y = y - (Height / MV_Armor->CorrectOfst.y);
                        break;
                    case RIGHT_S:
                        healthpos_X = x - (Width / MV_Armor->CorrectOfst.x) + MV_Armor->CorrectPadding.x;
                        healthpos_Y = y - (Height / MV_Armor->CorrectOfst.y);
                        break;
                    case TOP_S:
                        healthpos_X = x - (Width / MV_Armor->CorrectOfst.x);
                        healthpos_Y = y - (Height / MV_Armor->CorrectOfst.y) - health_tik - MV_Armor->CorrectPadding.y;
                        break;
                    case DOWN_S:
                        healthpos_X = x - (Width / MV_Armor->CorrectOfst.x);
                        healthpos_Y = y - (Height / MV_Armor->CorrectOfst.y) + Height + MV_Armor->CorrectPadding.y;
                        break;
                    }

                    switch (ArmorStyle)
                    {
                    case 0:
                    {
                        bool vertical = (MV_Armor->Side == LEFT_S || MV_Armor->Side == RIGHT_S);
                        DrawBar(
                            vertical ? VERTICAL : HORIZONTAL, healthpos_X, healthpos_Y,
                            vertical ? health_tik : Width, vertical ? Height : health_tik,
                            iArmor, MV_Armor->boolParam2, ArmorColor, ArmorColor2,
                            MV_Armor->boolParam1, MV_Armor->NumParam1, MV_Armor->boolParam3, ArmorColor3);
                        break;
                    }
                    case 1:
                    {
                        string AText = to_string(iArmor) + XorStr("A");
                        Vec2 TextPos = ChangeSidePosText(MV_Armor_Text, GP_Render->CalcTextSize(
                            AText, GP_Render->SzFonts[TextHealthSize]), Vec2(x, y), Width, Height);
                        GP_Render->DrawString(
                            (int)TextPos.x - (Width / MV_Armor_Text->CorrectOfst.x),
                                (int)TextPos.y - (Height / MV_Armor_Text->CorrectOfst.y),
                                TextHealthSize, ArmorColor, true, false, AText.c_str());
                        break;
                    }
                    }               
                }
            }

            if (Distance && MV_Distance)
            {
                char bufDist[246];
                std::sprintf(bufDist, "%6.1lfm", Entity->Distance);
                string distm = bufDist;

                Vec2 TextPos = ChangeSidePosText(MV_Distance, GP_Render->CalcTextSize(distm, GP_Render->SzFonts[TextDistanceSize]), Vec2(x, y), Width, Height);
                GP_Render->DrawString((int)TextPos.x - 7 - (Width / MV_Distance->CorrectOfst.x),
                    (int)TextPos.y - (Height / MV_Distance->CorrectOfst.y), TextDistanceSize, DistanceColor, true, false, distm.c_str());
            }

            if (Weapon && MV_Weapon)
            {
                const char* WeaponStr = Entity->WeaponName.c_str();
                Vec2 TextPos = ChangeSidePosText(MV_Weapon, GP_Render->CalcTextSize(WeaponStr, GP_Render->SzFonts[TextWeaponSize]), Vec2(x, y), Width, Height);

                switch (WeaponStyle)
                {
                case 0: GP_Render->DrawString((int)TextPos.x - (Width / MV_Weapon->CorrectOfst.x),
                    (int)TextPos.y - (Height / MV_Weapon->CorrectOfst.y), TextWeaponSize, WeaponColor, true, false, WeaponStr); break;
                case 1:
                {
                    string ico = XorStr("def");
                    if (strstr(WeaponStr, XorStr("HE_Grenade")))
                        ico = XorStr("j");
                    else if (strstr(WeaponStr, XorStr("Smoke_Grenade")))
                        ico = XorStr("k");
                    else if (strstr(WeaponStr, XorStr("FLASHBANG")))
                        ico = XorStr("i");
                    else if (strstr(WeaponStr, XorStr("MOLOTOV")))
                        ico = XorStr("l");
                    else if (strstr(WeaponStr, XorStr("DECOY")))
                        ico = XorStr("m");
                    else if (strstr(WeaponStr, XorStr("IncGrenade")))
                        ico = XorStr("n");
                    else if (strstr(WeaponStr, XorStr("Taser")))
                        ico = XorStr("h");
                    else if (strstr(WeaponStr, XorStr("Knife_T")))
                        ico = XorStr("[");
                    else if (strstr(WeaponStr, XorStr("Knife")))
                        ico = XorStr("]");
                    else if (strstr(WeaponStr, XorStr("C4")))
                        ico = XorStr("o");
                    else
                    {
                        switch (CGlobal::GetWeaponSettingsSelectID(Entity->WeaponIdx))
                        {
                        case 0:  ico = XorStr("A"); break;
                        case 1:  ico = XorStr("B"); break;
                        case 2:  ico = XorStr("C"); break;
                        case 3:  ico = XorStr("D"); break;
                        case 4:  ico = XorStr("F"); break;
                        case 5:  ico = XorStr("F"); break;
                        case 6:  ico = XorStr("G"); break;
                        case 7:  ico = XorStr("I"); break;
                        case 8:  ico = XorStr("J"); break;
                        case 9:  ico = XorStr("H"); break;
                        case 10: ico = XorStr("W"); break;
                        case 11: ico = XorStr("U"); break;
                        case 12: ico = XorStr("R"); break;
                        case 13: ico = XorStr("Q"); break;
                        case 14: ico = XorStr("g"); break;
                        case 15: ico = XorStr("S"); break;
                        case 16: ico = XorStr("T"); break;
                        case 17: ico = XorStr("K"); break;
                        case 18: ico = XorStr("P"); break;
                        case 19: ico = XorStr("L"); break;
                        case 20: ico = XorStr("L"); break;//mp5sd
                        case 21: ico = XorStr("b"); break;
                        case 22: ico = XorStr("M"); break;
                        case 23: ico = XorStr("d"); break;
                        case 24: ico = XorStr("f"); break;
                        case 25: ico = XorStr("c"); break;
                        case 26: ico = XorStr("N"); break;
                        case 27: ico = XorStr("O"); break;
                        case 28: ico = XorStr("e"); break;
                        case 29: ico = XorStr("V"); break;
                        case 30: ico = XorStr("X"); break;
                        case 31: ico = XorStr("Y"); break;
                        case 32: ico = XorStr("Z"); break;
                        case 33: ico = XorStr("a"); break;
                        default: break;
                        }
                    }
                    if (ico.length() == 1)
                    {
                        TextPos = ChangeSidePosText(MV_Weapon, GP_Render->CalcTextSize(ico, GP_Render->SzFontsIcon[TextWeaponSize]), Vec2(x, y), Width, Height);
                        GP_Render->DrawIcon((int)TextPos.x - (Width / MV_Weapon->CorrectOfst.x),
                            (int)TextPos.y - (Height / MV_Weapon->CorrectOfst.y), TextWeaponSize, WeaponColor, true, false, ico.c_str());
                    }
                    break;
                }
                default:
                    break;
                }
            }
            if (Ammo && MV_Ammo)
            {
                char ammo_format[64];

                switch (AmmoStyle)
                {
                case 0:sprintf(ammo_format, "[%i]", Entity->Ammo1); break;
                case 1:sprintf(ammo_format, "[%i\\%i]", Entity->Ammo1, Entity->Ammo2); break;
                case 2:sprintf(ammo_format, "[%i]", Entity->Ammo1 + Entity->Ammo2); break;
                default:
                    break;
                }
                
                string Ammo = string(ammo_format);

                Vec2 TextPos = ChangeSidePosText(MV_Ammo, GP_Render->CalcTextSize(Ammo, GP_Render->SzFonts[TextAmmoSize]), Vec2(x, y), Width, Height);

                GP_Render->DrawString((int)TextPos.x - (Width / MV_Ammo->CorrectOfst.x),
                    (int)TextPos.y - (Height / MV_Ammo->CorrectOfst.y), TextAmmoSize, AmmoColor, true, false, Ammo.c_str());
            }

            if (Money && MV_Money)
            {
                string MoneyStr = to_string(Entity->Money) + XorStr("$");

                Vec2 TextPos = ChangeSidePosText(MV_Money, GP_Render->CalcTextSize(MoneyStr, GP_Render->SzFonts[TextMoneySize]), Vec2(x, y), Width, Height);
                GP_Render->DrawString((int)TextPos.x - (Width / MV_Money->CorrectOfst.x),
                    (int)TextPos.y - (Height / MV_Money->CorrectOfst.y), TextMoneySize, MoneyColor, true, false, MoneyStr.c_str());
            }


            if (Scope && MV_Scoped)
            {
                if (Entity->ZoomLevel == 1 || Entity->ZoomLevel == 2)
                {
                    string DefStr = XorStr("SCOPED");
                    Vec2 TextPos = ChangeSidePosText(MV_Scoped, GP_Render->CalcTextSize(DefStr, GP_Render->SzFonts[TextScopedSize]), Vec2(x, y), Width, Height);

                    GP_Render->DrawString((int)TextPos.x - (Width / MV_Scoped->CorrectOfst.x),
                        (int)TextPos.y - (Height / MV_Scoped->CorrectOfst.y), TextScopedSize, ScopeColor, true, false, DefStr.c_str());
                }
            }

            if (Flashing && MV_Flashed)
            {
                if (Entity->IsFlashed)
                {
                    string DefStr = XorStr("FLASHED");
                    Vec2 TextPos = ChangeSidePosText(MV_Flashed, GP_Render->CalcTextSize(DefStr, GP_Render->SzFonts[TextFlashedSize]), Vec2(x, y), Width, Height);

                    GP_Render->DrawString((int)TextPos.x - (Width / MV_Flashed->CorrectOfst.x),
                        (int)TextPos.y - (Height / MV_Flashed->CorrectOfst.y), TextFlashedSize, FlashingColor, true, false, DefStr.c_str());
                }
            }
        }
    };
    LDrawPlayerEx();
}

void CEsp::PlayerEsp(CEntityPlayer* Local)
{
    auto LPlayerEsp = [&]()->void
    {
        if ((Skeleton || FillBox || BoxEnable || HeadEsp ||
            Name || Health || Armor || Ammo || Distance ||
            Weapon || Money || Scope || Flashing || Line) && BindEnable.Check())
        {
            for (int EntIndex = 0; EntIndex < MAX_ENTITY_PLAYERS; EntIndex++)
            {
                CEntityPlayer* Entity = &GP_EntPlayers->EntityPlayer[EntIndex];

                if (!Entity->IsUpdated)
                    continue;

                if (Entity->IsLocal)
                    continue;

                if (!Entity->IsPlayer)
                    continue;

                if (Entity->IsDead)
                    continue;

                if (Entity->HitBoxes[HITBOX_HEAD].IsZero())
                {
                    if (Entity->Alpha == 255.f)
                    {
                        Entity->HideEndTime = I::GlobalVars()->curtime + DORMANT_TIME;
                        Entity->Alpha -= 1.f;
                    }

                    if (Entity->Alpha != 0.f)
                    {
                        Entity->Alpha = (255.f * ((((Entity->HideEndTime - I::GlobalVars()->curtime) * 100.f) / DORMANT_TIME) / 100.f));

                        if (Entity->Alpha <= 1.f)
                            Entity->Alpha = 0.f;
                    }
                }

                SetPlayerAlpha(Entity->Alpha);
                if (Entity->Alpha != 0.f)
                {
                    DrawPlayerEx(Entity, Local, Entity->HitBoxes[HITBOX_HEAD].IsZero());
                }
                ResetPlayerAlpha();
            }
        }
    };
    LPlayerEsp();
}

//кастыль
void CEsp::SetPlayerAlpha(float NewAlph)
{
    auto LSetPlayerAlpha = [&]()->void
    {
        OldAlphs.clear();

        OldAlphs.push_back(BoxCT[3]);
        OldAlphs.push_back(BoxTT[3]);
        OldAlphs.push_back(BoxVisbleCT[3]);
        OldAlphs.push_back(BoxVisbleTT[3]);
        OldAlphs.push_back(FillBoxColor[3]);
        OldAlphs.push_back(HeadEspColor[3]);
        OldAlphs.push_back(LineColor[3]);
        OldAlphs.push_back(SkeletonColor[3]);
        OldAlphs.push_back(HealthColor[3]);
        OldAlphs.push_back(HealthColor2[3]);
        OldAlphs.push_back(HealthColor3[3]);
        OldAlphs.push_back(ArmorColor[3]);
        OldAlphs.push_back(ArmorColor2[3]);
        OldAlphs.push_back(ArmorColor3[3]);
        OldAlphs.push_back(DistanceColor[3]);
        OldAlphs.push_back(WeaponColor[3]);
        OldAlphs.push_back(AmmoColor[3]);
        OldAlphs.push_back(NameColor[3]);
        OldAlphs.push_back(NameColorBack[3]);
        OldAlphs.push_back(MoneyColor[3]);
        OldAlphs.push_back(FlashingColor[3]);
        OldAlphs.push_back(DefusingColor[3]);

        BoxCT.SetAlph(NewAlph);
        BoxTT.SetAlph(NewAlph);
        BoxVisbleCT.SetAlph(NewAlph);
        BoxVisbleTT.SetAlph(NewAlph);
        FillBoxColor.SetAlph(NewAlph);
        HeadEspColor.SetAlph(NewAlph);
        LineColor.SetAlph(NewAlph);
        SkeletonColor.SetAlph(NewAlph);
        HealthColor.SetAlph(NewAlph);
        HealthColor2.SetAlph(NewAlph);
        HealthColor3.SetAlph(NewAlph);
        ArmorColor.SetAlph(NewAlph);
        ArmorColor2.SetAlph(NewAlph);
        ArmorColor3.SetAlph(NewAlph);
        DistanceColor.SetAlph(NewAlph);
        WeaponColor.SetAlph(NewAlph);
        AmmoColor.SetAlph(NewAlph);
        NameColor.SetAlph(NewAlph);
        NameColorBack.SetAlph(NewAlph);
        MoneyColor.SetAlph(NewAlph);
        FlashingColor.SetAlph(NewAlph);
        DefusingColor.SetAlph(NewAlph);
    };
    LSetPlayerAlpha();
}
void CEsp::ResetPlayerAlpha()
{
    auto LResetPlayerAlpha = [&]()->void
    {
        BoxCT[3] = OldAlphs[0];
        BoxTT[3] = OldAlphs[1];
        BoxVisbleCT[3] = OldAlphs[2];
        BoxVisbleTT[3] = OldAlphs[3];
        FillBoxColor[3] = OldAlphs[4];
        HeadEspColor[3] = OldAlphs[5];
        LineColor[3] = OldAlphs[6];
        SkeletonColor[3] = OldAlphs[7];
        HealthColor[3] = OldAlphs[8];
        HealthColor2[3] = OldAlphs[9];
        HealthColor3[3] = OldAlphs[10];
        ArmorColor[3] = OldAlphs[11];
        ArmorColor2[3] = OldAlphs[12];
        ArmorColor3[3] = OldAlphs[13];
        DistanceColor[3] = OldAlphs[14];
        WeaponColor[3] = OldAlphs[15];
        AmmoColor[3] = OldAlphs[16];
        NameColor[3] = OldAlphs[17];
        NameColorBack[3] = OldAlphs[18];
        MoneyColor[3] = OldAlphs[19];
        FlashingColor[3] = OldAlphs[20];
        DefusingColor[3] = OldAlphs[21];
    };
    LResetPlayerAlpha();
}

void CEsp::Draw3DBox(CEntityPlayer* Entity, Color color)
{
    auto LDraw3DBox = [&]()->void
    {
        ICollideable* coll = Entity->BaseEntity->GetCollideable();

        Vector min = coll->OBBMins();
        Vector max = coll->OBBMaxs();

        Vector corners[8] =
        {
            Vector(min.x,min.y,min.z + 10),
            Vector(min.x,max.y,min.z + 10),
            Vector(max.x,max.y,min.z + 10),
            Vector(max.x,min.y,min.z + 10),
            Vector(min.x,min.y,max.z + 10),
            Vector(min.x,max.y,max.z + 10),
            Vector(max.x,max.y,max.z + 10),
            Vector(max.x,min.y,max.z + 10)
        };

        float ang = Entity->EyeAngle.y;

        for (int i = 0; i <= 7; i++)
            corners[i].Rotate2D(ang);

        Vector _corners[8];

        Vector bufCorners;

        for (int i = 0; i <= 7; i++)
        {
            Vector Orig = Entity->RenderOrigin;
            Orig.z -= 7;
            if (CGlobal::WorldToScreen(Orig + corners[i], bufCorners))
            {
                _corners[i] = bufCorners;
            }
        }

        float x1 = CGlobal::iScreenWidth * 2, y1 = CGlobal::iScreenHeight * 2, x2 = -CGlobal::iScreenWidth, y2 = -CGlobal::iScreenHeight;

        for (int i = 0; i <= 7; i++)
        {
            x1 = (min(x1, _corners[i].x));
            y1 = (min(y1, _corners[i].y));
            x2 = (max(x2, _corners[i].x));
            y2 = (max(y2, _corners[i].y));
        }

        float diff = x2 - x1;
        float diff2 = y2 - y1;


        for (int i = 1; i <= 4; i++)
        {
            if (BoxOutline)
            {
                GP_Render->DrawLine((float)(_corners[i - 1].x), (float)(_corners[i - 1].y) + 1, (float)(_corners[i % 4].x), (float)(_corners[i % 4].y) + 1, Color::Black());// низ
                GP_Render->DrawLine((float)(_corners[i - 1].x), (float)(_corners[i - 1].y) - 1, (float)(_corners[i % 4].x), (float)(_corners[i % 4].y) - 1, Color::Black());// низ

                GP_Render->DrawLine((float)(_corners[i + 3].x), (float)(_corners[i + 3].y) - 1, (float)(_corners[i % 4 + 4].x), (float)(_corners[i % 4 + 4].y) - 1, Color::Black());//верх
                GP_Render->DrawLine((float)(_corners[i + 3].x), (float)(_corners[i + 3].y) + 1, (float)(_corners[i % 4 + 4].x), (float)(_corners[i % 4 + 4].y) + 1, Color::Black());//верх

                GP_Render->DrawLine((float)(_corners[i - 1].x) - 1, (float)(_corners[i - 1].y), (float)(_corners[i + 3].x) - 1, (float)(_corners[i + 3].y), Color::Black());//середина
                GP_Render->DrawLine((float)(_corners[i - 1].x) + 1, (float)(_corners[i - 1].y), (float)(_corners[i + 3].x) + 1, (float)(_corners[i + 3].y), Color::Black());//середина
            }

            GP_Render->DrawLine((_corners[i - 1].x), (_corners[i - 1].y), (_corners[i % 4].x), (_corners[i % 4].y), color);// низ

            GP_Render->DrawLine((_corners[i + 3].x), (_corners[i + 3].y), (_corners[i % 4 + 4].x), (_corners[i % 4 + 4].y), color);//верх

            GP_Render->DrawLine((_corners[i - 1].x), (_corners[i - 1].y), (_corners[i + 3].x), (_corners[i + 3].y), color); //середина
        }
    };
    LDraw3DBox();
}

void CEsp::DrawSkeletonLine(int point1, int point2, CEntityPlayer* Entity)
{
    Vector HitBoxScreen1;
    Vector HitBoxScreen2;

    if (CGlobal::WorldToScreen(Entity->HitBoxes[point1], HitBoxScreen1) && CGlobal::WorldToScreen(Entity->HitBoxes[point2], HitBoxScreen2))
        GP_Render->DrawLine(HitBoxScreen1.x, HitBoxScreen1.y, HitBoxScreen2.x, HitBoxScreen2.y, SkeletonColor);
}


void CEsp::DrawBar(Orent O, float x, float y, float w, float h, float val, bool Outline, Color MainC1, Color cBack, bool bBack, int Razd, bool Revers, Color OutlineCol)
{
    auto LDrawBar = [&]()->void
    {
        if (val > 100) val = 100;
        float size = (h * val) / 100;

        x = (int)x;
        y = (int)y;

        w = (int)w;
        h = (int)h;


        if (bBack)
            GP_Render->DrawFilledBox(x + 1, y + 1, w - 1, h - 1, cBack);


        if (O == VERTICAL)
        {

            if (Revers)
                GP_Render->DrawFilledBox(x + 1, y + 1, w - 1, size - 1, MainC1);
            else
                GP_Render->DrawFilledBox(x + 1, y + 1 + (h - size), w - 1, size, MainC1);


            if (Razd != 0)
            {
                Razd += 1;
                float DistL = h / Razd;

                if (Razd == 1)
                    DistL = h / 2.f;

                for (int i(1); i < Razd; i++)
                    GP_Render->DrawLine(int(x), int(y + h - (DistL*i)), int(x + w), int(y + h - (DistL*i)), OutlineCol);
            }
        }
        else
        {
            size = (w * val) / 100;

            if (Revers)
                GP_Render->DrawFilledBox(x + 1, y + 1, size - 1, h - 1, MainC1);
            else
                GP_Render->DrawFilledBox(x + 1 + (w - size), y + 1, size - 1, h - 1, MainC1);

            if (Razd != 0)
            {
                Razd += 1;
                float DistL = w / Razd;

                if (Razd == 1)
                    DistL = w / 2.f;

                for (int i(1); i < Razd; i++)
                    GP_Render->DrawLine(int(x + w - (DistL*i)), int(y), int(x + w - (DistL*i)), int(y + h), OutlineCol);
            }
        }

        if (Outline)
            GP_Render->DrawBox(x, y, w + 1, h + 1, 1, OutlineCol);
    };
    LDrawBar();
}

IMaterial* HidTex = nullptr;
IMaterial* VisTex = nullptr;

IMaterial* HidFlat = nullptr;
IMaterial* VisFlat = nullptr;

IMaterial* HidFrame = nullptr;
IMaterial* VisFrame = nullptr;

IMaterial* HidMetall = nullptr;
IMaterial* VisMetall = nullptr;

void CEsp::DrawModelExecute(void* thisptr, IMatRenderContext* ctx, const DrawModelState_t &state, const ModelRenderInfo_t &pInfo, matrix3x4_t *pCustomBoneToWorld)
{
    if (Enable && Chams && BindEnable.Check())
    {
        if (!HidTex)
            HidTex = CGlobal::CreateMaterialNew(true);

        if (!VisTex)
            VisTex = CGlobal::CreateMaterialNew(false);

        if (!HidFlat)
            HidFlat = CGlobal::CreateMaterialNew(true, false);

        if (!VisFlat)
            VisFlat = CGlobal::CreateMaterialNew(false, false);

        if (!HidFrame)
            HidFrame = CGlobal::CreateMaterialNew(true, true, true);

        if (!VisFrame)
            VisFrame = CGlobal::CreateMaterialNew(false, true, true);

        if (!HidMetall)
            HidMetall = CGlobal::CreateMaterialMetall(true, true);

        if (!VisMetall)
            VisMetall = CGlobal::CreateMaterialMetall(false, true);

        if (!HidTex || !VisTex || !HidFlat || !VisFlat ||
            !HidFrame || !VisFrame || !HidMetall || !VisMetall)
            return;

        const char* ModelName = I::ModelInfo()->GetModelName((model_t*)pInfo.pModel);

        if (!ModelName)
            return;

        if (!strstr(ModelName, XorStr("models/player")))
            return;

        CEntityPlayer* Entity = GP_EntPlayers->GetByIdx(pInfo.entity_index);
        CEntityPlayer* Local = GP_EntPlayers->EntityLocal;

        if (!Entity || !Local)
            return;

        if (!Entity->IsUpdated)
            return;

        if (Entity->IsDead || Entity->Health <= 0)
            return;

        if (!Team && Entity->Team == Local->Team)
            return;

        if (!Enemy && Entity->Team != Local->Team)
            return;

        Color InvisColor = (Entity->Team == PLAYER_TEAM::TEAM_CT) ? ChamsCT : ChamsTT;
        Color VisbleColor = (Entity->Team == PLAYER_TEAM::TEAM_CT) ? ChamsVisbleCT : ChamsVisbleTT;

        if (!ChamsVisbleOnly)
        {
            float ArrColor[3] = { InvisColor.G1R(), InvisColor.G1G(), InvisColor.G1B() };

            I::RenderView()->SetColorModulation(ArrColor);
            I::RenderView()->SetBlend(InvisColor.G1A());

            switch (ChamsStyle)
            {
            case 0: I::ModelRender()->ForcedMaterialOverride(HidTex); break;
            case 1: I::ModelRender()->ForcedMaterialOverride(HidFlat); break;
            case 2: I::ModelRender()->ForcedMaterialOverride(HidFrame); break;
            case 4: I::ModelRender()->ForcedMaterialOverride(HidMetall); break;
            default: break;
            }

            HookTables::pDrawModelExecute->GetTrampoline()(thisptr, ctx, state, pInfo, pCustomBoneToWorld);
        }

        float ArrVisbleColor[3] = { VisbleColor.G1R(), VisbleColor.G1G(), VisbleColor.G1B() };

        if (ChamsStyle == 3)
        {
            if (ChipolinoFixColor > 1.f)
                ChipolinoFixColor /= 100.f;
            float FixColor = 100.01f - (99.f + ChipolinoFixColor);
            ArrVisbleColor[0] = ArrVisbleColor[0] / FixColor;
            ArrVisbleColor[1] = ArrVisbleColor[1] / FixColor;
            ArrVisbleColor[2] = ArrVisbleColor[2] / FixColor;
        }

        I::RenderView()->SetColorModulation(ArrVisbleColor);
        I::RenderView()->SetBlend(VisbleColor.G1A());

        switch (ChamsStyle)
        {
        case 0: I::ModelRender()->ForcedMaterialOverride(VisTex); break;
        case 1: I::ModelRender()->ForcedMaterialOverride(VisFlat); break;
        case 2: I::ModelRender()->ForcedMaterialOverride(VisFrame); break;
        case 4: I::ModelRender()->ForcedMaterialOverride(VisMetall); break;
        default: break;
        }

        HookTables::pDrawModelExecute->GetTrampoline()(thisptr, ctx, state, pInfo, pCustomBoneToWorld);
    }
}
 
youtube.com/c/funware
Пользователь
Статус
Оффлайн
Регистрация
6 Авг 2018
Сообщения
243
Реакции[?]
41
Поинты[?]
0
его уже выкладвали фикшеный
У него нет симп что б даже личный попросить. Тем более, уже ссылка на фикс ХоНе не работает - закончилось время хранения файла.
C++:
#include "Esp.h"
#include "../Setup.h"
//#include "../../Hooks/Tables.h"

namespace HookTables
{
    //cDetour<DrawModelExecuteFn>* pDrawModelExecute;  //параша
}

void CEsp::DrawPlayerEx(CEntityPlayer* Entity, CEntityPlayer* Local, bool IsDormant)
{
    auto LDrawPlayerEx = [&]()->void
    {
        Vector OriginScreen;
        Vector HeadScreen, HeadScreenOrig;

        Vector OrignWorld = Entity->RenderOrigin;
        Vector HeadWorld, HeadWorldOrig;

        HeadWorld = Entity->HitBoxes[HITBOX_HEAD];

        if (HeadWorld.IsZero() && !IsDormant)
            return;

        if (IsDormant)
        {
            OrignWorld = Entity->OldRenderOrigin;
            HeadWorld = Entity->OldHead;
        }
        else
        {
            Entity->OldRenderOrigin = OrignWorld;
            Entity->OldHead = HeadWorld;
        }

        if (!Team && Entity->Team == Local->Team)
            return;

        if (!Enemy && Entity->Team != Local->Team)
            return;

        if ((BoxVisbleOnly && !Local->IsDead) && !Entity->IsVisble)
            return;

        HeadWorldOrig = HeadWorld;
        HeadWorld.z += BoxSize;
        OrignWorld.z -= BoxSize;

        if (CGlobal::WorldToScreen(HeadWorld, HeadScreen) && CGlobal::WorldToScreen(OrignWorld, OriginScreen))
        {
            float Height = OriginScreen.y - HeadScreen.y;
            if (Height < 18)
                Height = 18;

            float Width = Height / 2.f;
            Vector BoxScreen = Vector(HeadScreen.x - (Width / 2.f), HeadScreen.y, 0);

            /*    if (BoxStyle == 2)
                    GetBox(Entity, BoxScreen.x, BoxScreen.y, Width, Height);
    */
            if (Skeleton)
            {
                DrawSkeletonLine(0, 1, Entity);
                DrawSkeletonLine(1, 6, Entity);
                DrawSkeletonLine(6, 5, Entity);
                DrawSkeletonLine(5, 4, Entity);
                DrawSkeletonLine(4, 3, Entity);

                DrawSkeletonLine(6, 15, Entity);
                DrawSkeletonLine(15, 16, Entity);
                DrawSkeletonLine(16, 13, Entity);
                DrawSkeletonLine(6, 17, Entity);
                DrawSkeletonLine(17, 18, Entity);
                DrawSkeletonLine(18, 14, Entity);

                DrawSkeletonLine(3, 8, Entity);
                DrawSkeletonLine(8, 10, Entity);
                DrawSkeletonLine(10, 12, Entity);
                DrawSkeletonLine(3, 7, Entity);
                DrawSkeletonLine(7, 9, Entity);
                DrawSkeletonLine(9, 11, Entity);

            }

            if (Line)
                GP_Render->DrawLine(CGlobal::iScreenWidth / 2.f, CGlobal::iScreenHeight, BoxScreen.x + Width / 2, OriginScreen.y, LineColor);

            if (FillBox && BoxStyle != 2)
                GP_Render->DrawFilledBox((int)BoxScreen.x, (int)BoxScreen.y, (int)Width, (int)Height, FillBoxColor, BoxStyle != 3 ? 0.0f : Width / 5.f);

            if (BoxEnable)
            {
                Color BoxColor = Color::White();

                if (Entity->IsVisble)
                {
                    switch (Entity->Team)
                    {
                    case PLAYER_TEAM::TEAM_CT: BoxColor = BoxVisbleCT; break;
                    case PLAYER_TEAM::TEAM_TT: BoxColor = BoxVisbleTT; break;
                    default: break;
                    }
                }
                else
                {
                    switch (Entity->Team)
                    {
                    case PLAYER_TEAM::TEAM_CT: BoxColor = BoxCT; break;
                    case PLAYER_TEAM::TEAM_TT: BoxColor = BoxTT; break;
                    default: break;
                    }
                }

                Color Black = Color::Black();
                Black[3] = BoxColor[3];

                switch (BoxStyle)
                {
                case 0:
                {
                    GP_Render->DrawBox((int)BoxScreen.x, (int)BoxScreen.y, (int)Width, (int)Height, 1, BoxColor);
                    if (BoxOutline)
                    {
                        GP_Render->DrawBox((int)BoxScreen.x + 1, (int)BoxScreen.y + 1, (int)Width - 2, (int)Height - 2, 1, Black);
                        GP_Render->DrawBox((int)BoxScreen.x - 1, (int)BoxScreen.y - 1, (int)Width + 2, (int)Height + 2, 1, Black);
                    }
                    break;
                }
                case 1:
                {
                    GP_Render->DrawCoalBox((int)BoxScreen.x, (int)BoxScreen.y, (int)Width, (int)Height, 1, BoxColor, BoxOutline);
                    break;
                }
                case 2:
                {
                    Draw3DBox(Entity, BoxColor);
                    break;
                }
                case 3:
                {
                    GP_Render->DrawBox((int)BoxScreen.x, (int)BoxScreen.y, (int)Width, (int)Height, 1, BoxColor, Width / 5.f);
                    if (BoxOutline)
                    {
                        GP_Render->DrawBox((int)BoxScreen.x + 1, (int)BoxScreen.y + 1, (int)Width - 2, (int)Height - 2, 1, Black, Width / 5.f);
                        GP_Render->DrawBox((int)BoxScreen.x - 1, (int)BoxScreen.y - 1, (int)Width + 2, (int)Height + 2, 1, Black, Width / 5.f);
                    }
                    break;
                }
                default:break;
                }
            }

            if (HeadEsp)
            {
                float radius = (Height / 13.4);
                if (radius >= 140)
                    radius = 140;

                if (CGlobal::WorldToScreen(HeadWorldOrig, HeadScreenOrig))
                    GP_Render->DrawRing(HeadScreenOrig.x, HeadScreenOrig.y, radius, 64, HeadEspColor);
            }

            //все что ниже перепсать вот это все

            static MoveStruct *MV_Hp = &MVItemList[MI_HEALTH_BAR];
            static MoveStruct *MV_Armor = &MVItemList[MI_ARMOR_BAR];

            static MoveStruct *MV_Hp_Text = &MVItemList[MI_HEALTH_TEXT];
            static MoveStruct *MV_Armor_Text = &MVItemList[MI_ARMOR_TEXT];

            static MoveStruct *MV_Distance = &MVItemList[MI_DISTANCE_TEXT];
            static MoveStruct *MV_Money = &MVItemList[MI_MONEY_TEXT];

            static MoveStruct *MV_Weapon = &MVItemList[MI_WEAPON_TEXT];
            static MoveStruct *MV_Ammo = &MVItemList[MI_AMMO_TEXT];
            static MoveStruct *MV_Scoped = &MVItemList[MI_SCOPE_TEXT];
            static MoveStruct *MV_Flashed = &MVItemList[MI_FLASHED_TEXT];
            static MoveStruct *MV_Name = &MVItemList[MI_NAME_TEXT];

            int y = BoxScreen.y;
            int x = BoxScreen.x;

            auto ChangeSidePosText = [](MoveStruct* Curt, Vec2 Size, Vec2 BoxPos, int boxSizeX, int boxSizeY) -> Vec2
            {
                switch (Curt->Side)
                {
                case LEFT_S: return Vec2(BoxPos.x - Size.x - Curt->CorrectPadding.x, BoxPos.y + Curt->CorrectPadding.y);
                case RIGHT_S:return Vec2(BoxPos.x + boxSizeX + Curt->CorrectPadding.x, BoxPos.y + Curt->CorrectPadding.y);
                case TOP_S:  return Vec2(BoxPos.x + (boxSizeX / 2) - (Size.x / 2), BoxPos.y - Size.y - Curt->CorrectPadding.y);
                case DOWN_S: return Vec2(BoxPos.x + (boxSizeX / 2) - (Size.x / 2), BoxPos.y + boxSizeY + Curt->CorrectPadding.y);
                case LEFT_TOP_S:  return Vec2(BoxPos.x, BoxPos.y - Size.y - Curt->CorrectPadding.y);
                case RIGHT_TOP_S: return Vec2(BoxPos.x + boxSizeX - Size.x, BoxPos.y - Size.y - Curt->CorrectPadding.y);
                case LEFT_DOWN_S: return Vec2(BoxPos.x, BoxPos.y + boxSizeY + Curt->CorrectPadding.y);
                case RIGHT_DOWN_S:return Vec2(BoxPos.x + boxSizeX - Size.x, BoxPos.y + boxSizeY + Curt->CorrectPadding.y);
                case CENTER_LEFT_S:    return Vec2(BoxPos.x - Size.x - Curt->CorrectPadding.x, BoxPos.y + (boxSizeY / 2 + Curt->CorrectPadding.y));
                case CENTER_RIGHT_S:   return Vec2(BoxPos.x + boxSizeX + Curt->CorrectPadding.x, BoxPos.y + (boxSizeY / 2) + Curt->CorrectPadding.y);
                case DOWN_LEFT_DOWN_S: return Vec2(BoxPos.x - Size.x - Curt->CorrectPadding.x, BoxPos.y + boxSizeY - Size.y + Curt->CorrectPadding.y);
                case DOWN_RIGHT_DOWN_S:return Vec2(BoxPos.x + boxSizeX + Curt->CorrectPadding.x, BoxPos.y + boxSizeY - Size.y + Curt->CorrectPadding.y);
                default: return Vec2(0, 0);
                }
            };


            if (Name && MV_Name)
            {
                Color f1 = NameColorBack;
                Color f2(255, 255, 255, 0);

                float Name_X = 0;
                float Name_Y = 0;

                Vec2 TextPos = ChangeSidePosText(MV_Name, GP_Render->CalcTextSize(Entity->Name, GP_Render->SzFonts[TextNameSize]), Vec2(x, y), Width, Height);

                TextPos.x -= (Width / MV_Name->CorrectOfst.x);
                TextPos.y -= (Height / MV_Name->CorrectOfst.y);

                TextPos.x = int(TextPos.x);
                TextPos.y = int(TextPos.y);

                if (NameBackground)
                {
                    Vec2 TextSize = GP_Render->CalcTextSize(Entity->Name, GP_Render->SzFonts[TextNameSize]);

                    Rect BackLeft = Rect(Vec2(TextPos.x - 15, TextPos.y), Vec2(TextPos.x + TextSize.x / 3, TextPos.y + TextSize.y));
                    Rect BackCenter = Rect(Vec2(BackLeft.max.x, BackLeft.min.y), Vec2(BackLeft.max.x + TextSize.x / 3, BackLeft.max.y));
                    Rect BackRight = Rect(Vec2(BackCenter.max.x, BackLeft.min.y), Vec2(BackCenter.max.x + (TextSize.x / 3) + 15, BackLeft.max.y));

                    GP_Render->DrawGradientBox(BackLeft.min, BackLeft.max, Color(0, 0, 0, 0), NameColorBack, false);
                    GP_Render->DrawGradientBox(BackCenter.min, BackCenter.max, NameColorBack, NameColorBack, false);
                    GP_Render->DrawGradientBox(BackRight.min, BackRight.max, NameColorBack, Color(0, 0, 0, 0), false);
                }

                GP_Render->DrawString(TextPos.x, TextPos.y, TextNameSize, NameColor, true, false, Entity->Name.c_str());
            }

            if (Health && MV_Hp && MV_Hp_Text)
            {
                Color Minus;
                Color DinColor;
                int iHealth = Entity->Health;
                if (iHealth)
                {
                    float health_tik = MV_Hp->NumParam2;

                    int healthpos_X = 0;
                    int healthpos_Y = 0;

                    switch (MV_Hp->Side)
                    {
                    case LEFT_S:
                        healthpos_X = x - (Width / MV_Hp->CorrectOfst.x) - health_tik - MV_Hp->CorrectPadding.x;
                        healthpos_Y = y - (Height / MV_Hp->CorrectOfst.y);
                        break;
                    case RIGHT_S:
                        healthpos_X = x - (Width / MV_Hp->CorrectOfst.x) + MV_Hp->CorrectPadding.x;
                        healthpos_Y = y - (Height / MV_Hp->CorrectOfst.y);
                        break;
                    case TOP_S:
                        healthpos_X = x - (Width / MV_Hp->CorrectOfst.x);
                        healthpos_Y = y - (Height / MV_Hp->CorrectOfst.y) - health_tik - MV_Hp->CorrectPadding.y;
                        break;
                    case DOWN_S:
                        healthpos_X = x - (Width / MV_Hp->CorrectOfst.x);
                        healthpos_Y = y - (Height / MV_Hp->CorrectOfst.y) + Height + MV_Hp->CorrectPadding.y;
                        break;
                    }

                    switch (HealthStyle)
                    {
                    case 0:
                    {
                        bool vertical = (MV_Hp->Side == LEFT_S || MV_Hp->Side == RIGHT_S);
                        DrawBar(
                            vertical ? VERTICAL : HORIZONTAL, healthpos_X, healthpos_Y,
                            vertical ? health_tik : Width, vertical ? Height : health_tik,
                            iHealth, MV_Hp->boolParam2, HealthColor, HealthColor2,
                            MV_Hp->boolParam1, MV_Hp->NumParam1, MV_Hp->boolParam3, HealthColor3);
                        break;
                    }
                    case 1:
                    {
                        string HPText = to_string(iHealth) + XorStr("HP");
                        Vec2 TextPos = ChangeSidePosText(MV_Hp_Text, GP_Render->CalcTextSize(
                            HPText, GP_Render->SzFonts[TextHealthSize]), Vec2(x, y), Width, Height);
                        GP_Render->DrawString(
                            (int)TextPos.x - (Width / MV_Hp_Text->CorrectOfst.x),
                                (int)TextPos.y - (Height / MV_Hp_Text->CorrectOfst.y),
                                TextHealthSize, HealthColor, true, false, HPText.c_str());
                        break;
                    }
                    }
                }
            }

       

            if (Armor && MV_Armor &&  MV_Armor_Text)
            {
                int iArmor = Entity->Armor;

                if (iArmor)
                {
                    float health_tik = MV_Armor->NumParam2;

                    int healthpos_X = 0;
                    int healthpos_Y = 0;

                    switch (MV_Armor->Side)
                    {
                    case LEFT_S:
                        healthpos_X = x - (Width / MV_Armor->CorrectOfst.x) - health_tik - MV_Armor->CorrectPadding.x;
                        healthpos_Y = y - (Height / MV_Armor->CorrectOfst.y);
                        break;
                    case RIGHT_S:
                        healthpos_X = x - (Width / MV_Armor->CorrectOfst.x) + MV_Armor->CorrectPadding.x;
                        healthpos_Y = y - (Height / MV_Armor->CorrectOfst.y);
                        break;
                    case TOP_S:
                        healthpos_X = x - (Width / MV_Armor->CorrectOfst.x);
                        healthpos_Y = y - (Height / MV_Armor->CorrectOfst.y) - health_tik - MV_Armor->CorrectPadding.y;
                        break;
                    case DOWN_S:
                        healthpos_X = x - (Width / MV_Armor->CorrectOfst.x);
                        healthpos_Y = y - (Height / MV_Armor->CorrectOfst.y) + Height + MV_Armor->CorrectPadding.y;
                        break;
                    }

                    switch (ArmorStyle)
                    {
                    case 0:
                    {
                        bool vertical = (MV_Armor->Side == LEFT_S || MV_Armor->Side == RIGHT_S);
                        DrawBar(
                            vertical ? VERTICAL : HORIZONTAL, healthpos_X, healthpos_Y,
                            vertical ? health_tik : Width, vertical ? Height : health_tik,
                            iArmor, MV_Armor->boolParam2, ArmorColor, ArmorColor2,
                            MV_Armor->boolParam1, MV_Armor->NumParam1, MV_Armor->boolParam3, ArmorColor3);
                        break;
                    }
                    case 1:
                    {
                        string AText = to_string(iArmor) + XorStr("A");
                        Vec2 TextPos = ChangeSidePosText(MV_Armor_Text, GP_Render->CalcTextSize(
                            AText, GP_Render->SzFonts[TextHealthSize]), Vec2(x, y), Width, Height);
                        GP_Render->DrawString(
                            (int)TextPos.x - (Width / MV_Armor_Text->CorrectOfst.x),
                                (int)TextPos.y - (Height / MV_Armor_Text->CorrectOfst.y),
                                TextHealthSize, ArmorColor, true, false, AText.c_str());
                        break;
                    }
                    }              
                }
            }

            if (Distance && MV_Distance)
            {
                char bufDist[246];
                std::sprintf(bufDist, "%6.1lfm", Entity->Distance);
                string distm = bufDist;

                Vec2 TextPos = ChangeSidePosText(MV_Distance, GP_Render->CalcTextSize(distm, GP_Render->SzFonts[TextDistanceSize]), Vec2(x, y), Width, Height);
                GP_Render->DrawString((int)TextPos.x - 7 - (Width / MV_Distance->CorrectOfst.x),
                    (int)TextPos.y - (Height / MV_Distance->CorrectOfst.y), TextDistanceSize, DistanceColor, true, false, distm.c_str());
            }

            if (Weapon && MV_Weapon)
            {
                const char* WeaponStr = Entity->WeaponName.c_str();
                Vec2 TextPos = ChangeSidePosText(MV_Weapon, GP_Render->CalcTextSize(WeaponStr, GP_Render->SzFonts[TextWeaponSize]), Vec2(x, y), Width, Height);

                switch (WeaponStyle)
                {
                case 0: GP_Render->DrawString((int)TextPos.x - (Width / MV_Weapon->CorrectOfst.x),
                    (int)TextPos.y - (Height / MV_Weapon->CorrectOfst.y), TextWeaponSize, WeaponColor, true, false, WeaponStr); break;
                case 1:
                {
                    string ico = XorStr("def");
                    if (strstr(WeaponStr, XorStr("HE_Grenade")))
                        ico = XorStr("j");
                    else if (strstr(WeaponStr, XorStr("Smoke_Grenade")))
                        ico = XorStr("k");
                    else if (strstr(WeaponStr, XorStr("FLASHBANG")))
                        ico = XorStr("i");
                    else if (strstr(WeaponStr, XorStr("MOLOTOV")))
                        ico = XorStr("l");
                    else if (strstr(WeaponStr, XorStr("DECOY")))
                        ico = XorStr("m");
                    else if (strstr(WeaponStr, XorStr("IncGrenade")))
                        ico = XorStr("n");
                    else if (strstr(WeaponStr, XorStr("Taser")))
                        ico = XorStr("h");
                    else if (strstr(WeaponStr, XorStr("Knife_T")))
                        ico = XorStr("[");
                    else if (strstr(WeaponStr, XorStr("Knife")))
                        ico = XorStr("]");
                    else if (strstr(WeaponStr, XorStr("C4")))
                        ico = XorStr("o");
                    else
                    {
                        switch (CGlobal::GetWeaponSettingsSelectID(Entity->WeaponIdx))
                        {
                        case 0:  ico = XorStr("A"); break;
                        case 1:  ico = XorStr("B"); break;
                        case 2:  ico = XorStr("C"); break;
                        case 3:  ico = XorStr("D"); break;
                        case 4:  ico = XorStr("F"); break;
                        case 5:  ico = XorStr("F"); break;
                        case 6:  ico = XorStr("G"); break;
                        case 7:  ico = XorStr("I"); break;
                        case 8:  ico = XorStr("J"); break;
                        case 9:  ico = XorStr("H"); break;
                        case 10: ico = XorStr("W"); break;
                        case 11: ico = XorStr("U"); break;
                        case 12: ico = XorStr("R"); break;
                        case 13: ico = XorStr("Q"); break;
                        case 14: ico = XorStr("g"); break;
                        case 15: ico = XorStr("S"); break;
                        case 16: ico = XorStr("T"); break;
                        case 17: ico = XorStr("K"); break;
                        case 18: ico = XorStr("P"); break;
                        case 19: ico = XorStr("L"); break;
                        case 20: ico = XorStr("L"); break;//mp5sd
                        case 21: ico = XorStr("b"); break;
                        case 22: ico = XorStr("M"); break;
                        case 23: ico = XorStr("d"); break;
                        case 24: ico = XorStr("f"); break;
                        case 25: ico = XorStr("c"); break;
                        case 26: ico = XorStr("N"); break;
                        case 27: ico = XorStr("O"); break;
                        case 28: ico = XorStr("e"); break;
                        case 29: ico = XorStr("V"); break;
                        case 30: ico = XorStr("X"); break;
                        case 31: ico = XorStr("Y"); break;
                        case 32: ico = XorStr("Z"); break;
                        case 33: ico = XorStr("a"); break;
                        default: break;
                        }
                    }
                    if (ico.length() == 1)
                    {
                        TextPos = ChangeSidePosText(MV_Weapon, GP_Render->CalcTextSize(ico, GP_Render->SzFontsIcon[TextWeaponSize]), Vec2(x, y), Width, Height);
                        GP_Render->DrawIcon((int)TextPos.x - (Width / MV_Weapon->CorrectOfst.x),
                            (int)TextPos.y - (Height / MV_Weapon->CorrectOfst.y), TextWeaponSize, WeaponColor, true, false, ico.c_str());
                    }
                    break;
                }
                default:
                    break;
                }
            }
            if (Ammo && MV_Ammo)
            {
                char ammo_format[64];

                switch (AmmoStyle)
                {
                case 0:sprintf(ammo_format, "[%i]", Entity->Ammo1); break;
                case 1:sprintf(ammo_format, "[%i\\%i]", Entity->Ammo1, Entity->Ammo2); break;
                case 2:sprintf(ammo_format, "[%i]", Entity->Ammo1 + Entity->Ammo2); break;
                default:
                    break;
                }
               
                string Ammo = string(ammo_format);

                Vec2 TextPos = ChangeSidePosText(MV_Ammo, GP_Render->CalcTextSize(Ammo, GP_Render->SzFonts[TextAmmoSize]), Vec2(x, y), Width, Height);

                GP_Render->DrawString((int)TextPos.x - (Width / MV_Ammo->CorrectOfst.x),
                    (int)TextPos.y - (Height / MV_Ammo->CorrectOfst.y), TextAmmoSize, AmmoColor, true, false, Ammo.c_str());
            }

            if (Money && MV_Money)
            {
                string MoneyStr = to_string(Entity->Money) + XorStr("$");

                Vec2 TextPos = ChangeSidePosText(MV_Money, GP_Render->CalcTextSize(MoneyStr, GP_Render->SzFonts[TextMoneySize]), Vec2(x, y), Width, Height);
                GP_Render->DrawString((int)TextPos.x - (Width / MV_Money->CorrectOfst.x),
                    (int)TextPos.y - (Height / MV_Money->CorrectOfst.y), TextMoneySize, MoneyColor, true, false, MoneyStr.c_str());
            }


            if (Scope && MV_Scoped)
            {
                if (Entity->ZoomLevel == 1 || Entity->ZoomLevel == 2)
                {
                    string DefStr = XorStr("SCOPED");
                    Vec2 TextPos = ChangeSidePosText(MV_Scoped, GP_Render->CalcTextSize(DefStr, GP_Render->SzFonts[TextScopedSize]), Vec2(x, y), Width, Height);

                    GP_Render->DrawString((int)TextPos.x - (Width / MV_Scoped->CorrectOfst.x),
                        (int)TextPos.y - (Height / MV_Scoped->CorrectOfst.y), TextScopedSize, ScopeColor, true, false, DefStr.c_str());
                }
            }

            if (Flashing && MV_Flashed)
            {
                if (Entity->IsFlashed)
                {
                    string DefStr = XorStr("FLASHED");
                    Vec2 TextPos = ChangeSidePosText(MV_Flashed, GP_Render->CalcTextSize(DefStr, GP_Render->SzFonts[TextFlashedSize]), Vec2(x, y), Width, Height);

                    GP_Render->DrawString((int)TextPos.x - (Width / MV_Flashed->CorrectOfst.x),
                        (int)TextPos.y - (Height / MV_Flashed->CorrectOfst.y), TextFlashedSize, FlashingColor, true, false, DefStr.c_str());
                }
            }
        }
    };
    LDrawPlayerEx();
}

void CEsp::PlayerEsp(CEntityPlayer* Local)
{
    auto LPlayerEsp = [&]()->void
    {
        if ((Skeleton || FillBox || BoxEnable || HeadEsp ||
            Name || Health || Armor || Ammo || Distance ||
            Weapon || Money || Scope || Flashing || Line) && BindEnable.Check())
        {
            for (int EntIndex = 0; EntIndex < MAX_ENTITY_PLAYERS; EntIndex++)
            {
                CEntityPlayer* Entity = &GP_EntPlayers->EntityPlayer[EntIndex];

                if (!Entity->IsUpdated)
                    continue;

                if (Entity->IsLocal)
                    continue;

                if (!Entity->IsPlayer)
                    continue;

                if (Entity->IsDead)
                    continue;

                if (Entity->HitBoxes[HITBOX_HEAD].IsZero())
                {
                    if (Entity->Alpha == 255.f)
                    {
                        Entity->HideEndTime = I::GlobalVars()->curtime + DORMANT_TIME;
                        Entity->Alpha -= 1.f;
                    }

                    if (Entity->Alpha != 0.f)
                    {
                        Entity->Alpha = (255.f * ((((Entity->HideEndTime - I::GlobalVars()->curtime) * 100.f) / DORMANT_TIME) / 100.f));

                        if (Entity->Alpha <= 1.f)
                            Entity->Alpha = 0.f;
                    }
                }

                SetPlayerAlpha(Entity->Alpha);
                if (Entity->Alpha != 0.f)
                {
                    DrawPlayerEx(Entity, Local, Entity->HitBoxes[HITBOX_HEAD].IsZero());
                }
                ResetPlayerAlpha();
            }
        }
    };
    LPlayerEsp();
}

//кастыль
void CEsp::SetPlayerAlpha(float NewAlph)
{
    auto LSetPlayerAlpha = [&]()->void
    {
        OldAlphs.clear();

        OldAlphs.push_back(BoxCT[3]);
        OldAlphs.push_back(BoxTT[3]);
        OldAlphs.push_back(BoxVisbleCT[3]);
        OldAlphs.push_back(BoxVisbleTT[3]);
        OldAlphs.push_back(FillBoxColor[3]);
        OldAlphs.push_back(HeadEspColor[3]);
        OldAlphs.push_back(LineColor[3]);
        OldAlphs.push_back(SkeletonColor[3]);
        OldAlphs.push_back(HealthColor[3]);
        OldAlphs.push_back(HealthColor2[3]);
        OldAlphs.push_back(HealthColor3[3]);
        OldAlphs.push_back(ArmorColor[3]);
        OldAlphs.push_back(ArmorColor2[3]);
        OldAlphs.push_back(ArmorColor3[3]);
        OldAlphs.push_back(DistanceColor[3]);
        OldAlphs.push_back(WeaponColor[3]);
        OldAlphs.push_back(AmmoColor[3]);
        OldAlphs.push_back(NameColor[3]);
        OldAlphs.push_back(NameColorBack[3]);
        OldAlphs.push_back(MoneyColor[3]);
        OldAlphs.push_back(FlashingColor[3]);
        OldAlphs.push_back(DefusingColor[3]);

        BoxCT.SetAlph(NewAlph);
        BoxTT.SetAlph(NewAlph);
        BoxVisbleCT.SetAlph(NewAlph);
        BoxVisbleTT.SetAlph(NewAlph);
        FillBoxColor.SetAlph(NewAlph);
        HeadEspColor.SetAlph(NewAlph);
        LineColor.SetAlph(NewAlph);
        SkeletonColor.SetAlph(NewAlph);
        HealthColor.SetAlph(NewAlph);
        HealthColor2.SetAlph(NewAlph);
        HealthColor3.SetAlph(NewAlph);
        ArmorColor.SetAlph(NewAlph);
        ArmorColor2.SetAlph(NewAlph);
        ArmorColor3.SetAlph(NewAlph);
        DistanceColor.SetAlph(NewAlph);
        WeaponColor.SetAlph(NewAlph);
        AmmoColor.SetAlph(NewAlph);
        NameColor.SetAlph(NewAlph);
        NameColorBack.SetAlph(NewAlph);
        MoneyColor.SetAlph(NewAlph);
        FlashingColor.SetAlph(NewAlph);
        DefusingColor.SetAlph(NewAlph);
    };
    LSetPlayerAlpha();
}
void CEsp::ResetPlayerAlpha()
{
    auto LResetPlayerAlpha = [&]()->void
    {
        BoxCT[3] = OldAlphs[0];
        BoxTT[3] = OldAlphs[1];
        BoxVisbleCT[3] = OldAlphs[2];
        BoxVisbleTT[3] = OldAlphs[3];
        FillBoxColor[3] = OldAlphs[4];
        HeadEspColor[3] = OldAlphs[5];
        LineColor[3] = OldAlphs[6];
        SkeletonColor[3] = OldAlphs[7];
        HealthColor[3] = OldAlphs[8];
        HealthColor2[3] = OldAlphs[9];
        HealthColor3[3] = OldAlphs[10];
        ArmorColor[3] = OldAlphs[11];
        ArmorColor2[3] = OldAlphs[12];
        ArmorColor3[3] = OldAlphs[13];
        DistanceColor[3] = OldAlphs[14];
        WeaponColor[3] = OldAlphs[15];
        AmmoColor[3] = OldAlphs[16];
        NameColor[3] = OldAlphs[17];
        NameColorBack[3] = OldAlphs[18];
        MoneyColor[3] = OldAlphs[19];
        FlashingColor[3] = OldAlphs[20];
        DefusingColor[3] = OldAlphs[21];
    };
    LResetPlayerAlpha();
}

void CEsp::Draw3DBox(CEntityPlayer* Entity, Color color)
{
    auto LDraw3DBox = [&]()->void
    {
        ICollideable* coll = Entity->BaseEntity->GetCollideable();

        Vector min = coll->OBBMins();
        Vector max = coll->OBBMaxs();

        Vector corners[8] =
        {
            Vector(min.x,min.y,min.z + 10),
            Vector(min.x,max.y,min.z + 10),
            Vector(max.x,max.y,min.z + 10),
            Vector(max.x,min.y,min.z + 10),
            Vector(min.x,min.y,max.z + 10),
            Vector(min.x,max.y,max.z + 10),
            Vector(max.x,max.y,max.z + 10),
            Vector(max.x,min.y,max.z + 10)
        };

        float ang = Entity->EyeAngle.y;

        for (int i = 0; i <= 7; i++)
            corners[i].Rotate2D(ang);

        Vector _corners[8];

        Vector bufCorners;

        for (int i = 0; i <= 7; i++)
        {
            Vector Orig = Entity->RenderOrigin;
            Orig.z -= 7;
            if (CGlobal::WorldToScreen(Orig + corners[i], bufCorners))
            {
                _corners[i] = bufCorners;
            }
        }

        float x1 = CGlobal::iScreenWidth * 2, y1 = CGlobal::iScreenHeight * 2, x2 = -CGlobal::iScreenWidth, y2 = -CGlobal::iScreenHeight;

        for (int i = 0; i <= 7; i++)
        {
            x1 = (min(x1, _corners[i].x));
            y1 = (min(y1, _corners[i].y));
            x2 = (max(x2, _corners[i].x));
            y2 = (max(y2, _corners[i].y));
        }

        float diff = x2 - x1;
        float diff2 = y2 - y1;


        for (int i = 1; i <= 4; i++)
        {
            if (BoxOutline)
            {
                GP_Render->DrawLine((float)(_corners[i - 1].x), (float)(_corners[i - 1].y) + 1, (float)(_corners[i % 4].x), (float)(_corners[i % 4].y) + 1, Color::Black());// низ
                GP_Render->DrawLine((float)(_corners[i - 1].x), (float)(_corners[i - 1].y) - 1, (float)(_corners[i % 4].x), (float)(_corners[i % 4].y) - 1, Color::Black());// низ

                GP_Render->DrawLine((float)(_corners[i + 3].x), (float)(_corners[i + 3].y) - 1, (float)(_corners[i % 4 + 4].x), (float)(_corners[i % 4 + 4].y) - 1, Color::Black());//верх
                GP_Render->DrawLine((float)(_corners[i + 3].x), (float)(_corners[i + 3].y) + 1, (float)(_corners[i % 4 + 4].x), (float)(_corners[i % 4 + 4].y) + 1, Color::Black());//верх

                GP_Render->DrawLine((float)(_corners[i - 1].x) - 1, (float)(_corners[i - 1].y), (float)(_corners[i + 3].x) - 1, (float)(_corners[i + 3].y), Color::Black());//середина
                GP_Render->DrawLine((float)(_corners[i - 1].x) + 1, (float)(_corners[i - 1].y), (float)(_corners[i + 3].x) + 1, (float)(_corners[i + 3].y), Color::Black());//середина
            }

            GP_Render->DrawLine((_corners[i - 1].x), (_corners[i - 1].y), (_corners[i % 4].x), (_corners[i % 4].y), color);// низ

            GP_Render->DrawLine((_corners[i + 3].x), (_corners[i + 3].y), (_corners[i % 4 + 4].x), (_corners[i % 4 + 4].y), color);//верх

            GP_Render->DrawLine((_corners[i - 1].x), (_corners[i - 1].y), (_corners[i + 3].x), (_corners[i + 3].y), color); //середина
        }
    };
    LDraw3DBox();
}

void CEsp::DrawSkeletonLine(int point1, int point2, CEntityPlayer* Entity)
{
    Vector HitBoxScreen1;
    Vector HitBoxScreen2;

    if (CGlobal::WorldToScreen(Entity->HitBoxes[point1], HitBoxScreen1) && CGlobal::WorldToScreen(Entity->HitBoxes[point2], HitBoxScreen2))
        GP_Render->DrawLine(HitBoxScreen1.x, HitBoxScreen1.y, HitBoxScreen2.x, HitBoxScreen2.y, SkeletonColor);
}


void CEsp::DrawBar(Orent O, float x, float y, float w, float h, float val, bool Outline, Color MainC1, Color cBack, bool bBack, int Razd, bool Revers, Color OutlineCol)
{
    auto LDrawBar = [&]()->void
    {
        if (val > 100) val = 100;
        float size = (h * val) / 100;

        x = (int)x;
        y = (int)y;

        w = (int)w;
        h = (int)h;


        if (bBack)
            GP_Render->DrawFilledBox(x + 1, y + 1, w - 1, h - 1, cBack);


        if (O == VERTICAL)
        {

            if (Revers)
                GP_Render->DrawFilledBox(x + 1, y + 1, w - 1, size - 1, MainC1);
            else
                GP_Render->DrawFilledBox(x + 1, y + 1 + (h - size), w - 1, size, MainC1);


            if (Razd != 0)
            {
                Razd += 1;
                float DistL = h / Razd;

                if (Razd == 1)
                    DistL = h / 2.f;

                for (int i(1); i < Razd; i++)
                    GP_Render->DrawLine(int(x), int(y + h - (DistL*i)), int(x + w), int(y + h - (DistL*i)), OutlineCol);
            }
        }
        else
        {
            size = (w * val) / 100;

            if (Revers)
                GP_Render->DrawFilledBox(x + 1, y + 1, size - 1, h - 1, MainC1);
            else
                GP_Render->DrawFilledBox(x + 1 + (w - size), y + 1, size - 1, h - 1, MainC1);

            if (Razd != 0)
            {
                Razd += 1;
                float DistL = w / Razd;

                if (Razd == 1)
                    DistL = w / 2.f;

                for (int i(1); i < Razd; i++)
                    GP_Render->DrawLine(int(x + w - (DistL*i)), int(y), int(x + w - (DistL*i)), int(y + h), OutlineCol);
            }
        }

        if (Outline)
            GP_Render->DrawBox(x, y, w + 1, h + 1, 1, OutlineCol);
    };
    LDrawBar();
}

IMaterial* HidTex = nullptr;
IMaterial* VisTex = nullptr;

IMaterial* HidFlat = nullptr;
IMaterial* VisFlat = nullptr;

IMaterial* HidFrame = nullptr;
IMaterial* VisFrame = nullptr;

IMaterial* HidMetall = nullptr;
IMaterial* VisMetall = nullptr;

void CEsp::DrawModelExecute(void* thisptr, IMatRenderContext* ctx, const DrawModelState_t &state, const ModelRenderInfo_t &pInfo, matrix3x4_t *pCustomBoneToWorld)
{
    if (Enable && Chams && BindEnable.Check())
    {
        if (!HidTex)
            HidTex = CGlobal::CreateMaterialNew(true);

        if (!VisTex)
            VisTex = CGlobal::CreateMaterialNew(false);

        if (!HidFlat)
            HidFlat = CGlobal::CreateMaterialNew(true, false);

        if (!VisFlat)
            VisFlat = CGlobal::CreateMaterialNew(false, false);

        if (!HidFrame)
            HidFrame = CGlobal::CreateMaterialNew(true, true, true);

        if (!VisFrame)
            VisFrame = CGlobal::CreateMaterialNew(false, true, true);

        if (!HidMetall)
            HidMetall = CGlobal::CreateMaterialMetall(true, true);

        if (!VisMetall)
            VisMetall = CGlobal::CreateMaterialMetall(false, true);

        if (!HidTex || !VisTex || !HidFlat || !VisFlat ||
            !HidFrame || !VisFrame || !HidMetall || !VisMetall)
            return;

        const char* ModelName = I::ModelInfo()->GetModelName((model_t*)pInfo.pModel);

        if (!ModelName)
            return;

        if (!strstr(ModelName, XorStr("models/player")))
            return;

        CEntityPlayer* Entity = GP_EntPlayers->GetByIdx(pInfo.entity_index);
        CEntityPlayer* Local = GP_EntPlayers->EntityLocal;

        if (!Entity || !Local)
            return;

        if (!Entity->IsUpdated)
            return;

        if (Entity->IsDead || Entity->Health <= 0)
            return;

        if (!Team && Entity->Team == Local->Team)
            return;

        if (!Enemy && Entity->Team != Local->Team)
            return;

        Color InvisColor = (Entity->Team == PLAYER_TEAM::TEAM_CT) ? ChamsCT : ChamsTT;
        Color VisbleColor = (Entity->Team == PLAYER_TEAM::TEAM_CT) ? ChamsVisbleCT : ChamsVisbleTT;

        if (!ChamsVisbleOnly)
        {
            float ArrColor[3] = { InvisColor.G1R(), InvisColor.G1G(), InvisColor.G1B() };

            I::RenderView()->SetColorModulation(ArrColor);
            I::RenderView()->SetBlend(InvisColor.G1A());

            switch (ChamsStyle)
            {
            case 0: I::ModelRender()->ForcedMaterialOverride(HidTex); break;
            case 1: I::ModelRender()->ForcedMaterialOverride(HidFlat); break;
            case 2: I::ModelRender()->ForcedMaterialOverride(HidFrame); break;
            case 4: I::ModelRender()->ForcedMaterialOverride(HidMetall); break;
            default: break;
            }

            HookTables::pDrawModelExecute->GetTrampoline()(thisptr, ctx, state, pInfo, pCustomBoneToWorld);
        }

        float ArrVisbleColor[3] = { VisbleColor.G1R(), VisbleColor.G1G(), VisbleColor.G1B() };

        if (ChamsStyle == 3)
        {
            if (ChipolinoFixColor > 1.f)
                ChipolinoFixColor /= 100.f;
            float FixColor = 100.01f - (99.f + ChipolinoFixColor);
            ArrVisbleColor[0] = ArrVisbleColor[0] / FixColor;
            ArrVisbleColor[1] = ArrVisbleColor[1] / FixColor;
            ArrVisbleColor[2] = ArrVisbleColor[2] / FixColor;
        }

        I::RenderView()->SetColorModulation(ArrVisbleColor);
        I::RenderView()->SetBlend(VisbleColor.G1A());

        switch (ChamsStyle)
        {
        case 0: I::ModelRender()->ForcedMaterialOverride(VisTex); break;
        case 1: I::ModelRender()->ForcedMaterialOverride(VisFlat); break;
        case 2: I::ModelRender()->ForcedMaterialOverride(VisFrame); break;
        case 4: I::ModelRender()->ForcedMaterialOverride(VisMetall); break;
        default: break;
        }

        HookTables::pDrawModelExecute->GetTrampoline()(thisptr, ctx, state, pInfo, pCustomBoneToWorld);
    }
}
По теме: бро, не морочь себе голову этим хоне, в котором кроме вх придеться много чего фиксить. Возьми лучше другой сурс, тот же АйКлудед.
 
pa$$Ter
Начинающий
Статус
Оффлайн
Регистрация
5 Янв 2018
Сообщения
75
Реакции[?]
14
Поинты[?]
0
У него нет симп что б даже личный попросить. Тем более, уже ссылка на фикс ХоНе не работает - закончилось время хранения файла.


По теме: бро, не морочь себе голову этим хоне, в котором кроме вх придеться много чего фиксить. Возьми лучше другой сурс, тот же АйКлудед.
Оке, попробую айклудед, спасибо)
 
Сверху Снизу