diff --git a/plugins/l4d2_feedthetrolls.smx b/plugins/l4d2_feedthetrolls.smx index 877b935..2b51ad1 100644 Binary files a/plugins/l4d2_feedthetrolls.smx and b/plugins/l4d2_feedthetrolls.smx differ diff --git a/scripting/l4d2_feedthetrolls.sp b/scripting/l4d2_feedthetrolls.sp index 3bafc4c..b6985e8 100644 --- a/scripting/l4d2_feedthetrolls.sp +++ b/scripting/l4d2_feedthetrolls.sp @@ -12,6 +12,7 @@ #include "jutils.inc" #include #include +#include #undef REQUIRE_PLUGIN #include @@ -93,6 +94,7 @@ public void OnMapEnd() { UnhookEntityOutput("func_button", "OnPressed", Event_ButtonPress); } public void OnMapStart() { + lastButtonUser = -1; HookEntityOutput("func_button", "OnPressed", Event_ButtonPress); CreateTimer(MAIN_TIMER_INTERVAL_S, Timer_Main, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE); PrecacheSound("player/footsteps/clown/concrete1.wav"); @@ -118,11 +120,18 @@ public Action Event_WeaponReload(int weapon) { return Plugin_Continue; } public Action Event_ButtonPress(const char[] output, int entity, int client, float delay) { + PrintToChatAll("func_button"); if(client > 0 && client <= MaxClients) { lastButtonUser = client; } return Plugin_Continue; } +public void Event_PanicEventCreate(Event event, const char[] name, bool dontBroadcast) { + int client = GetClientOfUserId(event.GetInt("userid")); + if(client) { + lastButtonUser = client; + } +} public Action L4D2_OnChooseVictim(int attacker, int &curTarget) { // ========================= // OVERRIDE VICTIM @@ -334,14 +343,16 @@ public Action SoundHook(int[] clients, int& numClients, char sample[PLATFORM_MAX strcopy(sample, sizeof(sample), "player/footsteps/clown/concrete1.wav"); return Plugin_Changed; } - }else if(HasTrollMode( entity, Troll_VocalizeGag)) { - if(StrContains(sample, "player\\survivor\\voice") > -1) { - return Plugin_Stop; - } } } return Plugin_Continue; } +public Action OnVocalizationProcess(int client, const char[] vocalize, int initiator) { + if(HasTrollMode(client, Troll_VocalizeGag)) { + return Plugin_Stop; + } + return Plugin_Continue; +} /////////////////////////////////////////////////////////////////////////////// // CVAR CHANGES ///////////////////////////////////////////////////////////////////////////////