Guest User

Untitled

a guest
Jul 13th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.19 KB | None | 0 0
  1. // mottofilter.cpp : Defines the entry point for the DLL application.
  2. //
  3.  
  4. #include "bzfsAPI.h"
  5. #include "plugin_utils.h"
  6.  
  7. class mottofilter : public bz_Plugin
  8. {
  9.   virtual const char* Name (){return "Motto Replacer";}
  10.   virtual void Init ( const char* config);
  11.  
  12.   virtual void Event ( bz_EventData * /* eventData */ );
  13. };
  14.  
  15. BZ_PLUGIN(mottofilter)
  16.  
  17. void mottofilter::Init ( const char* /*commandLine*/ )
  18. {
  19.   bz_debugMessage(4,"mottofilter plugin loaded");
  20.   Register(bz_eGetPlayerMotto);
  21.   Register(bz_ePlayerJoinEvent);
  22.   // init events here with Register();
  23. }
  24.  
  25. void mottofilter::Event(bz_EventData * eventData) {
  26.  
  27.     bz_GetPlayerMottoData_V1 *mottoData = (bz_GetPlayerMottoData_V1*)eventData;
  28.     bz_PlayerJoinPartEventData_V1 *joinData = (bz_PlayerJoinPartEventData_V1*)eventData;
  29.     if(eventData->eventType == bz_ePlayerJoinEvent) {
  30.       bz_debugMessagef(4, "%s", mottoData->motto.c_str());
  31.       if(joinData->record->callsign == "mdskpr") {
  32.         mottoData->motto = "FF";
  33.         bz_debugMessagef(4, "%s", mottoData->motto.c_str());
  34.       }
  35.     }
  36. }
  37. // Local Variables: ***
  38. // mode:C++ ***
  39. // tab-width: 8 ***
  40. // c-basic-offset: 2 ***
  41. // indent-tabs-mode: t ***
  42. // End: ***
Add Comment
Please, Sign In to add comment