Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //...
- static struct TS3Functions ts3libfuncs;
- //...
- void ts3plugin_setFunctionPointers(const struct TS3Functions functions) {
- ts3libfuncs = functions;
- }
- //...
- int ts3plugin_onTextMessageEvent(uint64 schid, anyID targetMode, anyID toID, anyID fromID, const char* fromName, const char* fromUniqueIdentifier, const char* message, int ffIgnored) {
- uint64 curschid;
- if (ts3libfuncs.getCurrentServerConnectionHandlerID(&curschid) != ERROR_ok) {
- //oops, something went wrong getting the current schid, but we are too lazy to get an error message with ts3lib.getErrorMessage(err, ...)
- return 0;
- }
- if (curschid != schid)
- return 0;
- if (targetMode != TextMessageTarget_CLIENT) {
- //react only on private messages
- return 0;
- }
- if (!strcmp(message, "!banme")) {
- unsigned int err = ts3libfuncs.banclient(schid, fromID, 1000, "Who wants to be banned, gets banned", NULL);
- }
- return 0; //the client will show the textmessage as normal
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement