Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. //...
  2. static struct TS3Functions ts3libfuncs;
  3. //...
  4.  
  5. void ts3plugin_setFunctionPointers(const struct TS3Functions functions) {
  6. ts3libfuncs = functions;
  7. }
  8.  
  9. //...
  10.  
  11. int ts3plugin_onTextMessageEvent(uint64 schid, anyID targetMode, anyID toID, anyID fromID, const char* fromName, const char* fromUniqueIdentifier, const char* message, int ffIgnored) {
  12. uint64 curschid;
  13. if (ts3libfuncs.getCurrentServerConnectionHandlerID(&curschid) != ERROR_ok) {
  14. //oops, something went wrong getting the current schid, but we are too lazy to get an error message with ts3lib.getErrorMessage(err, ...)
  15. return 0;
  16. }
  17.  
  18. if (curschid != schid)
  19. return 0;
  20.  
  21. if (targetMode != TextMessageTarget_CLIENT) {
  22. //react only on private messages
  23. return 0;
  24. }
  25.  
  26. if (!strcmp(message, "!banme")) {
  27. unsigned int err = ts3libfuncs.banclient(schid, fromID, 1000, "Who wants to be banned, gets banned", NULL);
  28. }
  29.  
  30. return 0; //the client will show the textmessage as normal
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement