Guest User

Untitled

a guest
Nov 9th, 2017
887
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. RecvVarProxyFn oSmokeEffectTickBegin = NULL;
  2. RecvVarProxyFn oDidSmokeEffect = NULL;
  3.  
  4. void RecvProxy_SmokeEffectTickBegin(CRecvProxyData *pData, void *pStruct, void *pOut)
  5. {
  6. float *value = &pData->m_Value.m_Float;
  7.  
  8. if (Menu::Window.VisualsTab.OtherNoSmoke.GetState())
  9. {
  10. IClientEntity *entity = (IClientEntity*)pStruct;
  11.  
  12. if (entity)
  13. {
  14. *entity->GetOriginPtr() = Vector(10000, 10000, 10000);
  15. }
  16. }
  17.  
  18. oSmokeEffectTickBegin(pData, pStruct, pOut);
  19. }
  20.  
  21. void RecvProxy_DidSmokeEffect(CRecvProxyData *pData, void *pStruct, void *pOut)
  22. {
  23. int *value = (int*)&pData->m_Value.m_Int;
  24.  
  25. if (Menu::Window.VisualsTab.OtherNoSmoke.GetState())
  26. {
  27. }
  28. oDidSmokeEffect(pData, pStruct, pOut);
  29. }
  30.  
  31. void ApplyNetVarsHooks()
  32. {
  33. ClientClass *pClass = I::Client->GetAllClasses();
  34.  
  35. while (pClass)
  36. {
  37. const char *pszName = pClass->m_pRecvTable->m_pNetTableName;
  38.  
  39. for (int i = 0; i < pClass->m_pRecvTable->m_nProps; i++)
  40. {
  41. RecvProp *pProp = &(pClass->m_pRecvTable->m_pProps[i]);
  42. const char *name = pProp->m_pVarName;
  43.  
  44. if (!strcmp(pszName, "DT_SmokeGrenadeProjectile"))
  45. {
  46. if (!strcmp(name, "m_nSmokeEffectTickBegin"))
  47. {
  48. oSmokeEffectTickBegin = (RecvVarProxyFn)pProp->m_ProxyFn;
  49. pProp->m_ProxyFn = RecvProxy_SmokeEffectTickBegin;
  50. }
  51. else if (!strcmp(name, "m_bDidSmokeEffect"))
  52. {
  53. oDidSmokeEffect = (RecvVarProxyFn)pProp->m_ProxyFn;
  54. pProp->m_ProxyFn = RecvProxy_DidSmokeEffect;
  55. }
  56. }
  57. }
  58.  
  59. pClass = pClass->m_pNext;
  60. }
  61. }
  62.  
  63. void RemoveNetVarsHooks()
  64. {
  65. ClientClass *pClass = I::Client->GetAllClasses();
  66.  
  67. while (pClass)
  68. {
  69. const char *pszName = pClass->m_pRecvTable->m_pNetTableName;
  70.  
  71. for (int i = 0; i < pClass->m_pRecvTable->m_nProps; i++)
  72. {
  73. RecvProp *pProp = &(pClass->m_pRecvTable->m_pProps[i]);
  74. const char *name = pProp->m_pVarName;
  75.  
  76. if (!strcmp(pszName, "DT_SmokeGrenadeProjectile"))
  77. {
  78. if (!strcmp(name, "m_nSmokeEffectTickBegin"))
  79. {
  80. pProp->m_ProxyFn = oSmokeEffectTickBegin;
  81. }
  82. else if (!strcmp(name, "m_bDidSmokeEffect"))
  83. {
  84. pProp->m_ProxyFn = oDidSmokeEffect;
  85. }
  86. }
  87. }
  88.  
  89. pClass = pClass->m_pNext;
  90. }
  91. }
  92.  
  93.  
  94.  
  95.  
  96. in deiner main.cpp
  97.  
  98. ApplyNetVarsHooks();
Advertisement
Add Comment
Please, Sign In to add comment