Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "common.h"
- #include "interfaces.h"
- #include "usercmd.h"
- #include "baseentity.h"
- #include "definitions.h"
- #include "draw.h"
- #include "viewsetup.h"
- #include "maths.h"
- #include "material.h"
- #include <algorithm>
- #include <unordered_map>
- #include <sys\stat.h>
- #include <fstream>
- #include "glowobject.h"
- #include "utils.h"
- #include "menu.h"
- #include "raytracing.h"
- #pragma comment(lib, "Winmm.lib")
- #define HITGROUP_GENERIC 0
- #define HITGROUP_HEAD 1
- #define HITGROUP_CHEST 2
- #define HITGROUP_STOMACH 3
- #define HITGROUP_LEFTARM 4
- #define HITGROUP_RIGHTARM 5
- #define HITGROUP_LEFTLEG 6
- #define HITGROUP_RIGHTLEG 7
- #define HITGROUP_GEAR 10 // alerts NPC, but doesn't do damage or bleed (1/100th damage)
- #define BONE_USED_MASK 0x0007FF00
- #define BONE_USED_BY_ANYTHING 0x0007FF00
- #define BONE_USED_BY_HITBOX 0x00000100 // bone (or child) is used by a hit box
- #define BONE_USED_BY_ATTACHMENT 0x00000200 // bone (or child) is used by an attachment point
- #define BONE_USED_BY_VERTEX_MASK 0x0003FC00
- #define BONE_USED_BY_VERTEX_LOD0 0x00000400 // bone (or child) is used by the toplevel model via skinned vertex
- #define BONE_USED_BY_VERTEX_LOD1 0x00000800
- #define BONE_USED_BY_VERTEX_LOD2 0x00001000
- #define BONE_USED_BY_VERTEX_LOD3 0x00002000
- #define BONE_USED_BY_VERTEX_LOD4 0x00004000
- #define BONE_USED_BY_VERTEX_LOD5 0x00008000
- #define BONE_USED_BY_VERTEX_LOD6 0x00010000
- #define BONE_USED_BY_VERTEX_LOD7 0x00020000
- #define BONE_USED_BY_BONE_MERGE 0x00040000 // bone is available for bone merge to occur against it
- enum ClientFrameStage_t
- {
- FRAME_UNDEFINED = -1,
- FRAME_START,
- FRAME_NET_UPDATE_START,
- FRAME_NET_UPDATE_POSTDATAUPDATE_START,
- FRAME_NET_UPDATE_POSTDATAUPDATE_END,
- FRAME_NET_UPDATE_END,
- FRAME_RENDER_START,
- FRAME_RENDER_END
- };
- enum ClassIDs
- {
- CAI_BaseNPC = 0,
- CAK47,
- CBaseAnimating,
- CBaseAnimatingOverlay ,
- CBaseAttributableItem_,
- CBaseButton,
- CBaseCSGrenade,
- CBaseCSGrenadeProjectile,
- CBaseDoor,
- CBaseFlex,
- CBaseGrenade,
- CBaseParticleEntity,
- CBasePlayer,
- CBasePropDoor,
- CBaseTeamObjectiveResource,
- CBaseTempEntity,
- CBaseToggle,
- CBaseTrigger,
- CBaseViewModel,
- CBaseVPhysicsTrigger,
- CBaseWeaponWorldModel,
- CBeam,
- CBeamSpotlight,
- CBoneFollower,
- CBreakableProp,
- CBreakableSurface,
- CC4,
- CCascadeLight,
- CChicken,
- CColorCorrection,
- CColorCorrectionVolume,
- CCSGameRulesProxy,
- CCSPlayer,
- CCSPlayerResource,
- CCSRagdoll,
- CCSTeam,
- CDEagle,
- CDecoyGrenade,
- CDecoyProjectile,
- CDynamicLight,
- CDynamicProp,
- CEconEntity,
- CEmbers,
- CEntityDissolve,
- CEntityFlame,
- CEntityFreezing,
- CEntityParticleTrail,
- CEnvAmbientLight,
- CEnvDetailController,
- CEnvDOFController,
- CEnvParticleScript,
- CEnvProjectedTexture,
- CEnvQuadraticBeam,
- CEnvScreenEffect,
- CEnvScreenOverlay,
- CEnvTonemapController,
- CEnvWind,
- CFireCrackerBlast,
- CFireSmoke,
- CFireTrail,
- CFish,
- CFlashbang,
- CFogController,
- CFootstepControl,
- CFunc_Dust,
- CFunc_LOD,
- CFuncAreaPortalWindow,
- CFuncBrush,
- CFuncConveyor,
- CFuncLadder,
- CFuncMonitor,
- CFuncMoveLinear,
- CFuncOccluder,
- CFuncReflectiveGlass,
- CFuncRotating,
- CFuncSmokeVolume,
- CFuncTrackTrain,
- CGameRulesProxy,
- CHandleTest,
- CHEGrenade,
- CHostage,
- CHostageCarriableProp,
- CIncendiaryGrenade,
- CInferno,
- CInfoLadderDismount,
- CInfoOverlayAccessor,
- CItem_Healthshot,
- CKnife,
- CKnifeGG,
- CLightGlow,
- CMaterialModifyControl,
- CMolotovGrenade,
- CMolotovProjectile,
- CMovieDisplay,
- CParticleFire,
- CParticlePerformanceMonitor,
- CParticleSystem,
- CPhysBox,
- CPhysBoxMultiplayer,
- CPhysicsProp,
- CPhysicsPropMultiplayer,
- CPhysMagnet,
- CPlantedC4,
- CPlasma,
- CPlayerResource,
- CPointCamera,
- CPointCommentaryNode,
- CPoseController,
- CPostProcessController,
- CPrecipitation,
- CPrecipitationBlocker,
- CPredictedViewModel,
- CProp_Hallucination,
- CPropDoorRotating,
- CPropJeep,
- CPropVehicleDriveable,
- CRagdollManager,
- CRagdollProp,
- CRagdollPropAttached,
- CRopeKeyframe,
- CSCAR17,
- CSceneEntity,
- CSensorGrenade,
- CSensorGrenadeProjectile,
- CShadowControl,
- CSlideshowDisplay,
- CSmokeGrenade,
- CSmokeGrenadeProjectile,
- CSmokeStack,
- CSpatialEntity,
- CSpotlightEnd,
- CSprite,
- CSpriteOriented,
- CSpriteTrail,
- CStatueProp,
- CSteamJet,
- CSun,
- CSunlightShadowControl,
- CTeam,
- CTeamplayRoundBasedRulesProxy,
- CTEArmorRicochet,
- CTEBaseBeam,
- CTEBeamEntPoint,
- CTEBeamEnts,
- CTEBeamFollow,
- CTEBeamLaser,
- CTEBeamPoints,
- CTEBeamRing,
- CTEBeamRingPoint,
- CTEBeamSpline,
- CTEBloodSprite,
- CTEBloodStream,
- CTEBreakModel1,
- CTEBSPDecal,
- CTEBubbles,
- CTEBubbleTrail,
- CTEClientProjectile,
- CTEDecal,
- CTEDust,
- CTEDynamicLight,
- CTEEffectDispatch,
- CTEEnergySplash,
- CTEExplosion,
- CTEFireBullets,
- CTEFizz,
- CTEFootprintDecal,
- CTEFoundryHelpers,
- CTEGaussExplosion,
- CTEGlowSprite,
- CTEImpact,
- CTEKillPlayerAttachments,
- CTELargeFunnel,
- CTEMetalSparks,
- CTEMuzzleFlash,
- CTEParticleSystem,
- CTEPhysicsProp,
- CTEPlantBomb,
- CTEPlayerAnimEvent,
- CTEPlayerDecal,
- CTEProjectedDecal,
- CTERadioIcon,
- CTEShatterSurface,
- CTEShowLine,
- CTesla,
- CTESmoke,
- CTESparks,
- CTESprite,
- CTESpriteSpray,
- CTest_ProxyToggle_Networkable,
- CTestTraceline,
- CTEWorldDecal,
- CTriggerPlayerMovement,
- CTriggerSoundOperator,
- CVGuiScreen,
- CVoteController,
- CWaterBullet,
- CWaterLODControl,
- CWeaponAug,
- CWeaponAWP,
- CWeaponBaseItem,
- CWeaponBizon,
- CWeaponCSBase,
- CWeaponCSBaseGun,
- CWeaponCycler,
- CWeaponElite,
- CWeaponFamas,
- CWeaponFiveSeven,
- CWeaponG3SG1,
- CWeaponGalil,
- CWeaponGalilAR,
- CWeaponGlock,
- CWeaponHKP2000,
- CWeaponM249,
- CWeaponM3,
- CWeaponM4A1,
- CWeaponMAC10,
- CWeaponMag7,
- CWeaponMP5Navy,
- CWeaponMP7,
- CWeaponMP9,
- CWeaponNegev,
- CWeaponNOVA,
- CWeaponP228,
- CWeaponP250,
- CWeaponP90,
- CWeaponSawedoff,
- CWeaponSCAR20,
- CWeaponScout,
- CWeaponSG550,
- CWeaponSG552,
- CWeaponSG556,
- CWeaponSSG08,
- CWeaponTaser,
- CWeaponTec9,
- CWeaponTMP,
- CWeaponUMP45,
- CWeaponUSP,
- CWeaponXM1014,
- CWorld,
- DustTrail,
- MovieExplosion,
- ParticleSmokeGrenade,
- RocketTrail,
- SmokeTrail,
- SporeExplosion,
- SporeTrail
- };
- void TraceLine( Vector& vecAbsStart, Vector& vecAbsEnd, unsigned int mask, CBaseEntity* ignore, trace_t* ptr )
- {
- Ray_t ray;
- ray.Init( vecAbsStart, vecAbsEnd );
- CTraceFilter filter;
- filter.pSkip = ignore;
- I::EngineTrace->TraceRay( ray, mask, &filter, ptr );
- }
- unsigned int drawPanel;
- int ScreenWidth, ScreenHeight;
- IMaterial* ChamsMat, *ChamsMat_IgnoreZ, *ChamsMat_Flat, *ChamsMat_Flat_IgnoreZ;
- bool bDrawHitmarker;
- int iHitmarkerTime;
- int iTotalHits;
- bool bInAntiAim;
- Vector LastViewAngles;
- CBaseEntity* pLocal;
- bool bSendPacket;
- std::vector<char*> Spectators;
- DWORD ServerRankRevealAllOff;
- class CFixMove
- {
- public:
- void Start(CUserCmd* pCmd)
- {
- m_oldangle = pCmd->viewangles;
- m_oldforward = pCmd->forwardmove;
- m_oldsidemove = pCmd->sidemove;
- }
- void End(CUserCmd* pCmd)
- {
- float yaw_delta = pCmd->viewangles.y - m_oldangle.y;
- float f1;
- float f2;
- if( m_oldangle.y < 0.f )
- f1 = 360.0f + m_oldangle.y;
- else
- f1 = m_oldangle.y;
- if( pCmd->viewangles.y < 0.0f )
- f2 = 360.0f + pCmd->viewangles.y;
- else
- f2 = pCmd->viewangles.y;
- if( f2 < f1 )
- yaw_delta = abs( f2 - f1 );
- else
- yaw_delta = 360.0f - abs( f1 - f2 );
- yaw_delta = 360.0f - yaw_delta;
- pCmd->forwardmove = cos( DEG2RAD( yaw_delta ) ) * m_oldforward + cos( DEG2RAD( yaw_delta + 90.f ) ) * m_oldsidemove;
- pCmd->sidemove = sin( DEG2RAD( yaw_delta ) ) * m_oldforward + sin( DEG2RAD( yaw_delta + 90.f ) ) * m_oldsidemove;
- }
- private:
- float m_oldforward, m_oldsidemove;
- Vector m_oldangle;
- };
- class CCorrection
- {
- public:
- int index;
- Vector RealAngles;
- CCorrection(int index, Vector RealAngles) { this->index = index; this->RealAngles = RealAngles; }
- };
- CBaseCombatWeapon* GetWeapon(CBaseEntity* pEntity, int Index)
- {
- //return (CBaseCombatWeapon*)I::ClientEntList->GetClientEntityFromHandle(GetFieldValue<CHandle<CBaseCombatWeapon>>(0x2DE8 + ((Index - 1) * 0x4)));
- //inline T GetFieldValue(int Offset) { return *(T*)((DWORD)this + Offset); }
- return (CBaseCombatWeapon*)I::ClientEntList->GetClientEntityFromHandle( *(CHandle<CBaseCombatWeapon>*)((DWORD)pEntity + 0x2DE8 + ((Index - 1) * 0x4)) );
- }
- CBaseCombatWeapon* GetActiveWeapon(CBaseEntity* pEntity)
- {
- return (CBaseCombatWeapon*)I::ClientEntList->GetClientEntityFromHandle( *(CHandle<CBaseCombatWeapon>*)((DWORD)pEntity + 0x2EE8) );
- }
- typedef bool(__cdecl *ServerRankRevealAllFn)(float*);
- ServerRankRevealAllFn ServerRankRevealAllEx;
- void ServerRankRevealAll()
- {
- static float fArray[ 3 ] = { 0.f, 0.f, 0.f };
- ServerRankRevealAllOff = Utils::FindPattern("client.dll", "55 8B EC 8B 0D ? ? ? ? 68 ? ? ? ?");
- if (!ServerRankRevealAllOff) return;
- ServerRankRevealAllEx = ( ServerRankRevealAllFn )( ServerRankRevealAllOff );
- if (!ServerRankRevealAllEx) return;
- ServerRankRevealAllEx( fArray );
- }
- enum Hitboxes
- {
- HITBOX_HEAD,
- HITBOX_NECK,
- HITBOX_LOWER_NECK,
- HITBOX_PELVIS,
- HITBOX_BODY,
- HITBOX_THORAX,
- HITBOX_CHEST,
- HITBOX_UPPER_CHEST,
- HITBOX_RIGHT_THIGH,
- HITBOX_LEFT_THIGH,
- HITBOX_RIGHT_CALF,
- HITBOX_LEFT_CALF,
- HITBOX_RIGHT_FOOT,
- HITBOX_LEFT_FOOT,
- HITBOX_RIGHT_HAND,
- HITBOX_LEFT_HAND,
- HITBOX_RIGHT_UPPER_ARM,
- HITBOX_RIGHT_FOREARM,
- HITBOX_LEFT_UPPER_ARM,
- HITBOX_LEFT_FOREARM,
- HITBOX_MAX
- };
- struct TargetList_t
- {
- float distance;
- float fClose;
- Vector AimbotAngle;
- float AimAngleDiff;
- TargetList_t(){}
- TargetList_t(Vector aimAngle, Vector myCoords, Vector enCoords)
- {
- //Calculate crosshair distance
- Vector PlayerAngles;
- I::Engine->GetViewAngles(PlayerAngles);
- fClose = Math.GetFov( PlayerAngles, myCoords, enCoords );
- AimbotAngle = aimAngle;
- }
- };
- struct CompareTargetByCrosshairDistance
- {
- bool operator() (TargetList_t & lhs, TargetList_t & rhs)
- {
- return lhs.fClose < rhs.fClose;
- }
- };
- void PlayerBox( float x, float y, float w, float h, Color clr )
- {
- int r = 255, g = 255, b = 255, a = 255;
- clr.GetColor(r,g,b,a);
- I::Surface->DrawSetColor( r, g, b, a );
- I::Surface->DrawOutlinedRect( x - w, y, x + w, y + h );
- I::Surface->DrawSetColor( 0, 0, 0, 255 );
- I::Surface->DrawOutlinedRect( x - w - 1, y - 1, x + w + 1, y + h + 1 );
- I::Surface->DrawOutlinedRect( x - w + 1, y + 1, x + w - 1, y + h - 1 );
- }
- void HealthBar( Vector bot, Vector top, float health )
- {
- float h = ( bot.y - top.y );
- float offset = ( h / 4.f ) + 5;
- float w = h / 64.f;
- UINT hp = h - ( UINT )( ( h * health ) / 100 ); // Percentage
- Draw::DrawOutlinedRect( ( top.x - offset ) - 1, top.y - 1, 3, h + 2, Color::Black() );
- Draw::DrawLine( ( top.x - offset ), top.y + hp, ( top.x - offset ), top.y + h, Color::Green() );
- }
- void ArmorBar( Vector bot, Vector top, float armor )
- {
- float h = ( bot.y - top.y );
- float offset = ( h / 4.f ) + 10;
- float w = h / 64.f;
- UINT arm = h - (UINT)( ( h * armor ) / 100 );
- Draw::DrawOutlinedRect( ( top.x - offset ) - 1, top.y - 1, 3, h + 2, Color::Black() );
- Draw::DrawLine( ( top.x - offset ), top.y + arm, ( top.x - offset ), top.y + h, Color::Lightblue() );
- }
- player_info_t GetInfo(int Index)
- {
- player_info_t temp;
- I::Engine->GetPlayerInfo(Index, &temp);
- return temp;
- }
- CBaseCombatWeapon* GetWeapon(CBaseEntity* curent)
- {
- CBaseCombatWeapon* temp = (CBaseCombatWeapon*)I::ClientEntList->GetClientEntityFromHandle(curent->GetWeaponHandle());
- if (!temp) return nullptr;
- return temp;
- }
- CBaseEntity* GetObserverTarget(CBaseEntity* curent)
- {
- CBaseEntity* temp = (CBaseEntity*)I::ClientEntList->GetClientEntityFromHandle(curent->GetObserverTarget());
- if (!temp) return nullptr;
- return temp;
- }
- float GetBombTimer(CBaseEntity* curent)
- {
- float returnValue = curent->GetBombTimer() - I::Globals->curtime;
- return ( returnValue < 0 ) ? 0.f : returnValue;
- }
- bool IsFileExists(const std::string& name)
- {
- struct stat buffer;
- return (stat(name.c_str(), &buffer) == 0);
- }
- std::string GetWorkingPath()
- {
- char szPath[MAX_PATH];
- GetModuleFileNameA(0, szPath, MAX_PATH);
- std::string path(szPath);
- return path.substr(0, path.find_last_of("\\") + 1);
- }
- void ForceMaterial( IMaterial* material, Color color )
- {
- if( material != NULL )
- {
- I::RenderView->SetColorModulation( color.Base() );
- I::ModelRenderer->ForcedMaterialOverride( material );
- }
- }
- void PlayerBox3D( CBaseEntity* pEntity, CBaseEntity* pLocal )
- {
- ICollideable* coll = pEntity->GetCollideable();
- if (!coll) return;
- Vector min = coll->OBBMins();
- Vector max = coll->OBBMaxs();
- Vector corners[8] =
- {
- Vector(min.x,min.y,min.z),
- Vector(min.x,max.y,min.z),
- Vector(max.x,max.y,min.z),
- Vector(max.x,min.y,min.z),
- Vector(min.x,min.y,max.z),
- Vector(min.x,max.y,max.z),
- Vector(max.x,max.y,max.z),
- Vector(max.x,min.y,max.z)
- };
- float ang = pEntity->GetEyeAngles().y;
- for (int i=0; i<=7; i++)
- corners[i].Rotate2D(ang);
- Vector _corners[8];
- for (int i=0; i<=7; i++)
- {
- if (!Draw::WorldToScreen(pEntity->GetAbsOrigin() + corners[i], _corners[i]))
- continue;
- }
- int x1 = ScreenWidth * 2, y1 = ScreenHeight * 2, x2 = -ScreenWidth, y2 = -ScreenHeight;
- for (int i = 0; i <= 7; i++)
- {
- x1 = (int)(min(x1, _corners[i].x));
- y1 = (int)(min(y1, _corners[i].y));
- x2 = (int)(max(x2, _corners[i].x));
- y2 = (int)(max(y2, _corners[i].y));
- }
- int diff = x2 - x1;
- int diff2 = y2 - y1;
- static Color col;
- if (pEntity->GetTeamNum() == pLocal->GetTeamNum())
- col = Color::Lime();
- else
- col = Color::Red();
- for (int i = 1; i <= 4; i++)
- {
- Draw::DrawLine((int)(_corners[i - 1].x), (int)(_corners[i - 1].y), (int)(_corners[i % 4].x), (int)(_corners[i % 4].y), col);
- Draw::DrawLine((int)(_corners[i - 1].x), (int)(_corners[i - 1].y), (int)(_corners[i + 3].x), (int)(_corners[i + 3].y), col);
- Draw::DrawLine((int)(_corners[i + 3].x), (int)(_corners[i + 3].y), (int)(_corners[i % 4 + 4].x), (int)(_corners[i % 4 + 4].y), col);
- }
- }
- typedef bool(__stdcall* CreateMoveFn)(float, CUserCmd*);
- CreateMoveFn oCreateMove;
- typedef void(__thiscall* PaintTraverseFn)(void*, unsigned int, bool, bool);
- PaintTraverseFn oPaintTraverse;
- typedef void(__stdcall* OverrideViewFn)(CViewSetup*);
- OverrideViewFn oOverrideView;
- typedef void(__thiscall* FrameStageNotifyFn)(void*, ClientFrameStage_t);
- FrameStageNotifyFn oFrameStageNotify;
- typedef void*(__thiscall* DrawModelExecuteFn)(void*, void*, void*, const ModelRenderInfo_t&, matrix3x4_t*);
- DrawModelExecuteFn oDrawModelExecute;
- typedef bool(__thiscall *FireEventClientSideFn)(void*, CGameEvent*);
- FireEventClientSideFn oFireEventClientSide;
- bool __stdcall hkCreateMove(float SampleTime, CUserCmd* cmd);
- void __fastcall hkPaintTraverse(void* _this, void*, unsigned int panel, bool forceRepaint, bool allowForce);
- void __stdcall hkOverrideView(CViewSetup* pViewSetup);
- void __fastcall hkFrameStageNotify(void* ecx, void* edx, ClientFrameStage_t Stage);
- void __fastcall hkDrawModelExecute(void* _this, void*, void* context, void* state, const ModelRenderInfo_t& pInfo, matrix3x4_t* pCustomBoneToWorld);
- bool __fastcall hkFireEventClientSide(void* ecx, void* edx, CGameEvent* pEvent);
- RecvVarProxyFn oModelIndex, oItemDefinitionIndex, oSmokeEffectTickBegin;
- void hkModelIndex(const CRecvProxyData* pData, void* pStruct, void* pOut);
- void hkItemDefinitionIndex(const CRecvProxyData* pData, void* pStruct, void* pOut);
- void hkSmokeEffectTickBegin(const CRecvProxyData* pData, void* pStruct, void* pOut);
- namespace Hooks
- {
- CVMTHookManager* ClientHook;
- CVMTHookManager* ClientModeHook;
- CVMTHookManager* PanelHook;
- CVMTHookManager* ModelRendererHook;
- CVMTHookManager* EventManagerHook;
- void Hook()
- {
- bDrawHitmarker = false;
- bInAntiAim = false;
- iTotalHits = 0;
- bSendPacket = true;
- ClientHook = new CVMTHookManager(I::Client);
- ClientModeHook = new CVMTHookManager(I::ClientMode);
- PanelHook = new CVMTHookManager(I::Panel);
- ModelRendererHook = new CVMTHookManager(I::ModelRenderer);
- EventManagerHook = new CVMTHookManager(I::GameEventManager);
- oCreateMove = (CreateMoveFn)ClientModeHook->HookFunction(24, hkCreateMove);
- oOverrideView = (OverrideViewFn)ClientModeHook->HookFunction(18, hkOverrideView);
- oPaintTraverse = (PaintTraverseFn)PanelHook->HookFunction(41, hkPaintTraverse);
- oFrameStageNotify = (FrameStageNotifyFn)ClientHook->HookFunction(36, hkFrameStageNotify);
- oDrawModelExecute = (DrawModelExecuteFn)ModelRendererHook->HookFunction(21, hkDrawModelExecute);
- oFireEventClientSide = (FireEventClientSideFn)EventManagerHook->HookFunction(9 , hkFireEventClientSide);
- oModelIndex = Netvars->GetProxyFunction("DT_BaseViewModel", "m_nModelIndex");
- oItemDefinitionIndex = Netvars->GetProxyFunction("DT_BaseAttributableItem", "m_iItemDefinitionIndex");
- oSmokeEffectTickBegin = Netvars->GetProxyFunction("DT_SmokeGrenadeProjectile", "m_nSmokeEffectTickBegin");
- Netvars->HookProp("DT_BaseViewModel", "m_nModelIndex", hkModelIndex);
- Netvars->HookProp("DT_BaseAttributableItem", "m_iItemDefinitionIndex", hkItemDefinitionIndex);
- Netvars->HookProp("DT_SmokeGrenadeProjectile", "m_nSmokeEffectTickBegin", hkSmokeEffectTickBegin);
- ClientHook->HookTable(true);
- ClientModeHook->HookTable(true);
- PanelHook->HookTable(true);
- ModelRendererHook->HookTable(true);
- EventManagerHook->HookTable(true);
- }
- void Unhook()
- {
- delete ClientHook;
- delete ClientModeHook;
- delete PanelHook;
- delete ModelRendererHook;
- delete EventManagerHook;
- Netvars->HookProp("DT_BaseViewModel", "m_nModelIndex", oModelIndex);
- Netvars->HookProp("DT_BaseAttributableItem", "m_iItemDefinitionIndex", oItemDefinitionIndex);
- Netvars->HookProp("DT_SmokeGrenadeProjectile", "m_nSmokeEffectTickBegin", oSmokeEffectTickBegin);
- }
- }
- bool __stdcall hkCreateMove(float SampleTime, CUserCmd* cmd)
- {
- // Work here on CreateMove
- if (!cmd) return false;
- if (!cmd->command_number) return false;
- // Grab the local player
- CBaseEntity* me = (CBaseEntity*)I::ClientEntList->GetClientEntity(I::Engine->GetLocalPlayerIndex());
- if (!me) return false;
- pLocal = me;
- // Grab bSendPacket
- PDWORD pFramePointer;
- __asm mov pFramePointer, ebp;
- *(bool*)(*pFramePointer - 0x1C) = bSendPacket;
- if (cmd->buttons & IN_JUMP && !(me->GetFlags() & FL_ONGROUND))
- {
- cmd->buttons &= ~IN_JUMP;
- bool backwards = cmd->forwardmove < 0;
- if(cmd->mousedx < 0) cmd->sidemove = backwards ? 650.f : -650.f;
- if(cmd->mousedx > 0) cmd->sidemove = backwards ? -650.f : 650.f;
- }
- if (GetAsyncKeyState(VK_F1) && me->GetMoveType() != MOVETYPE_LADDER && me->GetMoveType() != MOVETYPE_NOCLIP)
- cmd->tick_count = INT_MAX;
- if (cmd->buttons & IN_SCORE)
- ServerRankRevealAll();
- if (me->isAlive())
- {
- // RAGEBOT
- TargetList_t* TargetList = new TargetList_t[64];
- int targetLoop = 0;
- Vector AimbotAngle;
- // ANTIAIM
- CFixMove FixMove;
- FixMove.Start(cmd);
- Vector temp;
- if (me->GetMoveType() != MOVETYPE_LADDER && me->GetMoveType() != MOVETYPE_NOCLIP)
- {
- if (!(cmd->buttons & IN_ATTACK) && !pLocal->IsDefusing())
- {
- cmd->viewangles.x = 180.f;
- cmd->viewangles.y -= 180.f;
- Math.NormalizeVector(cmd->viewangles);
- }
- }
- FixMove.End(cmd);
- Vector bone;
- for (int i=1; i<=I::Globals->maxClients; i++)
- {
- CBaseEntity* enemy = (CBaseEntity*)I::ClientEntList->GetClientEntity(i);
- if (!enemy) continue;
- if (enemy->IsDormant()) continue;
- if (!enemy->isAlive()) continue;
- if (enemy->GetTeamNum() == me->GetTeamNum()) continue;
- if (enemy->IsImmune()) continue;
- bone = enemy->GetBonePos(6);
- AimbotAngle = Math.CalcAngle(me->GetEyePosition(), bone);
- Math.NormalizeVector(AimbotAngle);
- AimbotAngle -= me->GetPunchAngle() * 2.f;
- Math.NormalizeVector(AimbotAngle);
- TargetList[targetLoop] = TargetList_t(AimbotAngle, me->GetEyePosition(), bone);
- targetLoop++;
- }
- if (targetLoop > 0)
- {
- std::sort(TargetList, TargetList + targetLoop, CompareTargetByCrosshairDistance());
- if (cmd->buttons & IN_ATTACK)
- {
- //cmd->buttons |= IN_DUCK;
- cmd->sidemove = 0.f;
- cmd->forwardmove = 0.f;
- cmd->viewangles = (TargetList[0].AimbotAngle);
- }
- delete [] TargetList;
- }
- }
- LastViewAngles = cmd->viewangles;
- if (cmd->viewangles.x > 89.f || cmd->viewangles.x < -89.f )
- printf("Gotcha your X got out of bounds! X = %f\n", cmd->viewangles.x);
- if (cmd->viewangles.y > 180.f || cmd->viewangles.y < -180.f)
- printf("Gotcha your Y got out of bounds! Y = %f\n", cmd->viewangles.y);
- return false;
- }
- void __fastcall hkPaintTraverse(void* _this, void*, unsigned int panel, bool forceRepaint, bool allowForce)
- {
- oPaintTraverse(_this,panel,forceRepaint,allowForce);
- static float flRainbow = 0.f;
- static Vector CenterScreen;
- static int observer_count = 0;
- if (!drawPanel||drawPanel==NULL)
- {
- if (strstr(I::Panel->GetName(panel), "FocusOverlayPanel"))
- {
- drawPanel = panel;
- Draw::Arial = I::Surface->SCreateFont();
- Draw::Tahoma = I::Surface->SCreateFont();
- I::Surface->SetFontGlyphSet(Draw::Arial, "Arial", 20, 20, 0, 0, FONTFLAG_NONE);
- I::Surface->SetFontGlyphSet(Draw::Tahoma, "Tahoma", 12, FW_SEMIBOLD, 0, 0, FONTFLAG_OUTLINE);
- I::Engine->GetScreenSize(ScreenWidth, ScreenHeight);
- CenterScreen = Vector(0,0,0);
- CenterScreen.x = (float)(ScreenWidth/2);
- CenterScreen.y = (float)(ScreenHeight/2);
- }
- }
- if (panel != drawPanel) return;
- CBaseEntity* me = (CBaseEntity*)I::ClientEntList->GetClientEntity(I::Engine->GetLocalPlayerIndex());
- if (!me) return;
- static float text_rainbow;
- text_rainbow += 0.0005f;
- if ( text_rainbow > 1.f ) text_rainbow = 0.f;
- Draw::DrawString(Draw::Tahoma, 5, 430, Color::FromHSB(text_rainbow,1.f,1.f), false, "COLUMBINEHOOK INSIDE (C)");
- Draw::DrawRectRainbow(5, 440, 215, 3, 0.008f, flRainbow);
- Draw::DrawString(Draw::Tahoma, 5, 455, Color::FromHSB(text_rainbow,1.f,1.f), false, "MADE WITH LOVE BY DOUBLE V");
- Draw::DrawString(Draw::Tahoma, 200, 20, Color::FromHSB(text_rainbow,1.f,1.f), false, "WELCOME, %s!", GetInfo(I::Engine->GetLocalPlayerIndex()).szName);
- if (bDrawHitmarker)
- {
- // Draw hitmarker
- const int disoff = 5;
- const int length = 10;
- Draw::DrawLine(CenterScreen.x-disoff,CenterScreen.y+disoff, CenterScreen.x-disoff-length,CenterScreen.y+disoff+length, Color::White());
- Draw::DrawLine(CenterScreen.x+disoff,CenterScreen.y-disoff, CenterScreen.x+disoff+length,CenterScreen.y-disoff-length, Color::White());
- Draw::DrawLine(CenterScreen.x-disoff,CenterScreen.y-disoff, CenterScreen.x-disoff-length,CenterScreen.y-disoff-length, Color::White());
- Draw::DrawLine(CenterScreen.x+disoff,CenterScreen.y+disoff, CenterScreen.x+disoff+length,CenterScreen.y+disoff+length, Color::White());
- if (iHitmarkerTime >= 0) iHitmarkerTime--;
- if (iHitmarkerTime < 0) bDrawHitmarker = false;
- }
- for (int i=1; i<=I::ClientEntList->GetHighestEntityIndex(); i++)
- {
- if (i<=I::Globals->maxClients)
- {
- // PLAYER ESP
- CBaseEntity* enemy = (CBaseEntity*)I::ClientEntList->GetClientEntity(i);
- if (!enemy) continue;
- if (enemy == me) continue;
- if (enemy->IsDormant()) continue;
- if (!enemy->isAlive()) continue;
- Vector enemy_head3d = enemy->GetBonePos(6); enemy_head3d.z += 10.f;
- Vector enemy_head2d;
- Vector enemy_origin3d = enemy->GetAbsOrigin();
- Vector enemy_origin2d;
- if (!Draw::WorldToScreen(enemy_head3d, enemy_head2d) || !Draw::WorldToScreen(enemy_origin3d, enemy_origin2d))
- continue;
- float height = enemy_origin2d.y - enemy_head2d.y;
- float width = height / 4.f;
- int bottom = 0;
- PlayerBox3D(enemy, me);
- Draw::DrawString( Draw::Tahoma, enemy_head2d.x, enemy_head2d.y - 8, (me->GetTeamNum() != enemy->GetTeamNum()) ? Color::Orange() : Color::Aqua(), true, "%s - %d | %d", GetInfo(i).szName, enemy->Health(), enemy->Armor());
- Draw::DrawString( Draw::Tahoma, enemy_origin2d.x, enemy_origin2d.y, Color::White(), true, "%s | $%d", GetActiveWeapon(enemy) != nullptr ? GetActiveWeapon(enemy)->GetWeaponName().c_str() : "Unknown", enemy->GetMoney());
- if (me->GetTeamNum() != enemy->GetTeamNum())
- {
- Draw::DrawLine(ScreenWidth/2-1, ScreenHeight-1, enemy_origin2d.x-1, enemy_origin2d.y-1, Color::Black());
- Draw::DrawLine(ScreenWidth/2, ScreenHeight, enemy_origin2d.x, enemy_origin2d.y, Color::Orange());
- Draw::DrawLine(ScreenWidth/2+1, ScreenHeight+1, enemy_origin2d.x+1, enemy_origin2d.y+1, Color::Black());
- }
- static float rainbow;
- rainbow += 0.0005f;
- if ( rainbow > 1.f ) rainbow = 0.f;
- dlight_t* lpELight = I::Effects->CL_AllocDlight(enemy->Index());
- lpELight->color = MakeColorExp(Color::FromHSB(rainbow,1.f,1.f), 6);
- lpELight->radius = 75.f;
- lpELight->decay = lpELight->radius / 5.0f;
- lpELight->key = enemy->Index();
- lpELight->m_Direction = enemy->GetAbsOrigin();
- lpELight->origin = enemy->GetAbsOrigin();
- lpELight->die = I::Globals->curtime + 0.05f;
- }
- else
- {
- // WORLD ESP
- CBaseEntity* entity = (CBaseEntity*)I::ClientEntList->GetClientEntity(i);
- if (!entity) continue;
- Vector pos, pos3d;
- pos3d = entity->GetAbsOrigin();
- if (!Draw::WorldToScreen(pos3d, pos))
- continue;
- int owner = entity->GetOwner();
- if (owner == -1)
- {
- if (strstr(entity->GetClientClass()->m_pNetworkName, "CWeapon"))
- Draw::DrawString(Draw::Tahoma, pos.x, pos.y, Color::White(), true, "%s", std::string(entity->GetClientClass()->m_pNetworkName).substr(7).c_str());
- if (entity->GetClientClass()->m_ClassID == ClassIDs::CAK47)
- Draw::DrawString(Draw::Tahoma, pos.x, pos.y, Color::White(), true, "AK-47");
- }
- if (strstr(entity->GetClientClass()->m_pNetworkName, "CPlantedC4"))
- Draw::DrawString(Draw::Tahoma, pos.x, pos.y, Color::White(), true, "Planted C4 - %.1f", GetBombTimer(entity));
- if (strstr(entity->GetClientClass()->m_pNetworkName, "CSmokeGrenadeProjectile"))
- Draw::DrawString(Draw::Tahoma, pos.x, pos.y, Color::White(), true, "Smoke");
- if (strstr(entity->GetClientClass()->m_pNetworkName, "CMolotovProjectile"))
- Draw::DrawString(Draw::Tahoma, pos.x, pos.y, Color::White(), true, "Molotov");
- if (strstr(entity->GetClientClass()->m_pNetworkName, "CDecoyProjectile"))
- Draw::DrawString(Draw::Tahoma, pos.x, pos.y, Color::White(), true, "Decoy");
- if (strstr(entity->GetClientClass()->m_pNetworkName, "CBaseCSGrenadeProjectile"))
- Draw::DrawString(Draw::Tahoma, pos.x, pos.y, Color::White(), true, "HE Grenade");
- if (entity->GetClientClass()->m_ClassID == ClassIDs::CC4)
- Draw::DrawString(Draw::Tahoma, pos.x, pos.y, Color::White(), true, "C4");
- }
- }
- observer_count = 0;
- //Menu->Paint();
- }
- void __stdcall hkOverrideView(CViewSetup* pViewSetup)
- {
- if (pViewSetup->fov == 90.f)
- pViewSetup->fov = 125.f;
- oOverrideView(pViewSetup);
- }
- void __fastcall hkFrameStageNotify(void* ecx, void* edx, ClientFrameStage_t Stage)
- {
- std::vector<CCorrection> Corrections;
- Vector vecAimPunch;
- Vector vecViewPunch;
- Vector* pAimPunch = nullptr;
- Vector* pViewPunch = nullptr;
- CBaseEntity* me;
- me = (CBaseEntity*)I::ClientEntList->GetClientEntity(I::Engine->GetLocalPlayerIndex());
- if (Stage == FRAME_RENDER_START)
- {
- if (me && me->isAlive())
- {
- pAimPunch = me->pGetPunchAngle();
- pViewPunch = me->pGetViewPunchAngle();
- vecAimPunch = *pAimPunch;
- Math.NormalizeVector(vecAimPunch);
- vecViewPunch = *pViewPunch;
- Math.NormalizeVector(vecViewPunch);
- *pAimPunch = Vector(0, 0, 0);
- *pViewPunch = Vector(0, 0, 0);
- }
- }
- if (Stage == FRAME_NET_UPDATE_POSTDATAUPDATE_START)
- {
- for (int i=0; i < I::Globals->maxClients; i++)
- {
- CBaseEntity* pEntity = (CBaseEntity*)I::ClientEntList->GetClientEntity(i);
- if (!pEntity)
- continue;
- if (pEntity == me)
- continue;
- if (!pEntity->isAlive())
- continue;
- Vector* pAngle = pEntity->GetEyeAnglesPtr();
- if (!pAngle)
- continue;
- Corrections.push_back(CCorrection(i, *pAngle));
- }
- }
- // Run the original frame stage notify function.
- oFrameStageNotify(ecx, Stage);
- for (CCorrection c : Corrections)
- {
- CBaseEntity* pEntity = (CBaseEntity*)I::ClientEntList->GetClientEntity(c.index);
- if (!pEntity)
- continue;
- if (pEntity == me)
- continue;
- if (!pEntity->isAlive())
- continue;
- *pEntity->GetEyeAnglesPtr() = c.RealAngles;
- }
- // Restore the original aim and view punches.
- if (pAimPunch && pViewPunch)
- {
- *pAimPunch = vecAimPunch;
- *pViewPunch = vecViewPunch;
- }
- }
- void __fastcall hkDrawModelExecute(void* _this, void*, void* context, void* state, const ModelRenderInfo_t& pInfo, matrix3x4_t* pCustomBoneToWorld)
- {
- Hooks::ModelRendererHook->HookTable(false);
- if (I::Engine->InGame())
- {
- CBaseEntity* pLocal = (CBaseEntity*)I::ClientEntList->GetClientEntity(I::Engine->GetLocalPlayerIndex());
- if (pLocal)
- {
- if (pInfo.pModel)
- {
- std::string ModelName = I::ModelInfo->GetModelName(pInfo.pModel);
- if (ModelName.find("models/player") != std::string::npos)
- {
- CBaseEntity* pModelEntity = (CBaseEntity*)I::ClientEntList->GetClientEntity(pInfo.entity_index);
- if (pModelEntity && pModelEntity->isAlive() && !pModelEntity->IsDormant())
- {
- Color render_color_hidden = pModelEntity->GetTeamNum() == pLocal->GetTeamNum() ? Color(72, 219, 75) : Color(232, 209, 32);
- Color render_color_visible = pModelEntity->GetTeamNum() == pLocal->GetTeamNum() ? Color(84, 167, 255) : Color::Yellow();
- IMaterial* GlowMeme = I::MatSystem->FindMaterial("dev\\glow_rim3d", TEXTURE_GROUP_OTHER);
- if (GlowMeme)
- {
- ForceMaterial( GlowMeme, render_color_hidden );
- I::ModelRenderer->DrawModelExecute( context, state, pInfo, pCustomBoneToWorld );
- GlowMeme->SetMaterialVarFlag( MATERIAL_VAR_IGNOREZ, true );
- }
- visible_tex->SetMaterialVarFlag( MATERIAL_VAR_IGNOREZ, false );
- ForceMaterial( visible_tex, render_color_visible );
- I::ModelRenderer->DrawModelExecute( context, state, pInfo, pCustomBoneToWorld );
- }
- }
- else if( ModelName.find( "arms" ) != std::string::npos )
- {
- static float rainbow;
- rainbow += 0.001f;
- if ( rainbow > 1.f ) rainbow = 0.f;
- visible_tex->SetMaterialVarFlag( MATERIAL_VAR_IGNOREZ, false );
- ForceMaterial( visible_tex, Color::FromHSB( rainbow, 1.f, 1.f ) );
- I::ModelRenderer->DrawModelExecute( context, state, pInfo, pCustomBoneToWorld );
- }
- else if( ModelName.find( "weapon" ) != std::string::npos )
- {
- visible_tex->SetMaterialVarFlag( MATERIAL_VAR_IGNOREZ, false );
- ForceMaterial( visible_tex, Color::White() );
- }
- else if( ModelName.find( "flash" ) != std::string::npos )
- {
- IMaterial* Flash = I::MatSystem->FindMaterial("effects\\flashbang", TEXTURE_GROUP_CLIENT_EFFECTS);
- IMaterial* FlashWhite = I::MatSystem->FindMaterial("effects\\flashbang_white", TEXTURE_GROUP_CLIENT_EFFECTS);
- if (Flash && FlashWhite)
- {
- Flash->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- FlashWhite->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- }
- I::ModelRenderer->ForcedMaterialOverride(Flash);
- I::ModelRenderer->ForcedMaterialOverride(FlashWhite);
- I::ModelRenderer->ForcedMaterialOverride(NULL);
- }
- else if( ModelName.find( "smoke" ) != std::string::npos )
- {
- IMaterial* vistasmokev1 = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev1", TEXTURE_GROUP_PARTICLE);
- IMaterial* vistasmokev1_emods = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev1_emods", TEXTURE_GROUP_PARTICLE);
- IMaterial* vistasmokev1_emods_impactdust = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev1_emods_impactdust", TEXTURE_GROUP_PARTICLE);
- IMaterial* vistasmokev1_fire = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev1_fire", TEXTURE_GROUP_PARTICLE);
- IMaterial* vistasmokev1_fire2 = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev1_fire2", TEXTURE_GROUP_PARTICLE);
- IMaterial* vistasmokev1_fire2_fogged = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev1_fire2_fogged", TEXTURE_GROUP_PARTICLE);
- IMaterial* vistasmokev1_min_depth_nearcull = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev1_min_depth_nearcull", TEXTURE_GROUP_PARTICLE);
- IMaterial* vistasmokev1_nearcull = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev1_nearcull", TEXTURE_GROUP_PARTICLE);
- IMaterial* vistasmokev1_nearcull_fog = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev1_nearcull_fog", TEXTURE_GROUP_PARTICLE);
- IMaterial* vistasmokev1_nearcull_nodepth = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev1_nearcull_nodepth", TEXTURE_GROUP_PARTICLE);
- IMaterial* vistasmokev1_no_rgb = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev1_no_rgb", TEXTURE_GROUP_PARTICLE);
- IMaterial* vistasmokev1_smokegrenade = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev1_smokegrenade", TEXTURE_GROUP_PARTICLE);
- IMaterial* vistasmokev4_addself_nearcull = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev4_addself_nearcull", TEXTURE_GROUP_PARTICLE);
- IMaterial* vistasmokev4_emods_nocul = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev4_emods_nocul", TEXTURE_GROUP_PARTICLE);
- IMaterial* vistasmokev4_nearcull = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev4_nearcull", TEXTURE_GROUP_PARTICLE);
- IMaterial* vistasmokev4_nocull = I::MatSystem->FindMaterial("particle\\vistasmokev1\\vistasmokev4_nocull", TEXTURE_GROUP_PARTICLE);
- vistasmokev1->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- vistasmokev1_emods->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- vistasmokev1_emods_impactdust->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- vistasmokev1_fire->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- vistasmokev1_fire2->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- vistasmokev1_fire2_fogged->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- vistasmokev1_min_depth_nearcull->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- vistasmokev1_nearcull->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- vistasmokev1_nearcull_fog->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- vistasmokev1_nearcull_nodepth->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- vistasmokev1_no_rgb->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- vistasmokev1_smokegrenade->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- vistasmokev4_addself_nearcull->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- vistasmokev4_emods_nocul->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- vistasmokev4_nearcull->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- vistasmokev4_nocull->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev1);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev1_emods);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev1_emods_impactdust);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev1_fire);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev1_fire2);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev1_fire2_fogged);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev1_min_depth_nearcull);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev1_nearcull);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev1_nearcull_fog);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev1_nearcull_nodepth);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev1_no_rgb);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev1_smokegrenade);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev4_addself_nearcull);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev4_emods_nocul);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev4_nearcull);
- I::ModelRenderer->ForcedMaterialOverride(vistasmokev4_nocull);
- I::ModelRenderer->ForcedMaterialOverride(NULL);
- }
- }
- }
- }
- I::ModelRenderer->DrawModelExecute( context, state, pInfo, pCustomBoneToWorld );
- I::ModelRenderer->ForcedMaterialOverride( NULL );
- Hooks::ModelRendererHook->HookTable(true);
- }
- bool __fastcall hkFireEventClientSide(void* ecx, void* edx, CGameEvent* pEvent)
- {
- if (!pEvent)
- return oFireEventClientSide(ecx, pEvent);
- if (!strcmp(pEvent->GetName(), "player_death"))
- {
- // The game launched a player_death event.
- int nUserID = pEvent->GetInt("attacker");
- int nDead = pEvent->GetInt("userid");
- if (!nUserID || !nDead)
- return false;
- // If I'm the one who dies...
- if (I::Engine->GetPlayerForUserID(nDead) == I::Engine->GetLocalPlayerIndex())
- {
- I::Engine->ClientCmd("say Wait...you actually killed me? How dare...");
- }
- // Continue only if I'm the one who killed
- if (I::Engine->GetPlayerForUserID(nUserID) == I::Engine->GetLocalPlayerIndex())
- {
- if (strstr(pEvent->GetString("weapon"), "knife"))
- pEvent->SetString("weapon", "knife_m9_bayonet");
- player_info_t killed_info = GetInfo(I::Engine->GetPlayerForUserID(nDead));
- std::stringstream ss;
- ss << "say " << killed_info.szName << ", you got rekt by the ColumbineHook, an exclusive internal meme, using a weapon named " << pEvent->GetString("weapon") << ".";
- I::Engine->ClientCmd(ss.str().c_str());
- }
- }
- if (!strcmp(pEvent->GetName(), "bomb_planted"))
- {
- // The game launched the bomb_beginplant event
- int nPlanter = pEvent->GetInt("userid");
- if (!nPlanter)
- return false;
- player_info_t planter_info = GetInfo(I::Engine->GetPlayerForUserID(nPlanter));
- std::stringstream ss;
- ss << "say Wow, " << planter_info.szName << ", you planted the bomb like a real muslim!";
- I::Engine->ClientCmd(ss.str().c_str());
- }
- if (!strcmp(pEvent->GetName(), "bomb_exploded"))
- {
- // The game launched the bomb_exploded event
- I::Engine->ClientCmd("say ALLAHU AKBAR!!!");
- }
- if (!strcmp(pEvent->GetName(), "bomb_dropped"))
- {
- int nDropper = pEvent->GetInt("userid");
- if (!nDropper)
- return false;
- player_info_t info = GetInfo(I::Engine->GetPlayerForUserID(nDropper));
- std::stringstream ss;
- ss << "say Oh no! " << info.szName << " dropped the fuckin bomb!";
- I::Engine->ClientCmd(ss.str().c_str());
- }
- if (!strcmp(pEvent->GetName(), "bomb_defused"))
- {
- int nDefuser = pEvent->GetInt("userid");
- if (!nDefuser)
- return false;
- player_info_t info = GetInfo(I::Engine->GetPlayerForUserID(nDefuser));
- std::stringstream ss;
- ss << "say " << info.szName << " defused the bomb with SWAT style! Bin Laden really sad atm...";
- I::Engine->ClientCmd(ss.str().c_str());
- }
- if (!strcmp(pEvent->GetName(), "bomb_begindefuse"))
- {
- int nDefuser = pEvent->GetInt("userid");
- if (!nDefuser)
- return false;
- player_info_t info = GetInfo(I::Engine->GetPlayerForUserID(nDefuser));
- std::stringstream ss;
- ss << "say " << info.szName << " started defusing the mothafucking bomb!";
- if (pEvent->GetInt("haskit"))
- ss << " And he has got a l33t defuser!!!";
- I::Engine->ClientCmd(ss.str().c_str());
- }
- if (!strcmp(pEvent->GetName(), "bomb_abortdefuse"))
- {
- int nAborter = pEvent->GetInt("userid");
- if (!nAborter)
- return false;
- player_info_t info = GetInfo(I::Engine->GetPlayerForUserID(nAborter));
- // Continue only if I'm not the aborter
- if (I::Engine->GetPlayerForUserID(nAborter) != I::Engine->GetLocalPlayerIndex())
- {
- std::stringstream ss;
- ss << "say " << info.szName << " aborted the bomb defusal like a fucking pussy!!! MAYBE HE NEEDS SOME COLUMBINEHOOK ;)";
- I::Engine->ClientCmd(ss.str().c_str());
- }
- }
- if (!strcmp(pEvent->GetName(), "round_freeze_end"))
- {
- I::Engine->ClientCmd("say Wow another round full of pure skills starts!");
- }
- if (!strcmp(pEvent->GetName(), "weapon_fire"))
- {
- int nFirer = pEvent->GetInt("userid");
- if (!nFirer) return false;
- if (I::Engine->GetPlayerForUserID(nFirer) == I::Engine->GetLocalPlayerIndex())
- {
- CBaseEntity* me = (CBaseEntity*)I::ClientEntList->GetClientEntity(I::Engine->GetLocalPlayerIndex());
- if (!me) return false;
- if (me->GetTotalHitsOnServer() > iTotalHits)
- {
- bDrawHitmarker = true;
- iHitmarkerTime = 25;
- PlaySound("C:\\Users\\UTENTE\\Documents\\Visual Studio 2012\\Projects\\Internal Fantabosco\\hitmarker.wav", NULL, SND_FILENAME | SND_ASYNC);
- }
- iTotalHits = me->GetTotalHitsOnServer();
- }
- }
- return oFireEventClientSide(ecx, pEvent);
- }
- void hkModelIndex(const CRecvProxyData* pData, void* pStruct, void* pOut)
- {
- if (I::Engine->InGame())
- {
- int* hz = reinterpret_cast<int*>(reinterpret_cast<DWORD>(pData) + 0x8);
- if (!hz)
- {
- oModelIndex(pData, pStruct, pOut);
- return;
- }
- if(*hz == I::ModelInfo->GetModelIndex("models/weapons/v_knife_default_t.mdl") || *hz == I::ModelInfo->GetModelIndex("models/weapons/v_knife_default_ct.mdl"))
- *hz = I::ModelInfo->GetModelIndex("models/weapons/v_knife_m9_bay.mdl");
- }
- oModelIndex(pData, pStruct, pOut);
- }
- void hkItemDefinitionIndex(const CRecvProxyData* pData, void* pStruct, void* pOut)
- {
- if (I::Engine->InGame())
- {
- int* hz = reinterpret_cast<int*>(reinterpret_cast<DWORD>(pData) + 0x8);
- if (!hz)
- {
- oItemDefinitionIndex(pData, pStruct, pOut);
- return;
- }
- if(*hz == WEAPON_KNIFE_T || *hz == WEAPON_KNIFE)
- *hz = WEAPON_KNIFE_M9_BAYONET;
- }
- oItemDefinitionIndex(pData, pStruct, pOut);
- }
- void hkSmokeEffectTickBegin(const CRecvProxyData* pData, void* pStruct, void* pOut)
- {
- oSmokeEffectTickBegin(pData, pStruct, pOut);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement