diff --git a/plugins/l4d2_feedthetrolls.smx b/plugins/l4d2_feedthetrolls.smx index 9a798d9..b001608 100644 Binary files a/plugins/l4d2_feedthetrolls.smx and b/plugins/l4d2_feedthetrolls.smx differ diff --git a/scripting/include/feedthetrolls/base.inc b/scripting/include/feedthetrolls/base.inc index e54ee1b..f72e1e0 100644 --- a/scripting/include/feedthetrolls/base.inc +++ b/scripting/include/feedthetrolls/base.inc @@ -353,8 +353,10 @@ void DisableTroll(int client, const char[] troll) { } } -void SetCategory(const char[] newCat) { - categoryID = categories.PushString(newCat); +public void SetCategory(const char[] newCat) { + categoryID = categories.FindString(newCat); + if(categoryID == -1) + categoryID = categories.PushString(newCat); } void GetCategory(int category, char[] buffer, int size) { categories.GetString(category, buffer, size); diff --git a/scripting/include/feedthetrolls/events.inc b/scripting/include/feedthetrolls/events.inc index cdabe4d..ee7192a 100644 --- a/scripting/include/feedthetrolls/events.inc +++ b/scripting/include/feedthetrolls/events.inc @@ -147,7 +147,9 @@ public Action L4D2_OnEntityShoved(int client, int entity, int weapon, float vecD } public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs) { if(sArgs[0] == '@') return Plugin_Continue; - if(IsTrollActive(client, "Honk")) { + static Troll honkTroll; + if(!honkTroll.id) GetTroll("Honk / Meow", honkTroll); + if(honkTroll.IsActive(client) && honkTroll.activeFlagClients[client] & 1) { static char strings[32][7]; int words = ExplodeString(sArgs, " ", strings, sizeof(strings), 5); for(int i = 0; i < words; i++) { @@ -379,14 +381,16 @@ public Action SoundHook(int[] clients, int& numClients, char sample[PLATFORM_MAX lastButtonUser = -1; }else if(numClients > 0 && entity > 0 && entity <= MaxClients) { if(StrContains(sample, "survivor\\voice") > -1) { - if(IsTrollActive(entity, "Honk")) { - strcopy(sample, sizeof(sample), "player/footsteps/clown/concrete1.wav"); + static Troll honkTroll; + if(!honkTroll.id) GetTroll("Honk / Meow", honkTroll); + if(honkTroll.IsActive(entity)) { + if(honkTroll.activeFlagClients[entity] & 1) + strcopy(sample, sizeof(sample), "player/footsteps/clown/concrete1.wav"); + else + strcopy(sample, sizeof(sample), "custom/meow1.mp3"); return Plugin_Changed; } else if(IsTrollActive(entity, "Vocalize Gag")) { return Plugin_Handled; - } else if(IsTrollActive(entity, "Meow")) { - strcopy(sample, sizeof(sample), "custom/meow1.mp3"); - return Plugin_Changed; } } diff --git a/scripting/include/feedthetrolls/trolls.inc b/scripting/include/feedthetrolls/trolls.inc index 6a8e392..0fcb3ba 100644 --- a/scripting/include/feedthetrolls/trolls.inc +++ b/scripting/include/feedthetrolls/trolls.inc @@ -27,7 +27,6 @@ void SetupTrolls() { Trolls[index].AddFlag("Biles", true); Trolls[index].AddFlag("Molotovs", true); Trolls[index].AddFlag("Pipebombs", true); - SetupTroll("No Pickup", "Prevents a player from picking up ANY (new) item. Use ThrowItAll to make them drop", TrollMod_Constant); SetupTroll("UziRules", "Picking up a weapon gives them a UZI instead", TrollMod_Constant); SetupTroll("Primary Disable", "Player cannot pickup any weapons, only melee/pistols", TrollMod_Constant); @@ -37,8 +36,9 @@ void SetupTrolls() { SetupTroll("iCantSpellNoMore", "Chat messages letter will randomly changed with wrong letters", TrollMod_Constant); SetupTroll("No Profanity", "Replaces some words with random phrases", TrollMod_Constant); SetupTroll("Vocalize Gag", "Prevents player from sending any vocalizations (even automatic)", TrollMod_Constant); - SetupTroll("Honk", "Honk", TrollMod_Constant); - SetupTroll("Meow", "Makes the player meow", TrollMod_Constant); + index = SetupTroll("Honk / Meow", "Honk", TrollMod_Constant, false); + Trolls[index].AddFlag("Honk", true); + Trolls[index].AddFlag("Meow", false); SetCategory("Health"); SetupTroll("Damage Boost", "Makes a player take more damage than normal", TrollMod_Constant);