Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2015
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. oid (*orig_CG_Obituary) ( );
  2. void HooK_CG_Obituary( )
  3. {
  4. entityState_t * ent = NULL;
  5. __asm mov ent, eax
  6.  
  7. int iTarget = ent->otherEntityNum;
  8. int iAttacker = ent->otherEntityNum2;
  9. int iMod = ent->eventParm;
  10. clientInfo_t * ciTarget = NULL;
  11. clientInfo_t * ciAttacker = NULL;
  12.  
  13. if( iTarget >= 0 && iTarget < MAX_CLIENTS )
  14. {
  15. ciTarget = &clientInfo[ iTarget ];
  16.  
  17. // entity is dead
  18. cg_entities[ iTarget ].currentState.eFlags &= 1;
  19. //pBot->SetInvalidPlayer( iTarget );
  20.  
  21. if( iAttacker >= 0 && iAttacker < MAX_CLIENTS )
  22. ciAttacker = &clientInfo[ iAttacker ];
  23. else
  24. iAttacker = ENTITYNUM_WORLD;
  25.  
  26. if( ciAttacker && ciAttacker->clientNum == cg->clientNum )
  27. {
  28. if( ciTarget->clientNum == cg->clientNum )
  29. stats.Suicides++;
  30. else
  31. {
  32. if( ( iMod & 0xFFFFFF7F ) == 7 )
  33. {
  34. stats.TotalKills ++;
  35. stats.Bashes ++;
  36. }
  37. else if( ( iMod & 0xFFFFFF7F ) == 8 )
  38. {
  39. stats.TotalKills ++;
  40. stats.Headshots ++;
  41. //HSratio ++;
  42. }
  43. else
  44. stats.TotalKills ++;
  45. //KDratio++;
  46. }
  47. }
  48. else if( ciTarget->clientNum == cg->clientNum )
  49. stats.Deaths++;
  50. //KDratio++;
  51. }
  52.  
  53. __asm mov eax, ent
  54. orig_CG_Obituary( );
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement