From 1ed0753fd65239fa681c5204765f40b231e86e98 Mon Sep 17 00:00:00 2001 From: SirPlease Date: Sun, 15 Oct 2023 20:09:17 +0200 Subject: [PATCH] update l4d2_magnum_incap - Remove colors include. - Removed dependency on character models and thus allowing for custom survivor models that can be named that don't respect conventional naming, as well as adding support for servers that use more than 4 Survivors and duplicate Survivors. - Fixed issues with players not getting their secondary weapon back after incap. - Fixed issues with players not getting the magnum back after incap. --- .../plugins/optional/l4d2_magnum_incap.smx | Bin 7650 -> 7137 bytes .../sourcemod/scripting/l4d2_magnum_incap.sp | 97 +++++++----------- 2 files changed, 35 insertions(+), 62 deletions(-) diff --git a/addons/sourcemod/plugins/optional/l4d2_magnum_incap.smx b/addons/sourcemod/plugins/optional/l4d2_magnum_incap.smx index 5ed6a08dc6a1e2dd92d62aaf263b512ace260765..f7629893612bcfea9d0d4348922881b07b78a705 100644 GIT binary patch delta 6990 zcmXY!1yoee+s79WkXGpymJlSA7M74$B$bwyZlqcA5&}v}cSuPiOE;3s(x5c5NJ=f; z@$T<`-gEBve!l0-^UR%RX3m_seJ|l0>;~7M)_Y~a_>N(M;I1kq=oSi3~Mop!+1Vy5U2~|+c6(RV~XUnh`*Zv^i9x8 zvLZk9A3maLvha>z_a6H5^Ti;Zh@vYK8&-F`Osr+F;lww=slk(C8{eu{{BBB|u zyN(-O`Lif^1CMr9B=?K}H+PYSojXv#0dB;A}>jH5Pq$ib3R7!wc7;l}L3p*2?&$ z8H54d&d{{2rCp4p3|OKp9+z&8E5^|P+?p3}JdLQb|8ER_bmI%NVoU@?V}`UVOcXL%%V2XBvSg1P9aUD}g17;z=yv;h(uuIiLavJ&Q%~1++v);^Z5=zOy&CO-?Y5&`ayUtSj*lk67-U0`DCs~V z?sAx1`Qobaa5!6h>=!VZNNp+gNrLxybAi)VO}}^+S$}-$8<9V=0@Ltc2cN)3;EFr0 zo)W(g7F(M5oRB8!QN!-qN80Ud#*8K=rCMZ3{szhZRLUkarffssTXIX0q1b5lID^v` z!(?3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UQ56zY_s1VkG7?pl+bqEw9rvH4ZqhQz!>IaGousx9 zsA5F+RB|N)hv^olAVGXJ$w1uie`$B6KtkqN0!sJyv%2(QNz>lqN zS0VG6RLy#i6TH868|rrKK)=$=ynNHnYjul(%&Svns6I}RDC!>8PrVv(9vt0EPL0G} zACQd17x5KqbqB#MRAsb2y|i!Hlwq{OfXbccld%& zf;K62p@{tX5?$C_{EE5U5)d!E$?1`FBk~bezIV$iKnir1(?A-`X(#n|sFbRFK9#j8 z&39;)J1$DWcWzS$3L@+b?e_3$6j@c+67q`&H&%PD(o_JCnfWlnHmjFb63@E<@DAyJl|!(9d9j|Z)f3%c1^qnx iv|?$+qk7hjhx2Xfm0y3<8Y^UC7R -#include #define L4D2UTIL_STOCKS_ONLY 1 #include -#define MAX_SURVIVORS 4 #define ENTITY_MAX_NAME_LENGTH 64 #define DEBUG 0 - ConVar g_hReplaceMagnum = null; -int g_hasDeagle[MAX_SURVIVORS]; +bool g_bHasDeagle[MAXPLAYERS + 1]; public Plugin myinfo = { name = "Magnum incap remover", - author = "robex", + author = "robex, Sir", description = "Replace magnum with regular pistols when incapped.", - version = "0.3", + version = "0.4", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -30,28 +27,43 @@ public void OnPluginStart() HookEvent("player_incapacitated", PlayerIncap_Event); HookEvent("revive_success", ReviveSuccess_Event); + HookEvent("round_start", RoundStart_Event); + HookEvent("bot_player_replace", Replaced_Event); + HookEvent("player_bot_replace", Replaced_Event); } -public Action PlayerIncap_Event(Handle event, const char[] name, bool bDontBroadcast) +void RoundStart_Event(Event hEvent, char[] name, bool dontBroadcast) { - if (GetConVarInt(g_hReplaceMagnum) < 1) { - return Plugin_Continue; + for (int i = 1; i <= MaxClients; i++) + { + g_bHasDeagle[i] = false; } +} - int client = GetClientOfUserId(GetEventInt(event, "userid")); +void Replaced_Event(Event hEvent, char[] name, bool dontBroadcast) +{ + bool bBotReplaced = (!strncmp(name, "b", 1)); + int replaced = bBotReplaced ? GetClientOfUserId(hEvent.GetInt("bot")) : GetClientOfUserId(hEvent.GetInt("player")); + int replacer = bBotReplaced ? GetClientOfUserId(hEvent.GetInt("player")) : GetClientOfUserId(hEvent.GetInt("bot")); + + g_bHasDeagle[replacer] = g_bHasDeagle[replaced]; +} + +void PlayerIncap_Event(Event hEvent, char[] name, bool dontBroadcast) +{ + if (GetConVarInt(g_hReplaceMagnum) < 1) { return; } + + int client = GetClientOfUserId(hEvent.GetInt("userid")); // This also fires on Tank Death, so check for client team to prevent issues down the line. - if (GetClientTeam(client) != 2) { return Plugin_Continue; } + if (GetClientTeam(client) != 2) { return; } - int playerIndex = GetPlayerCharacter(client); char sWeaponName[ENTITY_MAX_NAME_LENGTH]; int secWeaponIndex = GetPlayerWeaponSlot(client, L4D2WeaponSlot_Secondary); GetEdictClassname(secWeaponIndex, sWeaponName, sizeof(sWeaponName)); - #if DEBUG - PrintToChatAll("client %d, player index %d", client, playerIndex); - CPrintToChatAll("client %d -> weapon %s", client, sWeaponName); + PrintToChatAll("client %d -> weapon %s", client, sWeaponName); #endif int secWeapId = WeaponNameToId(sWeaponName); @@ -63,68 +75,29 @@ public Action PlayerIncap_Event(Handle event, const char[] name, bool bDontBroad if (GetConVarInt(g_hReplaceMagnum) > 1) { GivePlayerItem(client, "weapon_pistol"); } - g_hasDeagle[playerIndex] = 1; + g_bHasDeagle[client] = true; } else { - g_hasDeagle[playerIndex] = 0; + g_bHasDeagle[client] = false; } - - return Plugin_Continue; } -public Action ReviveSuccess_Event(Handle event, const char[] name, bool bDontBroadcast) +void ReviveSuccess_Event(Event hEvent, char[] name, bool dontBroadcast) { - if (GetConVarInt(g_hReplaceMagnum) < 1) { - return Plugin_Continue; - } + if (GetConVarInt(g_hReplaceMagnum) < 1) { return; } - int client = GetClientOfUserId(GetEventInt(event, "subject")); - int playerIndex = GetPlayerCharacter(client); + int client = GetClientOfUserId(hEvent.GetInt("subject")); #if DEBUG - CPrintToChatAll("client %d revived, player index %d, g_hasDeagle %d", client, playerIndex, g_hasDeagle[client]); + PrintToChatAll("client %d revived, g_bHasDeagle: %s", client, g_bHasDeagle[client] ? "True" : "False"); #endif - if (g_hasDeagle[playerIndex]) { + if (g_bHasDeagle[client]) { int secWeaponIndex = GetPlayerWeaponSlot(client, L4D2WeaponSlot_Secondary); RemovePlayerItem(client, secWeaponIndex); RemoveEntity(secWeaponIndex); GivePlayerItem(client, "weapon_pistol_magnum"); + g_bHasDeagle[client] = false; // Gets set on incap anywoo. } - - return Plugin_Continue; -} - -int GetPlayerCharacter(int client) -{ - int tmpChr = GetEntProp(client, Prop_Send, "m_survivorCharacter"); - - // use models when incorrect character returned - if (tmpChr < 0 || tmpChr >= MAX_SURVIVORS) { - char model[256]; - GetEntPropString(client, Prop_Data, "m_ModelName", model, sizeof(model)); - - if (StrContains(model, "gambler") != -1) { - tmpChr = 0; - } else if (StrContains(model, "coach") != -1) { - tmpChr = 2; - } else if (StrContains(model, "mechanic") != -1) { - tmpChr = 3; - } else if (StrContains(model, "producer") != -1) { - tmpChr = 1; - } else if (StrContains(model, "namvet") != -1) { - tmpChr = 0; - } else if (StrContains(model, "teengirl") != -1) { - tmpChr = 1; - } else if (StrContains(model, "biker") != -1) { - tmpChr = 3; - } else if (StrContains(model, "manager") != -1) { - tmpChr = 2; - } else { - tmpChr = 0; - } - } - - return tmpChr; }