Wolfrost

CSGO ColumbineHook FireEventClientSide hook

Jun 8th, 2016
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool __fastcall hkFireEventClientSide(void* ecx, void* edx, CGameEvent* pEvent)
  2. {
  3.     if (!pEvent)
  4.         return oFireEventClientSide(ecx, pEvent);
  5.  
  6.     if (!strcmp(pEvent->GetName(), "player_death"))
  7.     {
  8.         // The game launched a player_death event.
  9.         int nUserID = pEvent->GetInt("attacker");
  10.         int nDead = pEvent->GetInt("userid");
  11.         if (!nUserID || !nDead)
  12.             return false;
  13.  
  14.         // Continue only if I'm the one who killed
  15.         if (I::Engine->GetPlayerForUserID(nUserID) != I::Engine->GetLocalPlayerIndex())
  16.             return false;
  17.  
  18.         player_info_t killed_info = GetInfo(I::Engine->GetPlayerForUserID(nDead));
  19.  
  20.         std::stringstream ss;
  21.         ss << "say ";
  22.         ss << killed_info.szName << ", you got rekt by the ColumbineHook, an exclusive internal meme.";
  23.         ss << " I've used a weapon named " << pEvent->GetString("weapon") << ".";
  24.  
  25.         I::Engine->ClientCmd(ss.str().c_str());
  26.     }
  27.     else if (!strcmp(pEvent->GetName(), "bomb_beginplant"))
  28.     {
  29.         // The game launched the bomb_beginplant event
  30.         int nPlanter = pEvent->GetInt("userid");
  31.         if (!nPlanter)
  32.             return false;
  33.  
  34.         player_info_t planter_info = GetInfo(I::Engine->GetPlayerForUserID(nPlanter));
  35.  
  36.         std::stringstream ss;
  37.         ss << "say ";
  38.         ss << "WOW, " << planter_info.szName << ", you're planting the bomb like a real muslim!";
  39.  
  40.         I::Engine->ClientCmd(ss.str().c_str());
  41.     }
  42.  
  43.     return oFireEventClientSide(ecx, pEvent);
  44. }
Add Comment
Please, Sign In to add comment