diff --git a/scripting/include/feedthetrolls.inc b/scripting/include/feedthetrolls.inc index 5f992a5..2a6bae7 100644 --- a/scripting/include/feedthetrolls.inc +++ b/scripting/include/feedthetrolls.inc @@ -99,11 +99,21 @@ int autoPunished = -1, autoPunishMode, lastButtonUser, lastCrescendoUser; bool g_bPendingItemGive[MAXPLAYERS+1], g_PendingBanTroll[MAXPLAYERS+1]; GlobalForward g_PlayerMarkedForward; +//HANDLES +Handle hThrowTimer; +//CONVARS +ConVar hVictimsList, hThrowItemInterval, hAutoPunish, hMagnetChance, hShoveFailChance, hAutoPunishExpire; +//BOOLS +bool lateLoaded; //Is plugin late loaded +bool bChooseVictimAvailable = false; //For charge player feature, is it available? +//INTEGERS +int g_iAmmoTable; //Loads the ammo table to get ammo amounts +int gChargerVictim = -1; //For charge player feature //Applies the selected trollMode to the victim. //Modifiers are as followed: 0 -> Both (fire instant, and timer), 1 -> Fire Once, 2 -> Start timer //TODO: change it to only modifier at once? at least for instant fire & repeat. Menu runs ApplyMode twice -void ApplyModeToClient(int client, int victim, trollMode mode, TrollModifier modifier) { +void ApplyModeToClient(int client, int victim, trollMode mode, TrollModifier modifier, bool silent = false) { ResetClient(victim, false); if(view_as(mode) > TROLL_MODE_COUNT || view_as(mode) < 0) { ReplyToCommand(client, "Unknown troll mode ID '%d'. Pick a mode between 1 and %d", mode, TROLL_MODE_COUNT - 1); @@ -218,13 +228,15 @@ void ApplyModeToClient(int client, int victim, trollMode mode, TrollModifier mod PrintToServer("Troll Mode #%d not implemented (%s)", mode, TROLL_MODES_NAMES[mode]); } } - if(HasTrollMode(victim, mode)) { - ShowActivity(client, "deactivated troll \"%s\" on %N. ", TROLL_MODES_NAMES[mode], victim); - }else{ - if(modifier == TrollMod_Repeat) - ShowActivity(client, "activated troll \"%s\" on repeat for %N. ", TROLL_MODES_NAMES[mode], victim); - else - ShowActivity(client, "activated troll \"%s\" for %N. ", TROLL_MODES_NAMES[mode], victim); + if(!silent) { + if(HasTrollMode(victim, mode)) { + ShowActivity(client, "deactivated troll \"%s\" on %N. ", TROLL_MODES_NAMES[mode], victim); + }else{ + if(modifier == TrollMod_Repeat) + ShowActivity(client, "activated troll \"%s\" on repeat for %N. ", TROLL_MODES_NAMES[mode], victim); + else + ShowActivity(client, "activated troll \"%s\" for %N. ", TROLL_MODES_NAMES[mode], victim); + } } //If instant fire mod not provided (aka instead of no modifiers which equals both) OR repeat turned on, set bit: if(modifier == TrollMod_Repeat || modifier == TrollMod_None) { diff --git a/scripting/include/smlib.inc b/scripting/include/smlib.inc deleted file mode 100644 index 2d6413a..0000000 --- a/scripting/include/smlib.inc +++ /dev/null @@ -1,32 +0,0 @@ -#if defined _smlib_included - #endinput -#endif -#define _smlib_included - -#define SMLIB_VERSION "0.9.7" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#include -#include -#include -#include -#include -#include -#include -#include diff --git a/scripting/l4d2_feedthetrolls.sp b/scripting/l4d2_feedthetrolls.sp index 695562a..753dc18 100644 --- a/scripting/l4d2_feedthetrolls.sp +++ b/scripting/l4d2_feedthetrolls.sp @@ -9,15 +9,14 @@ #include #include #include -#include "jutils.inc" -#include +#include #include #include +#include #undef REQUIRE_PLUGIN #include - public Plugin myinfo = { name = "L4D2 Feed The Trolls", @@ -26,20 +25,6 @@ public Plugin myinfo = version = PLUGIN_VERSION, url = "" }; -//HANDLES -Handle hThrowTimer; -//CONVARS -ConVar hVictimsList, hThrowItemInterval, hAutoPunish, hMagnetChance, hShoveFailChance, hAutoPunishExpire; -//BOOLS -bool lateLoaded; //Is plugin late loaded -bool bChooseVictimAvailable = false; //For charge player feature, is it available? -//INTEGERS -int g_iAmmoTable; //Loads the ammo table to get ammo amounts -int gChargerVictim = -1; //For charge player feature - - -#include "feedthetrolls.inc" - //plugin start public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max) { @@ -48,7 +33,6 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max } } - public void OnPluginStart() { EngineVersion g_Game = GetEngineVersion(); if(g_Game != Engine_Left4Dead2) { @@ -66,7 +50,6 @@ public void OnPluginStart() { hMagnetChance = CreateConVar("sm_ftt_magnet_chance", "1.0", "% of the time that the magnet will work on a player.", FCVAR_NONE, true, 0.0, true, 1.0); hShoveFailChance = CreateConVar("sm_ftt_shove_fail_chance", "0.5", "The % chance that a shove fails", FCVAR_NONE, true, 0.0, true, 1.0); - //TODO: Add punish last button presser/crescendo starter RegAdminCmd("sm_ftl", Command_ListTheTrolls, ADMFLAG_KICK, "Lists all the trolls currently ingame."); RegAdminCmd("sm_ftm", Command_ListModes, ADMFLAG_KICK, "Lists all the troll modes and their description"); RegAdminCmd("sm_ftr", Command_ResetUser, ADMFLAG_KICK, "Resets user of any troll effects."); @@ -456,9 +439,12 @@ public Action Command_ApplyUser(int client, int args) { menu.ExitButton = true; menu.Display(client, 0); }else{ - char arg1[32], arg2[32]; + char arg1[32], arg2[32], arg3[8]; GetCmdArg(1, arg1, sizeof(arg1)); GetCmdArg(2, arg2, sizeof(arg2)); + GetCmdArg(3, arg3, sizeof(arg3)); + + bool silent = StrEqual(arg3, "silent", "hide", "quiet"); int mode = StringToInt(arg2); if(mode == 0) { @@ -484,7 +470,7 @@ public Action Command_ApplyUser(int client, int args) { for (int i = 0; i < target_count; i++) { if(IsClientConnected(target_list[i]) && IsClientInGame(target_list[i]) && GetClientTeam(target_list[i]) == 2) - ApplyModeToClient(client, target_list[i], view_as(mode), TrollMod_None); + ApplyModeToClient(client, target_list[i], view_as(mode), TrollMod_None, silent); } } }