- Apr 26, 2015
- 1,029
- 896
- 216
Hello everyone, today I release my dumbest an funniest (you need friends ofc) plugin to date. "Anarchy Chat". It allows you and everyone that has the plugin to send message to each-others anonymously.
Usage : /anarchy your message here
Compile as AnarchyChat.dll (for Windows) or AnarchyChat.so (for Linux), you won't receive shit otherwise
Attached is a 32-bit version.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "public_rare_definitions.h"
#include "ts3_functions.h"
#include "plugin.h"
#define _strcpy(dest, destSize, src) { strncpy(dest, src, destSize-1); (dest)[destSize-1] = '\0'; }
static char* pluginID = NULL;
static struct TS3Functions ts3Functions;
const char* ts3plugin_name() {
return "AnarchyChat";
}
const char* ts3plugin_version() {
return "0.1";
}
int ts3plugin_apiVersion() {
return 20;
}
const char* ts3plugin_author() {
return "ehthe";
}
const char* ts3plugin_description() {
return "Twitch chat but worse !";
}
void ts3plugin_setFunctionPointers(const struct TS3Functions funcs) {
ts3Functions = funcs;
}
int ts3plugin_init() {
return 0;
}
void ts3plugin_shutdown() {
if(pluginID) {
free(pluginID);
pluginID = NULL;
}
}
void ts3plugin_registerPluginID(const char* id) {
const size_t sz = strlen(id) + 1;
pluginID = (char*)malloc(sz * sizeof(char));
_strcpy(pluginID, sz, id);
}
void ts3plugin_freeMemory(void* data) {
free(data);
}
const char* ts3plugin_commandKeyword() {
return "anarchy";
}
int ts3plugin_processCommand(uint64 serverConnectionHandlerID, const char* command) {
ts3Functions.sendPluginCommand(serverConnectionHandlerID, pluginID, command, PluginCommandTarget_SERVER, NULL, NULL);
return 0;
}
void ts3plugin_onPluginCommandEvent(uint64 serverConnectionHandlerID, const char* pluginName, const char* pluginCommand) {
if(strncmp(pluginName, "AnarchyChat", 40) == 0) {
char messageToDisplay[1536] = {0};
snprintf(messageToDisplay, 1535, "[B][COLOR=#ff0000]Anarchy chat[/COLOR][/B] : %s", pluginCommand);
ts3Functions.printMessage(serverConnectionHandlerID, (const char*) messageToDisplay, PLUGIN_MESSAGE_TARGET_SERVER);
}
}
Compile as AnarchyChat.dll (for Windows) or AnarchyChat.so (for Linux), you won't receive shit otherwise
Attached is a 32-bit version.
Attachments
Last edited: