#include #include #define MAX_ARRAY_SIZE 64 #define MAX_MESSAGE_SIZE 256 //TODO MySql Get char badwords[MAX_ARRAY_SIZE][MAX_MESSAGE_SIZE]; public OnPluginStart() { fillMe() AddCommandListener(IncomingMessage, "say"); AddCommandListener(IncomingMessage, "say_team"); AddCommandListener(IncomingMessage, "say2"); } public OnPluginEnd() { clearMe() RemoveCommandListener(IncomingMessage, "say"); RemoveCommandListener(IncomingMessage, "say_team"); RemoveCommandListener(IncomingMessage, "say2"); } public Action:IncomingMessage(client, const String:command[], args) { char message[MAX_MESSAGE_SIZE]; GetCmdArgString(message, sizeof(message)); StripQuotes(message); if (search(message)) { //FakeClientCommand(client, "explode"); createGayBomb(client); return Plugin_Handled; } else return Plugin_Continue; } stock clearMe() { for (int i = 0; i < MAX_ARRAY_SIZE;i++) { badwords[i][0] = '\0'; } } stock fillMe() { clearMe() Format(badwords[0], MAX_MESSAGE_SIZE, "трейд"); Format(badwords[1], MAX_MESSAGE_SIZE, "trade"); Format(badwords[2], MAX_MESSAGE_SIZE, "обмен"); Format(badwords[3], MAX_MESSAGE_SIZE, "oбмен"); Format(badwords[4], MAX_MESSAGE_SIZE, "обмeн"); Format(badwords[5], MAX_MESSAGE_SIZE, "oбмeн"); Format(badwords[6], MAX_MESSAGE_SIZE, "trаde"); Format(badwords[7], MAX_MESSAGE_SIZE, "tradе"); Format(badwords[8], MAX_MESSAGE_SIZE, "trаdе"); Format(badwords[9], MAX_MESSAGE_SIZE, "трeйд"); Format(badwords[10], MAX_MESSAGE_SIZE, "тpейд"); Format(badwords[11], MAX_MESSAGE_SIZE, "тpeйд"); Format(badwords[12], MAX_MESSAGE_SIZE, "куплю"); Format(badwords[13], MAX_MESSAGE_SIZE, "продам"); Format(badwords[14], MAX_MESSAGE_SIZE, "sell"); Format(badwords[15], MAX_MESSAGE_SIZE, "sеll"); Format(badwords[16], MAX_MESSAGE_SIZE, "продаю вещи"); Format(badwords[17], MAX_MESSAGE_SIZE, " ключи"); Format(badwords[18], MAX_MESSAGE_SIZE, "металл"); // Format(badwords[19], MAX_MESSAGE_SIZE, "ТРЕЙД"); Format(badwords[20], MAX_MESSAGE_SIZE, "TRADE"); Format(badwords[21], MAX_MESSAGE_SIZE, "ОБМЕН"); Format(badwords[22], MAX_MESSAGE_SIZE, "OБМЕН"); Format(badwords[23], MAX_MESSAGE_SIZE, "ОБМEН"); Format(badwords[24], MAX_MESSAGE_SIZE, "OБМEН"); Format(badwords[25], MAX_MESSAGE_SIZE, "TRАDE"); Format(badwords[26], MAX_MESSAGE_SIZE, "TRADЕ"); Format(badwords[27], MAX_MESSAGE_SIZE, "TRАDЕ"); Format(badwords[28], MAX_MESSAGE_SIZE, "ТРEЙД"); Format(badwords[29], MAX_MESSAGE_SIZE, "ТPЕЙД"); Format(badwords[30], MAX_MESSAGE_SIZE, "ТPEЙД"); Format(badwords[31], MAX_MESSAGE_SIZE, "КУПЛЮ"); Format(badwords[32], MAX_MESSAGE_SIZE, "ПРОДАМ"); Format(badwords[33], MAX_MESSAGE_SIZE, "SELL"); Format(badwords[34], MAX_MESSAGE_SIZE, "SЕLL"); Format(badwords[35], MAX_MESSAGE_SIZE, "ПРОДАЮ ВЕЩИ"); Format(badwords[36], MAX_MESSAGE_SIZE, " КЛЮЧИ"); Format(badwords[37], MAX_MESSAGE_SIZE, "МЕТАЛЛ"); } stock genMessage(char[] buffer, int size) { switch (GetRandomInt(0, 3)) { case 0: { Format(buffer, size, "Отсосу за %d рефов", GetRandomInt(10, 99)); } case 1: { Format(buffer, size, "Отдам жопу за %d ключей", GetRandomInt(5, 14)); } case 2: { Format(buffer, size, "Отдаю родную мать за %d ключей и %d рефов", GetRandomInt(10, 99), GetRandomInt(5,84)); } case 3: { Format(buffer, size, "Бесплатно отдамся в руки фембойчику"); } } } stock bool search(const char[] message) { for (int i = 0; i < MAX_ARRAY_SIZE;i++) { if (strlen(badwords[i]) == 0) return false; if (StrContains(message, badwords[i], false) != -1) { PrintToServer("Found bad word: %s", badwords[i]); return true; } } return false; } stock createGayBomb(client) { int uid = GetClientUserId(client); CreateTimer(0.01, GayBomb, uid, TIMER_FLAG_NO_MAPCHANGE); } public Action GayBomb(Handle timer, any data) { int client = GetClientOfUserId(data); if (client != 0) { char b[MAX_MESSAGE_SIZE]; genMessage(b, MAX_MESSAGE_SIZE); FakeClientCommand(client, "say \"%s\"", b); } return Plugin_Stop; }