Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.7 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #include "cbase.h"
  14. #include "basetempentity.h"
  15. // memdbgon must be the last include file in a .cpp file!!!
  16. #include "tier0/memdbgon.h"
  17. //-----------------------------------------------------------------------------
  18. // Purpose: Dispatches blood stream tempentity
  19. //-----------------------------------------------------------------------------
  20. class CTEKillPlayerAttachments : public CBaseTempEntity
  21. {
  22. public:
  23. DECLARE_CLASS( CTEKillPlayerAttachments, CBaseTempEntity );
  24. CTEKillPlayerAttachments( const char *name );
  25. virtual ~CTEKillPlayerAttachments( void );
  26. virtual void Test( const Vector& current_origin, const QAngle& current_angles );
  27. DECLARE_SERVERCLASS();
  28. public:
  29. CNetworkVar( int, m_nPlayer );
  30. };
  31. //-----------------------------------------------------------------------------
  32. // Purpose:
  33. // Input : *name -
  34. //-----------------------------------------------------------------------------
  35. CTEKillPlayerAttachments::CTEKillPlayerAttachments( const char *name ) :
  36. CBaseTempEntity( name )
  37. {
  38. m_nPlayer = 0;
  39. }
  40. //-----------------------------------------------------------------------------
  41. // Purpose:
  42. //-----------------------------------------------------------------------------
  43. CTEKillPlayerAttachments::~CTEKillPlayerAttachments( void )
  44. {
  45. }
  46. //-----------------------------------------------------------------------------
  47. // Purpose:
  48. // Input : *current_origin -
  49. // *current_angles -
  50. //-----------------------------------------------------------------------------
  51. void CTEKillPlayerAttachments::Test( const Vector& current_origin, const QAngle& current_angles )
  52. {
  53. m_nPlayer = 1;
  54. CBroadcastRecipientFilter filter;
  55. Create( filter, 0.0 );
  56. }
  57. IMPLEMENT_SERVERCLASS_ST(CTEKillPlayerAttachments, DT_TEKillPlayerAttachments)
  58. SendPropInt( SENDINFO(m_nPlayer), 5, SPROP_UNSIGNED ),
  59. END_SEND_TABLE()
  60. // Singleton to fire TEKillPlayerAttachments objects
  61. static CTEKillPlayerAttachments g_TEKillPlayerAttachments( "KillPlayerAttachments" );
  62. //-----------------------------------------------------------------------------
  63. // Purpose:
  64. // Input : msg_dest -
  65. // delay -
  66. // *origin -
  67. // *recipient -
  68. // player -
  69. //-----------------------------------------------------------------------------
  70. void TE_KillPlayerAttachments( IRecipientFilter& filter, float delay,
  71. int player )
  72. {
  73. g_TEKillPlayerAttachments.m_nPlayer = player;
  74. // Send it over the wire
  75. g_TEKillPlayerAttachments.Create( filter, delay );
  76. }