This commit is contained in:
Jackz 2023-01-04 22:02:27 -06:00
parent 207c1f6314
commit 078b7c4bf6
No known key found for this signature in database
GPG key ID: E0BBD94CF657F603
28 changed files with 1101 additions and 140 deletions

View file

@ -360,8 +360,10 @@ public Action OnClientSayCommand(int client, const char[] command, const char[]
static int honkID;
static int profanityID;
static int typooId;
if(honkID == 0) honkID = GetTrollID("Honk / Meow / Woof");
if(profanityID == 0) profanityID = GetTrollID("No Profanity");
if(typooId == 0) typooId = GetTrollID("Typoos");
if(Trolls[honkID].IsActive(client) && Trolls[honkID].activeFlagClients[client] & 1) {
// Honk Processing
@ -523,6 +525,23 @@ public Action OnClientSayCommand(int client, const char[] command, const char[]
// Print original in console no matter what
PrintToServer("%N: %s", client, sArgs);
return Plugin_Handled;
} else if(Trolls[typooId].IsActive(client)) {
char strings[32][MAX_TYPOS_LENGTH];
int words = ExplodeString(sArgs, " ", strings, 32, MAX_TYPOS_LENGTH);
// Replace all typos
static char typoReplacement[32];
for(int i = 0; i < words; i++) {
if(TYPOS_DICT.GetString(strings[i], typoReplacement, sizeof(typoReplacement))) {
strcopy(strings[i], MAX_TYPOS_LENGTH, typoReplacement);
}
}
int length = MAX_TYPOS_LENGTH * words;
char[] message = new char[length];
ImplodeStrings(strings, 32, " ", message, length);
CPrintToChatAll("{blue}%N {default}: %s", client, message);
PrintToServer("%N: %s", client, sArgs);
return Plugin_Handled;
}
return Plugin_Continue;
}