Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef SDK_H
- #define SDK_H
- #include "Math.h"
- #include "VMethod.h"
- #include "Random.h"
- #include "checksum_md5.h"
- #include "dt_recv.h"
- typedef void* ( *CreateInterfaceFn )( const char*, int* );
- #undef CreateFont
- enum eWeaponId
- {
- WEAPON_CSBASE = 0,
- WEAPON_P228,
- WEAPON_GLOCK,
- WEAPON_SCOUT,
- WEAPON_HEGRENADE,
- WEAPON_XM1014,
- WEAPON_C4,
- WEAPON_MAC10,
- WEAPON_AUG,
- WEAPON_SMOKEGRENADE,
- WEAPON_ELITE,
- WEAPON_FIVESEVEN,
- WEAPON_UMP45,
- WEAPON_SG550,
- WEAPON_GALIL,
- WEAPON_FAMAS,
- WEAPON_USP,
- WEAPON_AWP,
- WEAPON_MP5,
- WEAPON_M249,
- WEAPON_M3,
- WEAPON_M4A1,
- WEAPON_TMP,
- WEAPON_G3SG1,
- WEAPON_FLASHBANG,
- WEAPON_DEAGLE,
- WEAPON_SG552,
- WEAPON_AK47,
- WEAPON_KNIFE,
- WEAPON_P90,
- WEAPON_SHIELD,
- WEAPON_KEVLAR,
- WEAPON_ASSAULTSUIT,
- WEAPON_NIGHTVISION
- };
- #define IN_ATTACK ( 1 << 0 )
- #define IN_JUMP ( 1 << 1 )
- #define IN_DUCK ( 1 << 2 )
- #define FL_ONGROUND ( 1 << 0 )
- #define FL_DUCKING ( 1 << 1 )
- class CSPlayer;
- class CSWeapon;
- class model_t;
- struct player_info_t
- {
- char name[32];
- int userID;
- char guid[32 + 1];
- unsigned int friendsID;
- char friendsName[32];
- bool fakeplayer;
- bool ishltv;
- unsigned long customFiles[4];
- unsigned char filesDownloaded;
- };
- struct mstudiobbox_t
- {
- int bone;
- int group;
- Vector bbmin;
- Vector bbmax;
- int szhitboxnameindex;
- int unused[8];
- char* pszHitboxName( )
- {
- if( szhitboxnameindex == 0 )
- return "";
- return ( ( char* )this ) + szhitboxnameindex;
- }
- };
- struct mstudiohitboxset_t
- {
- int sznameindex;
- inline char* const pszName( void ) const { return ( ( char* )this ) + sznameindex; }
- int numhitboxes;
- int hitboxindex;
- inline mstudiobbox_t* pHitbox( int i ) const { return ( mstudiobbox_t* )( ( ( byte* )this ) + hitboxindex ) + i; };
- };
- struct studiohdr_t
- {
- unsigned char pad[0xAC];
- int numhitboxsets;
- int hitboxsetindex;
- mstudiohitboxset_t* pHitboxSet( int i ) const
- {
- return ( mstudiohitboxset_t* )( ( ( byte* )this ) + hitboxsetindex ) + i;
- };
- inline mstudiobbox_t* pHitbox( int i, int set ) const
- {
- mstudiohitboxset_t const* s = pHitboxSet( set );
- if( !s )
- return NULL;
- return s->pHitbox( i );
- };
- inline int iHitboxCount( int set ) const
- {
- mstudiohitboxset_t const* s = pHitboxSet( set );
- if( !s )
- return 0;
- return s->numhitboxes;
- };
- };
- class ClientClass
- {
- public:
- const char __pad0[ 0x8 ];
- const char *m_pNetworkName;
- RecvTable *m_pRecvTable;
- ClientClass *m_pNext;
- int m_ClassID;
- };
- class CUserCmd
- {
- public:
- virtual ~CUserCmd( ) { };
- int command_number;
- int tick_count;
- Vector viewangles;
- float forwardmove;
- float sidemove;
- float upmove;
- int buttons;
- BYTE impulse;
- int weaponselect;
- int weaponsubtype;
- int random_seed;
- short mousedx;
- short mousedy;
- bool hasbeenpredicted;
- };
- class CGlobalVarsBase
- {
- public:
- float realtime;
- int framecount;
- float absoluteframetime;
- float curtime;
- float frametime;
- int maxClients;
- int tickcount;
- float interval_per_tick;
- float interpolation_amount;
- int simTicksThisFrame;
- int network_protocol;
- };
- class IBaseClientDLL
- {
- public:
- ClientClass* GetAllClasses( )
- {
- typedef ClientClass* ( __thiscall* GetAllClassesFn )( PVOID );
- return GetMethod< GetAllClassesFn >( this, 5 )( this );
- }
- };
- class IClientEntityList
- {
- public:
- CSPlayer* GetClientEntity( int nIndex )
- {
- typedef CSPlayer* ( __thiscall* GetClientEntityFn )( PVOID, int );
- return GetMethod< GetClientEntityFn >( this, 3 )( this, nIndex );
- }
- CSWeapon* GetClientEntityFromHandle( int nHandle )
- {
- typedef CSWeapon* ( __thiscall* GetClientEntityFromHandleFn )( PVOID, int );
- return GetMethod< GetClientEntityFromHandleFn >( this, 4 )( this, nHandle );
- }
- int GetHighestEntityIndex( )
- {
- typedef int ( __thiscall* GetHighestEntityIndexFn )( PVOID );
- return GetMethod< GetHighestEntityIndexFn >( this, 6 )( this );
- }
- };
- class CInput
- {
- public:
- CUserCmd* GetUserCmd( int sequence_number )
- {
- typedef CUserCmd* ( __thiscall* GetUserCmdFn )( PVOID, int );
- return GetMethod< GetUserCmdFn >( this, 8 )( this, sequence_number );
- }
- char __pad0[ 0xC4 ];
- CUserCmd* m_pCmd;
- };
- class IVModelInfoClient
- {
- public:
- const char* GetModelName( const model_t* model )
- {
- typedef const char* ( __thiscall* GetModelNameFn )( PVOID, const model_t* );
- return GetMethod< GetModelNameFn >( this, 3 )( this, model );
- }
- studiohdr_t* GetStudiomodel( const model_t* mod )
- {
- typedef studiohdr_t* ( __thiscall* GetStudiomodelFn )( PVOID, const model_t* );
- return GetMethod< GetStudiomodelFn >( this, 27 )( this, mod );
- }
- };
- class IVEngineClient
- {
- public:
- void GetScreenSize( int& width, int& height )
- {
- typedef void ( __thiscall* GetScreenSizeFn )( PVOID, int&, int& );
- GetMethod< GetScreenSizeFn >( this, 5 )( this, width, height );
- }
- bool GetPlayerInfo( int ent_num, player_info_t *pinfo )
- {
- typedef bool ( __thiscall* GetPlayerInfoFn )( PVOID, int, player_info_t* );
- return GetMethod< GetPlayerInfoFn >( this, 8 )( this, ent_num, pinfo );
- }
- int GetLocalPlayer( )
- {
- typedef int ( __thiscall* GetLocalPlayerFn )( PVOID );
- return GetMethod< GetLocalPlayerFn >( this, 12 )( this );
- }
- void GetViewAngles( Vector& va )
- {
- typedef void ( __thiscall* GetViewAnglesFn )( PVOID, Vector& );
- GetMethod< GetViewAnglesFn >( this, 19 )( this, va );
- }
- void SetViewAngles( Vector& va )
- {
- typedef void ( __thiscall* SetViewAnglesFn )( PVOID, Vector& );
- GetMethod< SetViewAnglesFn >( this, 20 )( this, va );
- }
- int GetMaxClients( void )
- {
- typedef int ( __thiscall* GetMaxClientsFn )( PVOID );
- return GetMethod< GetMaxClientsFn >( this, 21 )( this );
- }
- const VMatrix& WorldToScreenMatrix( )
- {
- typedef const VMatrix& ( __thiscall* WorldToScreenMatrixFn )( PVOID );
- return GetMethod< WorldToScreenMatrixFn >( this, 38 )( this );
- }
- bool IsTakingScreenshot( void )
- {
- typedef bool ( __thiscall* IsTakingScreenshotFn )( PVOID );
- return GetMethod< IsTakingScreenshotFn >( this, 80 )( this );
- }
- };
- struct Ray_t
- {
- Vector m_Start;
- Vector m_Delta;
- Vector m_StartOffset;
- Vector m_Extents;
- bool m_IsRay;
- bool m_IsSwept;
- void Init( Vector& vecStart, Vector& vecEnd )
- {
- m_Delta = vecEnd - vecStart;
- m_IsSwept = ( m_Delta.LengthSqr( ) != 0 );
- m_Extents.x = m_Extents.y = m_Extents.z = 0.0f;
- m_IsRay = true;
- m_StartOffset.x = m_StartOffset.y = m_StartOffset.z = 0.0f;
- m_Start = vecStart;
- }
- };
- struct cplane_t
- {
- Vector normal;
- float dist;
- BYTE type;
- BYTE signbits;
- BYTE pad[2];
- };
- class CBaseTrace
- {
- public:
- Vector startpos;
- Vector endpos;
- cplane_t plane;
- float fraction;
- int contents;
- unsigned short dispFlags;
- bool allsolid;
- bool startsolid;
- };
- struct csurface_t
- {
- const char* name;
- short surfaceProps;
- unsigned short flags;
- };
- class CGameTrace : public CBaseTrace
- {
- public:
- bool DidHitWorld( ) const;
- bool DidHitNonWorldEntity( ) const;
- int GetEntityIndex( ) const;
- bool DidHit( ) const;
- public:
- float fractionleftsolid;
- csurface_t surface;
- int hitgroup;
- short physicsbone;
- CSPlayer* m_pEnt;
- int hitbox;
- };
- inline bool CGameTrace::DidHit( ) const
- {
- return fraction < 1.0f || allsolid || startsolid;
- }
- typedef CGameTrace trace_t;
- enum TraceType_t
- {
- TRACE_EVERYTHING = 0,
- TRACE_WORLD_ONLY,
- TRACE_ENTITIES_ONLY,
- TRACE_EVERYTHING_FILTER_PROPS,
- };
- class ITraceFilter
- {
- public:
- virtual bool ShouldHitEntity( PVOID pEntity, int contentsMask ) = 0;
- virtual TraceType_t GetTraceType( ) const = 0;
- };
- class IEngineTrace
- {
- public:
- void TraceRay( const Ray_t& ray, unsigned int flMask, ITraceFilter* pTraceFilter, trace_t* pTrace )
- {
- typedef void ( __thiscall* TraceRayFn )( PVOID, const Ray_t&, unsigned int, ITraceFilter*, trace_t* );
- GetMethod< TraceRayFn >( this, 4 )( this, ray, flMask, pTraceFilter, pTrace );
- }
- };
- class IMoveHelper;
- class CPrediction
- {
- public:
- void RunSimulation( int current_command, float curtime, CUserCmd *cmd, CSPlayer *localPlayer )
- {
- typedef void ( __thiscall* RunSimulationFn )( PVOID, int, float, CUserCmd*, CSPlayer* );
- GetMethod< RunSimulationFn >( this, 38 )( this, current_command, curtime, cmd, localPlayer );
- }
- };
- class IPanel
- {
- public:
- const char* GetName( unsigned int vguiPanel )
- {
- typedef const char* ( __thiscall* GetNameFn )( PVOID, unsigned int );
- return GetMethod< GetNameFn >( this, 35 )( this, vguiPanel );
- }
- };
- class ISurface
- {
- public:
- void DrawSetColor( int r, int g, int b, int a )
- {
- typedef void ( __thiscall* DrawSetColorFn )( PVOID, int, int, int, int );
- GetMethod< DrawSetColorFn >( this, 11 )( this, r, g, b, a );
- }
- void DrawFilledRect( int x0, int y0, int x1, int y1 )
- {
- typedef void ( __thiscall* DrawFilledRectFn )( PVOID, int, int, int, int );
- GetMethod< DrawFilledRectFn >( this, 12 )( this, x0, y0, x1, y1 );
- }
- void DrawOutlinedRect( int x0, int y0, int x1, int y1 )
- {
- typedef void ( __thiscall* DrawOutlinedFn )( PVOID, int, int, int, int );
- GetMethod< DrawOutlinedFn >( this, 14 )( this, x0, y0, x1, y1 );
- }
- void DrawLine( int x0, int y0, int x1, int y1 )
- {
- typedef void ( __thiscall* DrawLineFn )( PVOID, int, int, int, int );
- GetMethod< DrawLineFn >( this, 15 )( this, x0, y0, x1, y1 );
- }
- void DrawSetTextFont( unsigned long font )
- {
- typedef void ( __thiscall* DrawSetTextFontFn )( PVOID, unsigned long );
- GetMethod< DrawSetTextFontFn >( this, 17 )( this, font );
- }
- void DrawSetTextColor( int r, int g, int b, int a )
- {
- typedef void ( __thiscall* DrawSetTextColorFn )( PVOID, int, int, int, int );
- GetMethod< DrawSetTextColorFn >( this, 19 )( this, r, g, b, a );
- }
- void DrawSetTextPos( int x, int y )
- {
- typedef void ( __thiscall* DrawSetTextPosFn )( PVOID, int, int );
- GetMethod< DrawSetTextPosFn >( this, 20 )( this, x, y );
- }
- void DrawPrintText( const wchar_t* text, int textLen )
- {
- typedef void ( __thiscall* DrawPrintTextFn )( PVOID, const wchar_t*, int, int );
- return GetMethod< DrawPrintTextFn >( this, 22 )( this, text, textLen, 0 );
- }
- unsigned long CreateFont( )
- {
- typedef unsigned int ( __thiscall* CreateFontFn )( PVOID );
- return GetMethod< CreateFontFn >( this, 64 )( this );
- }
- void SetFontGlyphSet( unsigned long font, const char* windowsFontName, int tall, int weight, int blur, int scanlines, int flags )
- {
- typedef void ( __thiscall* SetFontGlyphSetFn )( PVOID, unsigned long, const char*, int, int, int, int, int );
- GetMethod< SetFontGlyphSetFn >( this, 65 )( this, font, windowsFontName, tall, weight, blur, scanlines, flags );
- }
- void GetTextSize( unsigned long font, const wchar_t* text, int& wide, int& tall )
- {
- typedef void ( __thiscall* GetTextSizeFn )( PVOID, unsigned long, const wchar_t*, int&, int& );
- GetMethod< GetTextSizeFn >( this, 72 )( this, font, text, wide, tall );
- }
- };
- #endif // SDK_H
Advertisement
Add Comment
Please, Sign In to add comment