IGameEventManager: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 12: Line 12:


<pre>
<pre>
  void Plugin::LevelInit( char const* pMapName ) {
void Plugin::LevelInit( char const* pMapName ) {
Msg( "Level \"%s\" has been loaded\n", pMapName );
Msg( "Level \"%s\" has been loaded\n", pMapName );
gameeventmanager->AddListener( this, "player_say", true );
gameeventmanager->AddListener( this, "player_say", true );
  }
}
</pre>
</pre>



Revision as of 13:03, 16 August 2006

Getting an Instance if the IGameEventManager

 bool Plugin::Load( CreateInterfaceFn interfaceFactory, CreateInterfaceFn gameServerFactory ) {
       IGameEventManager2* gameeventmanager = 
               (IGameEventManager2*) interfaceFactory( INTERFACEVERSION_GAMEEVENTSMANAGER2, NULL);
 }

Subscribing for Events

void Plugin::LevelInit( char const* pMapName ) {
	Msg( "Level \"%s\" has been loaded\n", pMapName );
	gameeventmanager->AddListener( this, "player_say", true );
}


See Also