Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.10 KB | None | 0 0
  1.  
  2.  
  3. // Credits to Valve and Shad0w
  4. #include "Interfaces.h"
  5. #include "Menu.h"
  6. #include "AntiAntiAim.h"
  7. // Shad0ws Yaw fix
  8. // (FIX ME UP LATER)
  9. void FixY(const CRecvProxyData *pData, void *pStruct, void *pOut)
  10. {
  11. static Vector vLast[65];
  12. static bool bShotLastTime[65];
  13. static bool bJitterFix[65];
  14.  
  15. float *flPitch = (float*)((DWORD)pOut - 4);
  16. float flYaw = pData->m_Value.m_Float;
  17. bool bHasAA;
  18. bool bSpinbot;
  19. int enable = Menu::Window.RageBotTab.AccuracyAngleFix.GetState();
  20. if (enable > 1)
  21. {
  22.  
  23. int rekaimware = 1;
  24. static bool rekt;
  25. if (rekt)
  26. {
  27. flYaw = 90.f;
  28. *(float*)(pOut) = flYaw;
  29. rekt = !rekt;
  30. }
  31.  
  32. else
  33. {
  34. flYaw = -90.f;
  35. *(float*)(pOut) = flYaw;
  36. rekt = !rekt;
  37. }
  38.  
  39. }
  40. }
  41.  
  42. void FixX(const CRecvProxyData* pData, void* pStruct, void* pOut)
  43. {
  44. float flPitch = pData->m_Value.m_Float;
  45.  
  46. if (flPitch > 180.0)
  47. flPitch -= 360.0;
  48. else if (flPitch < -180.0)
  49. flPitch += 360.0;
  50.  
  51. //Fakedown autofix
  52. if (flPitch < -179.648438f || flPitch > 179.648438f)
  53. {
  54. flPitch = -10.0f;
  55. }
  56.  
  57. if (flPitch <= -88.945313f && flPitch >= -179.648438f)
  58. {
  59. flPitch = -89.0f;
  60. }
  61.  
  62. if (flPitch >= 88.945313f && flPitch <= 179.648438f)
  63. {
  64. flPitch = 89.0f;
  65. }
  66.  
  67.  
  68. if (flPitch > 89)
  69. {
  70. flPitch = 270;
  71. }
  72. if (flPitch < -89)
  73. {
  74. flPitch = 90;
  75. }
  76.  
  77. *(float*)pOut = flPitch;
  78. }
  79.  
  80. RecvVarProxyFn oRecvnModelIndex;
  81.  
  82. void Hooked_RecvProxy_Viewmodel(CRecvProxyData *pData, void *pStruct, void *pOut)
  83. {
  84. int iModel = pData->m_Value.m_Int;
  85. // Get the knife view model id's
  86. static int default_t = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_default_t.mdl");
  87. static int default_ct = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_default_ct.mdl");
  88. static int bayonet = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_bayonet.mdl");
  89. static int karambit = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_karam.mdl");
  90. static int flip = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_flip.mdl");
  91. static int gut = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_gut.mdl");
  92. static int m9 = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_m9_bay.mdl");
  93. static int huntsman = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_tactical.mdl");
  94. static int butterfly = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_butterfly.mdl");
  95. static int daggers = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_push.mdl");
  96. static int falchion = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_falchion_advanced.mdl");
  97. static int bowie = Interfaces::ModelInfo->GetModelIndex("models/weapons/v_knife_survival_bowie.mdl");
  98.  
  99. // Get local player (just to stop replacing spectators knifes)
  100. IClientEntity* pLocal = Interfaces::EntList->GetClientEntity(Interfaces::Engine->GetLocalPlayer());
  101. if (Menu::Window.MiscTab.KnifeEnable.GetState() && pLocal)
  102. {
  103. // If we are alive and holding a default knife(if we already have a knife don't worry about changing)
  104. if (pLocal->IsAlive() && (pData->m_Value.m_Int == default_t || pData->m_Value.m_Int == default_ct))
  105. {
  106. // Set whatever knife we want
  107. switch (Menu::Window.MiscTab.KnifeModel.GetIndex())
  108. {
  109. case 0:
  110. //none
  111. break;
  112. //bayonet karambit flip gut m9 hunts butterfly
  113. case 1:
  114. pData->m_Value.m_Int = bayonet; //bayonet
  115. break;
  116. case 2:
  117. pData->m_Value.m_Int = karambit; //karambit
  118.  
  119. break;
  120. case 3:
  121. pData->m_Value.m_Int = flip; //flip
  122. break;
  123. case 4:
  124. pData->m_Value.m_Int = gut; //gut
  125. break;
  126. case 5:
  127. pData->m_Value.m_Int = m9; //m9bayo
  128. break;
  129. case 6:
  130. pData->m_Value.m_Int = huntsman; //hunts
  131. break;
  132. case 7:
  133. pData->m_Value.m_Int = butterfly; //butterfly
  134. break;
  135. case 8:
  136. pData->m_Value.m_Int = daggers; // shadow daggers
  137. break;
  138. case 9:
  139. pData->m_Value.m_Int = falchion; // falchion
  140. break;
  141. case 10:
  142. pData->m_Value.m_Int = bowie; // bowie knife
  143. break;
  144. }
  145. }
  146. }
  147.  
  148. // Carry on the to original proxy
  149. oRecvnModelIndex(pData, pStruct, pOut);
  150. }
  151.  
  152. void ApplyAAAHooks()
  153. {
  154. ClientClass *pClass = Interfaces::Client->GetAllClasses();
  155. while (pClass)
  156. {
  157. const char *pszName = pClass->m_pRecvTable->m_pNetTableName;
  158. if (!strcmp(pszName, "DT_CSPlayer"))
  159. {
  160. for (int i = 0; i < pClass->m_pRecvTable->m_nProps; i++)
  161. {
  162. RecvProp *pProp = &(pClass->m_pRecvTable->m_pProps[i]);
  163. const char *name = pProp->m_pVarName;
  164.  
  165. // Pitch Fix
  166. if (!strcmp(name, "m_angEyeAngles[0]"))
  167. {
  168.  
  169. }
  170.  
  171. // Yaw Fix
  172. if (!strcmp(name, "m_angEyeAngles[0]"))
  173. {
  174.  
  175. }
  176. }
  177. }
  178. else if (!strcmp(pszName, "DT_BaseViewModel"))
  179. {
  180. for (int i = 0; i < pClass->m_pRecvTable->m_nProps; i++)
  181. {
  182. RecvProp *pProp = &(pClass->m_pRecvTable->m_pProps[i]);
  183. const char *name = pProp->m_pVarName;
  184.  
  185. // Knives
  186. if (!strcmp(name, "m_nModelIndex"))
  187. {
  188. oRecvnModelIndex = (RecvVarProxyFn)pProp->m_ProxyFn;
  189. pProp->m_ProxyFn = Hooked_RecvProxy_Viewmodel;
  190. }
  191. }
  192. }
  193. pClass = pClass->m_pNext;
  194. }
  195. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement