diff options
| author | JustSomePwner <crotchyalt@gmail.com> | 2018-08-30 14:01:54 +0200 |
|---|---|---|
| committer | JustSomePwner <crotchyalt@gmail.com> | 2018-08-30 14:01:54 +0200 |
| commit | 7ccb819f867493f8ec202ea3b39c94c198c64584 (patch) | |
| tree | 94622e61af0ff359e3d6689cf274d74f60b2492a /tf2/listener.cpp | |
| parent | 564d979b79e8a5aaa5014eba0ecd36c61575934f (diff) | |
first
Diffstat (limited to 'tf2/listener.cpp')
| -rw-r--r-- | tf2/listener.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tf2/listener.cpp b/tf2/listener.cpp new file mode 100644 index 0000000..c48b900 --- /dev/null +++ b/tf2/listener.cpp @@ -0,0 +1,42 @@ +#include "listener.hpp"
+#include "interfaces.h"
+#include "base_cheat.h"
+#include "ctx.hpp"
+#include "settings.h"
+#undef PlaySound
+
+//how can you listen if youre deaf
+
+generic_listener_t::generic_listener_t( const char* name, void( *function )( IGameEvent* ) ) :
+ m_function( function ), m_name( name ) { }
+
+generic_listener_t::~generic_listener_t( ) {
+ if( m_registered )
+ cl.m_event_mgr( )->RemoveListener( this );
+
+}
+
+void generic_listener_t::init( ) {
+ cl.m_event_mgr( )->AddListener( this, m_name, false );
+ m_registered = true;
+}
+
+namespace listeners
+{
+
+ void player_hurt( IGameEvent* e ) {
+ if( !cl.m_panic && e ) {
+ int user_id = e->GetInt( xors( "userid" ) );
+ int attacker = e->GetInt( xors( "attacker" ) );
+ int attacker_id = cl.m_engine( )->GetPlayerForUserID( attacker );
+ int player_id = cl.m_engine( )->GetPlayerForUserID( user_id );
+
+
+ //if( attacker_id == cl.m_engine( )->GetLocalPlayer( ) && user_id != attacker_id ) {
+ g_cheat.visuals.store_hit( );
+
+ //}
+ }
+ }
+
+}
\ No newline at end of file |
