diff --git a/plugins/l4d2_feedthetrolls.smx b/plugins/l4d2_feedthetrolls.smx index 3241da2..7b440b2 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 1f26db9..d10c5bf 100644 --- a/scripting/include/feedthetrolls/base.inc +++ b/scripting/include/feedthetrolls/base.inc @@ -4,7 +4,7 @@ //Allow MAX_TROLLS to be defined elsewhere #if defined MAX_TROLLS #else - #define MAX_TROLLS 46 + #define MAX_TROLLS 47 #endif enum trollModifier { diff --git a/scripting/include/feedthetrolls/events.inc b/scripting/include/feedthetrolls/events.inc index f764c20..085e0c6 100644 --- a/scripting/include/feedthetrolls/events.inc +++ b/scripting/include/feedthetrolls/events.inc @@ -744,10 +744,20 @@ public Action Event_TakeDamage(int victim, int& attacker, int& inflictor, float& public Action OnVocalizeCommand(int client, const char[] vocalize, int initiator) { static int vocalGagID; + static int noRushingUsID; if(vocalGagID == 0) vocalGagID = GetTrollID("Vocalize Gag"); + if(noRushingUsID == 0) noRushingUsID = GetTrollID("No Rushing Us"); + if(Trolls[noRushingUsID].IsActive(client) && StrEqual(vocalize, "PlayerHurryUp") || StrEqual(vocalize, "PlayerYellRun") || StrEqual(vocalize, "PlayerMoveOn") || StrEqual(vocalize, "PlayerLeadOn")) { + float speed = GetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue"); + speed -= 0.01; + if(speed < 0.0) SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", 0.0); + else if(speed > 0.05) + SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", speed); + PrintToConsoleAdmins("[FTT] NoRushingUs: Dropping speed for %N (now %.1f%)", client, speed * 100.0); + } if(Trolls[vocalGagID].IsActive(client)) { return Plugin_Handled; - } + } return Plugin_Continue; } diff --git a/scripting/include/feedthetrolls/misc.inc b/scripting/include/feedthetrolls/misc.inc index 7c7856b..84f9ca4 100644 --- a/scripting/include/feedthetrolls/misc.inc +++ b/scripting/include/feedthetrolls/misc.inc @@ -544,4 +544,18 @@ stock LookAtPoint(int entity, const float destination[3]){ } angles[1] -= 180; TeleportEntity(entity, NULL_VECTOR, angles, NULL_VECTOR); -} \ No newline at end of file +} +stock void PrintToConsoleAdmins(const char[] format, any ...) { + char buffer[254]; + + VFormat(buffer, sizeof(buffer), format, 2); + for(int i = 1; i <= MaxClients; i++) { + if(IsClientConnected(i) && IsClientInGame(i)) { + AdminId admin = GetUserAdmin(i); + if(admin != INVALID_ADMIN_ID) { + PrintToConsole(i, "%s", buffer); + } + } + } + PrintToServer("%s", buffer); +} diff --git a/scripting/include/feedthetrolls/trolls.inc b/scripting/include/feedthetrolls/trolls.inc index 2cbe978..efaa8a3 100644 --- a/scripting/include/feedthetrolls/trolls.inc +++ b/scripting/include/feedthetrolls/trolls.inc @@ -130,6 +130,7 @@ void SetupTrolls() { Trolls[index].AddFlag("Show Modified Only To Them", false); SetupTroll("Reversed", "Reserves their message", TrollMod_Constant); SetupTroll("Voice Mute", "Mutes from voice", TrollMod_Constant); + SetupTroll("No Rushing Us", "Decreases player speed everytime they yell hurry up", TrollMod_Constant); /// CATEGORY: Health SetCategory("Health"); @@ -217,7 +218,6 @@ bool ApplyAffect(int victim, const Troll troll, int activator, trollModifier mod for(int i = 0; i <= MAX_TROLLS; i++) { Trolls[i].activeFlagClients[victim] = -1; } - SetEntPropFloat(victim, Prop_Send, "m_flLaggedMovementValue", 1.0); SetEntityGravity(victim, 1.0); SetEntPropFloat(victim, Prop_Send, "m_flLaggedMovementValue", 1.0); return false; @@ -439,12 +439,14 @@ bool ApplyAffect(int victim, const Troll troll, int activator, trollModifier mod pdata[victim].smartChargeMaxAttempts = timeout; pdata[victim].smartChargeActivator = GetClientUserId(activator); CreateTimer(1.0, Timer_CheckForChargerOpportunity, GetClientUserId(victim), TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE); - } else if(~modifier & TrollMod_Constant) { + } else if(StrEqual(troll.name, "No Rushing Us")) { + SetEntPropFloat(victim, Prop_Send, "m_flLaggedMovementValue", 1.0); + } else if(~modifier & TrollMod_Constant) { PrintToServer("[FTT] Warn: Possibly invalid troll, no apply action defined for \"%s\"", troll.name); #if defined DEBUG ReplyToCommand(activator, "[FTT/Debug] If nothing occurs, this troll possibly was not implemented correctly. "); #endif - } + } return true; }