-
Notifications
You must be signed in to change notification settings - Fork 3
/
AntiAntiAim.cpp
138 lines (121 loc) · 4.96 KB
/
AntiAntiAim.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*credits by ibanned*/
#include "Interfaces.h"
#include "Menu.h"
#include "Proxies.h"
#include "Skins.h"
RecvVarProxyFn oRecvnModelIndex;
void Hooked_RecvProxy_Viewmodel(CRecvProxyData *pData, void *pStruct, void *pOut)
{
// Get the knife view model id's
int default_t = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_default_t.mdl");
int default_ct = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_default_ct.mdl");
int iBayonet = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_bayonet.mdl");
int iButterfly = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_butterfly.mdl");
int iFlip = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_flip.mdl");
int iGut = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_gut.mdl");
int iKarambit = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_karam.mdl");
int iM9Bayonet = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_m9_bay.mdl");
int iHuntsman = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_tactical.mdl");
int iFalchion = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_falchion_advanced.mdl");
int iDagger = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_push.mdl");
int iBowie = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_survival_bowie.mdl");
int iGunGame = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_gg.mdl");
// Get local player (just to stop replacing spectators knifes)
IClientEntity* pLocal = Interfaces::EntList->GetClientEntity(Interfaces::Engine->GetLocalPlayer());
if (g_menu::window.Skins.SkinEnable.GetState() && pLocal)
{
// If we are alive and holding a default knife(if we already have a knife don't worry about changing)
if (pLocal->IsAlive() && (
pData->m_Value.m_Int == default_t ||
pData->m_Value.m_Int == default_ct ||
pData->m_Value.m_Int == iBayonet ||
pData->m_Value.m_Int == iButterfly ||
pData->m_Value.m_Int == iFlip ||
pData->m_Value.m_Int == iGunGame ||
pData->m_Value.m_Int == iGut ||
pData->m_Value.m_Int == iKarambit ||
pData->m_Value.m_Int == iM9Bayonet ||
pData->m_Value.m_Int == iHuntsman ||
pData->m_Value.m_Int == iFalchion ||
pData->m_Value.m_Int == iDagger ||
pData->m_Value.m_Int == iBowie))
{
// Set whatever knife we want
if (g_menu::window.Skins.KnifeModel.GetIndex() == 0)
pData->m_Value.m_Int = iBayonet;
else if (g_menu::window.Skins.KnifeModel.GetIndex() == 1)
pData->m_Value.m_Int = iBowie;
else if (g_menu::window.Skins.KnifeModel.GetIndex() == 2)
pData->m_Value.m_Int = iButterfly;
else if (g_menu::window.Skins.KnifeModel.GetIndex() == 3)
pData->m_Value.m_Int = iFalchion;
else if (g_menu::window.Skins.KnifeModel.GetIndex() == 4)
pData->m_Value.m_Int = iFlip;
else if (g_menu::window.Skins.KnifeModel.GetIndex() == 5)
pData->m_Value.m_Int = iGut;
else if (g_menu::window.Skins.KnifeModel.GetIndex() == 6)
pData->m_Value.m_Int = iHuntsman;
else if (g_menu::window.Skins.KnifeModel.GetIndex() == 7)
pData->m_Value.m_Int = iKarambit;
else if (g_menu::window.Skins.KnifeModel.GetIndex() == 8)
pData->m_Value.m_Int = iM9Bayonet;
else if (g_menu::window.Skins.KnifeModel.GetIndex() == 9)
pData->m_Value.m_Int = iDagger;
}
}
// Carry on the to original proxy
oRecvnModelIndex(pData, pStruct, pOut);
}
void SkinChanger()
{
ClientClass *pClass = Interfaces::Client->GetAllClasses();
while (pClass)
{
const char *pszName = pClass->m_pRecvTable->m_pNetTableName;
if (!strcmp(pszName, "DT_CSPlayer"))
{
for (int i = 0; i < pClass->m_pRecvTable->m_nProps; i++)
{
RecvProp *pProp = &(pClass->m_pRecvTable->m_pProps[i]);
const char *name = pProp->m_pVarName;
if (!strcmp(name, "m_angEyeAngles[0]"))
{
}
if (!strcmp(name, "m_angEyeAngles[1]"))
{
}
}
}
else if (!strcmp(pszName, "DT_BaseViewModel"))
{
for (int i = 0; i < pClass->m_pRecvTable->m_nProps; i++)
{
RecvProp *pProp = &(pClass->m_pRecvTable->m_pProps[i]);
const char *name = pProp->m_pVarName;
if (!strcmp(name, "m_nModelIndex"))
{
oRecvnModelIndex = (RecvVarProxyFn)pProp->m_ProxyFn;
pProp->m_ProxyFn = Hooked_RecvProxy_Viewmodel;
}
}
for (ClientClass* pClass = Interfaces::Client->GetAllClasses(); pClass; pClass = pClass->m_pNext)
{
if (!strcmp(pClass->m_pNetworkName, "CBaseViewModel"))
{
RecvTable* pClassTable = pClass->m_pRecvTable;
for (int nIndex = 0; nIndex < pClassTable->m_nProps; nIndex++)
{
RecvProp* pProp = &pClassTable->m_pProps[nIndex];
if (!pProp || strcmp(pProp->m_pVarName, "m_nSequence"))
continue;
fnSequenceProxyFn = (RecvVarProxyFn)pProp->m_ProxyFn;
pProp->m_ProxyFn = SetViewModelSequence;
break;
}
break;
}
}
}
pClass = pClass->m_pNext;
}
}