daily pastebin goal
63%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DWORD dwTicks = 0;
  2. int nKills = 0;
  3. DWORD OnPeerDieAddress = 0x004A1560;
  4. CDetour OnPeerDieDet;
  5.  
  6. DWORD WINAPI SoundThread (LPVOID lpCount)
  7. {
  8.     switch (nKills)
  9.     {
  10.         case 0:
  11.         case 1:
  12.             break;
  13.         case 2:
  14.             PlaySoundA ("Sound\\kills\\doublekill.wav", NULL, SND_FILENAME);
  15.             dwTicks = GetTickCount ();
  16.             break;
  17.         case 3:
  18.             PlaySoundA ("Sound\\kills\\multikill.wav", NULL, SND_FILENAME);
  19.             dwTicks = GetTickCount ();
  20.             break;
  21.         case 4:
  22.             PlaySoundA ("Sound\\kills\\ultrakill.wav", NULL, SND_FILENAME);
  23.             dwTicks = GetTickCount ();
  24.             break;
  25.         case 5:
  26.             PlaySoundA ("Sound\\kills\\megakill.wav", NULL, SND_FILENAME);
  27.             dwTicks = GetTickCount ();
  28.             break;
  29.         case 6:
  30.             PlaySoundA ("Sound\\kills\\ludicrouskill.wav", NULL, SND_FILENAME);
  31.             dwTicks = GetTickCount ();
  32.             break;
  33.         default:
  34.             nKills = 0;
  35.     }
  36.     return 0;
  37. }
  38.  
  39. DWORD WINAPI SoundCheck (LPVOID lpReserved)
  40. {
  41.     while (true)
  42.     {
  43.         if (MyChar ())
  44.             if (((GetTickCount() - dwTicks) / 1000) > 15 && nKills > 1)
  45.                 nKills = 0;
  46.         Sleep (5);
  47.     }
  48. }
  49. void __stdcall OnPeerDieHook (MUID *uidVictim, MUID *uidAttacker)
  50. {
  51.     if (uidAttacker->uidHigh == GetGameClient ()->MyMUID.uidHigh)
  52.     {
  53.         if (nKills == 0)
  54.             dwTicks = GetTickCount ();
  55.         ++nKills;
  56.         if (((GetTickCount() - dwTicks) / 1000) < 15 && nKills > 1)
  57.         {
  58.             Warn ("Kills!");
  59.             CreateThread (NULL, NULL, SoundThread, &nKills, NULL, NULL);
  60.         }
  61.     }
  62.    
  63. }
RAW Paste Data
Top