diff --git a/addons/sourcemod/gamedata/fix_pill_pass.txt b/addons/sourcemod/gamedata/fix_pill_pass.txt new file mode 100644 index 000000000..dc0d3f768 --- /dev/null +++ b/addons/sourcemod/gamedata/fix_pill_pass.txt @@ -0,0 +1,82 @@ +"Games" +{ + "left4dead2" + { + "MemPatches" + { + /** + A1m`: + _ZN13CBaseBeltItem15SecondaryAttackEv + offset + + .text:0051566F E8 BC 5E 48 00 call _ZNK13CTerrorPlayer10IsInCombatEb ; CTerrorPlayer::IsInCombat(bool) + .text:00515674 84 C0 test al, al + .text:00515676 0F 85 8C 00 00 00 jnz loc_515708 + + .text:00515620 ; _DWORD __cdecl CBaseBeltItem::SecondaryAttack(CBaseBeltItem *__hidden this) + .text:00515620 _ZN13CBaseBeltItem15SecondaryAttackEv proc near + + 00515676 - jnz + 00515620 - address function + 00515676 - 00515620 + A1m`: + you need to overwrite the jz instruction and jump address + 00515676 - 00515620 = 86 offset + _ZN13CBaseBeltItem15SecondaryAttackEv + 86 + check bytes = 0F 85 + patch bytes + 0F 85 8C 00 00 00 = change to 90 90 90 90 90 90 + nop instructons + I think a different code is used for bots, it ends with name = actions (function name) + **/ + "IsInCombatPillPass" + { + "signature" "CBaseBeltItem::SecondaryAttack" + "linux" + { + "offset" "86" + "verify" "\x0F\x85" + "patch" "\x90\x90\x90\x90\x90\x90" + } + } + + /** + IA-NanaNana + **/ + "ItemGiveDistance" + { + "signature" "CBaseBeltItem::SecondaryAttack" + "linux" + { + "offset" "129" + "verify" "\xC7\x44" + "patch" "\xC7\x44\x24\x04\x00\x00\x80\x43" + } + } + } + + "Functions" + { + "CBaseBeltItem::SecondaryAttack" + { + "signature" "CBaseBeltItem::SecondaryAttack" + "callconv" "thiscall" + "return" "void" + "this" "entity" + } + } + + "Signatures" + { + "CBaseBeltItem::SecondaryAttack" + { + "library" "server" + "linux" "@_ZN13CBaseBeltItem15SecondaryAttackEv" + } + "CTerrorPlayer::IsInCombat" + { + "library" "server" + "linux" "@_ZNK13CTerrorPlayer10IsInCombatEb" + } + } + } +} \ No newline at end of file diff --git a/addons/sourcemod/gamedata/l4d2_allow_cs_weapons.txt b/addons/sourcemod/gamedata/l4d2_allow_cs_weapons.txt new file mode 100644 index 000000000..127c7d223 --- /dev/null +++ b/addons/sourcemod/gamedata/l4d2_allow_cs_weapons.txt @@ -0,0 +1,26 @@ +"Games" +{ + "left4dead2" + { + "Functions" + { + "CDirectorItemManager::AreCSWeaponsAllowed" + { + "signature" "CDirectorItemManager::AreCSWeaponsAllowed" + "callconv" "cdecl" + "return" "bool" + "this" "ignore" + } + } + + "Signatures" + { + "CDirectorItemManager::AreCSWeaponsAllowed" + { + "library" "server" + "linux" "@_ZN20CDirectorItemManager19AreCSWeaponsAllowedEv" + "windows" "\xE8\x2A\x2A\x2A\x2A\x85\xC0\x74\x15\x6A\x00\x68\x2A\x2A\x2A\x2A\x8B\xC8\xE8\x2A\x2A\x2A\x2A\x85\xC0\x74\x03\x32\xC0\xC3\xB0\x01\xC3" + } + } + } +} diff --git a/addons/sourcemod/plugins/confoglcompmod.smx b/addons/sourcemod/plugins/confoglcompmod.smx index d9a6b565d..afd4f5e43 100644 Binary files a/addons/sourcemod/plugins/confoglcompmod.smx and b/addons/sourcemod/plugins/confoglcompmod.smx differ diff --git a/addons/sourcemod/plugins/fixes/annoyance_exploit_fixes.smx b/addons/sourcemod/plugins/fixes/annoyance_exploit_fixes.smx index 2d0cb7da0..e64d6d8fe 100644 Binary files a/addons/sourcemod/plugins/fixes/annoyance_exploit_fixes.smx and b/addons/sourcemod/plugins/fixes/annoyance_exploit_fixes.smx differ diff --git a/addons/sourcemod/plugins/fixes/command_buffer.smx b/addons/sourcemod/plugins/fixes/command_buffer.smx index c8ec86f45..45f1bbbea 100644 Binary files a/addons/sourcemod/plugins/fixes/command_buffer.smx and b/addons/sourcemod/plugins/fixes/command_buffer.smx differ diff --git a/addons/sourcemod/plugins/fixes/l4d2_incap_fire_fix.smx b/addons/sourcemod/plugins/fixes/l4d2_incap_fire_fix.smx new file mode 100644 index 000000000..1bcb4e978 Binary files /dev/null and b/addons/sourcemod/plugins/fixes/l4d2_incap_fire_fix.smx differ diff --git a/addons/sourcemod/plugins/fixes/l4d_console_spam.smx b/addons/sourcemod/plugins/fixes/l4d_console_spam.smx index 0fcc40995..55843b657 100644 Binary files a/addons/sourcemod/plugins/fixes/l4d_console_spam.smx and b/addons/sourcemod/plugins/fixes/l4d_console_spam.smx differ diff --git a/addons/sourcemod/plugins/left4dhooks.smx b/addons/sourcemod/plugins/left4dhooks.smx index 7098ef465..41a6fe83e 100644 Binary files a/addons/sourcemod/plugins/left4dhooks.smx and b/addons/sourcemod/plugins/left4dhooks.smx differ diff --git a/addons/sourcemod/plugins/match_vote.smx b/addons/sourcemod/plugins/match_vote.smx index f46131c3c..1e16f1782 100644 Binary files a/addons/sourcemod/plugins/match_vote.smx and b/addons/sourcemod/plugins/match_vote.smx differ diff --git a/addons/sourcemod/plugins/optional/8ball.smx b/addons/sourcemod/plugins/optional/8ball.smx index 5dbd72401..89e13a349 100644 Binary files a/addons/sourcemod/plugins/optional/8ball.smx and b/addons/sourcemod/plugins/optional/8ball.smx differ diff --git a/addons/sourcemod/plugins/optional/MeleeInTheSafeRoom.smx b/addons/sourcemod/plugins/optional/MeleeInTheSafeRoom.smx index 08b71dca9..045960792 100644 Binary files a/addons/sourcemod/plugins/optional/MeleeInTheSafeRoom.smx and b/addons/sourcemod/plugins/optional/MeleeInTheSafeRoom.smx differ diff --git a/addons/sourcemod/plugins/optional/autopause.smx b/addons/sourcemod/plugins/optional/autopause.smx index bf0aa7ccb..516195044 100644 Binary files a/addons/sourcemod/plugins/optional/autopause.smx and b/addons/sourcemod/plugins/optional/autopause.smx differ diff --git a/addons/sourcemod/plugins/optional/caster_assister.smx b/addons/sourcemod/plugins/optional/caster_assister.smx index b0aa41d1e..641cf6650 100644 Binary files a/addons/sourcemod/plugins/optional/caster_assister.smx and b/addons/sourcemod/plugins/optional/caster_assister.smx differ diff --git a/addons/sourcemod/plugins/optional/caster_system.smx b/addons/sourcemod/plugins/optional/caster_system.smx index 5e1ffaff1..19fc51051 100644 Binary files a/addons/sourcemod/plugins/optional/caster_system.smx and b/addons/sourcemod/plugins/optional/caster_system.smx differ diff --git a/addons/sourcemod/plugins/optional/cfg_motd.smx b/addons/sourcemod/plugins/optional/cfg_motd.smx index ce6707c4f..e534674b1 100644 Binary files a/addons/sourcemod/plugins/optional/cfg_motd.smx and b/addons/sourcemod/plugins/optional/cfg_motd.smx differ diff --git a/addons/sourcemod/plugins/optional/changelog.smx b/addons/sourcemod/plugins/optional/changelog.smx index f8d51a1ca..65d7a0396 100644 Binary files a/addons/sourcemod/plugins/optional/changelog.smx and b/addons/sourcemod/plugins/optional/changelog.smx differ diff --git a/addons/sourcemod/plugins/optional/checkpoint-rage-control.smx b/addons/sourcemod/plugins/optional/checkpoint-rage-control.smx index da9122238..219f11a1d 100644 Binary files a/addons/sourcemod/plugins/optional/checkpoint-rage-control.smx and b/addons/sourcemod/plugins/optional/checkpoint-rage-control.smx differ diff --git a/addons/sourcemod/plugins/optional/code_patcher.smx b/addons/sourcemod/plugins/optional/code_patcher.smx index 486c905f1..562b77f36 100644 Binary files a/addons/sourcemod/plugins/optional/code_patcher.smx and b/addons/sourcemod/plugins/optional/code_patcher.smx differ diff --git a/addons/sourcemod/plugins/optional/current.smx b/addons/sourcemod/plugins/optional/current.smx index 973a9871f..f484a57dc 100644 Binary files a/addons/sourcemod/plugins/optional/current.smx and b/addons/sourcemod/plugins/optional/current.smx differ diff --git a/addons/sourcemod/plugins/optional/fix_pill_pass.smx b/addons/sourcemod/plugins/optional/fix_pill_pass.smx new file mode 100644 index 000000000..9deaf6b3f Binary files /dev/null and b/addons/sourcemod/plugins/optional/fix_pill_pass.smx differ diff --git a/addons/sourcemod/plugins/optional/holdout_bonus.smx b/addons/sourcemod/plugins/optional/holdout_bonus.smx index 14aea6964..dc49e8df5 100644 Binary files a/addons/sourcemod/plugins/optional/holdout_bonus.smx and b/addons/sourcemod/plugins/optional/holdout_bonus.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d2_allow_cs_weapons.smx b/addons/sourcemod/plugins/optional/l4d2_allow_cs_weapons.smx new file mode 100644 index 000000000..36be2de4a Binary files /dev/null and b/addons/sourcemod/plugins/optional/l4d2_allow_cs_weapons.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d2_character_fix.smx b/addons/sourcemod/plugins/optional/l4d2_character_fix.smx index 343b5f161..d0458a830 100644 Binary files a/addons/sourcemod/plugins/optional/l4d2_character_fix.smx and b/addons/sourcemod/plugins/optional/l4d2_character_fix.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d2_ghost_warp.smx b/addons/sourcemod/plugins/optional/l4d2_ghost_warp.smx index 1620045a2..d03d84ea7 100644 Binary files a/addons/sourcemod/plugins/optional/l4d2_ghost_warp.smx and b/addons/sourcemod/plugins/optional/l4d2_ghost_warp.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d2_horde_equaliser.smx b/addons/sourcemod/plugins/optional/l4d2_horde_equaliser.smx index ad5791f15..bcbd32c61 100644 Binary files a/addons/sourcemod/plugins/optional/l4d2_horde_equaliser.smx and b/addons/sourcemod/plugins/optional/l4d2_horde_equaliser.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d2_hybrid_scoremod.smx b/addons/sourcemod/plugins/optional/l4d2_hybrid_scoremod.smx index a19b3a61f..b48f0e95f 100644 Binary files a/addons/sourcemod/plugins/optional/l4d2_hybrid_scoremod.smx and b/addons/sourcemod/plugins/optional/l4d2_hybrid_scoremod.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d2_hybrid_scoremod_zone.smx b/addons/sourcemod/plugins/optional/l4d2_hybrid_scoremod_zone.smx index 6c6bd5a4d..5c600b65f 100644 Binary files a/addons/sourcemod/plugins/optional/l4d2_hybrid_scoremod_zone.smx and b/addons/sourcemod/plugins/optional/l4d2_hybrid_scoremod_zone.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d2_penalty_bonus.smx b/addons/sourcemod/plugins/optional/l4d2_penalty_bonus.smx index ab32281cb..3c20681be 100644 Binary files a/addons/sourcemod/plugins/optional/l4d2_penalty_bonus.smx and b/addons/sourcemod/plugins/optional/l4d2_penalty_bonus.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d2_playstats.smx b/addons/sourcemod/plugins/optional/l4d2_playstats.smx index 81d6ee425..dedf1f15c 100644 Binary files a/addons/sourcemod/plugins/optional/l4d2_playstats.smx and b/addons/sourcemod/plugins/optional/l4d2_playstats.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d2_setscores.smx b/addons/sourcemod/plugins/optional/l4d2_setscores.smx index ed4b65610..2f7e41d07 100644 Binary files a/addons/sourcemod/plugins/optional/l4d2_setscores.smx and b/addons/sourcemod/plugins/optional/l4d2_setscores.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d2_skill_detect.smx b/addons/sourcemod/plugins/optional/l4d2_skill_detect.smx index f6d0ac96c..5f3beab47 100644 Binary files a/addons/sourcemod/plugins/optional/l4d2_skill_detect.smx and b/addons/sourcemod/plugins/optional/l4d2_skill_detect.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d2_stats.smx b/addons/sourcemod/plugins/optional/l4d2_stats.smx index 43f085da5..7b7e48cc2 100644 Binary files a/addons/sourcemod/plugins/optional/l4d2_stats.smx and b/addons/sourcemod/plugins/optional/l4d2_stats.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d2_tank_announce.smx b/addons/sourcemod/plugins/optional/l4d2_tank_announce.smx index 62e6d7fe6..c001cebe0 100644 Binary files a/addons/sourcemod/plugins/optional/l4d2_tank_announce.smx and b/addons/sourcemod/plugins/optional/l4d2_tank_announce.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d2_tank_horde_monitor.smx b/addons/sourcemod/plugins/optional/l4d2_tank_horde_monitor.smx index b723001ae..66372c496 100644 Binary files a/addons/sourcemod/plugins/optional/l4d2_tank_horde_monitor.smx and b/addons/sourcemod/plugins/optional/l4d2_tank_horde_monitor.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d2_tankrage.smx b/addons/sourcemod/plugins/optional/l4d2_tankrage.smx index 795c378c9..a82f03e4a 100644 Binary files a/addons/sourcemod/plugins/optional/l4d2_tankrage.smx and b/addons/sourcemod/plugins/optional/l4d2_tankrage.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d_boss_percent.smx b/addons/sourcemod/plugins/optional/l4d_boss_percent.smx index e765f82ba..b381e1fbd 100644 Binary files a/addons/sourcemod/plugins/optional/l4d_boss_percent.smx and b/addons/sourcemod/plugins/optional/l4d_boss_percent.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d_boss_vote.smx b/addons/sourcemod/plugins/optional/l4d_boss_vote.smx index 696c43cc7..27d14daa4 100644 Binary files a/addons/sourcemod/plugins/optional/l4d_boss_vote.smx and b/addons/sourcemod/plugins/optional/l4d_boss_vote.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d_tank_control_eq.smx b/addons/sourcemod/plugins/optional/l4d_tank_control_eq.smx index d99b0ebde..aa5eaf04c 100644 Binary files a/addons/sourcemod/plugins/optional/l4d_tank_control_eq.smx and b/addons/sourcemod/plugins/optional/l4d_tank_control_eq.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d_weapon_limits.smx b/addons/sourcemod/plugins/optional/l4d_weapon_limits.smx index 8a80c57c8..cf783db2c 100644 Binary files a/addons/sourcemod/plugins/optional/l4d_weapon_limits.smx and b/addons/sourcemod/plugins/optional/l4d_weapon_limits.smx differ diff --git a/addons/sourcemod/plugins/optional/pause.smx b/addons/sourcemod/plugins/optional/pause.smx index 33bb445d1..ccf7c9085 100644 Binary files a/addons/sourcemod/plugins/optional/pause.smx and b/addons/sourcemod/plugins/optional/pause.smx differ diff --git a/addons/sourcemod/plugins/optional/playermanagement.smx b/addons/sourcemod/plugins/optional/playermanagement.smx index 0a249b40b..cbfd9a14c 100644 Binary files a/addons/sourcemod/plugins/optional/playermanagement.smx and b/addons/sourcemod/plugins/optional/playermanagement.smx differ diff --git a/addons/sourcemod/plugins/optional/ratemonitor.smx b/addons/sourcemod/plugins/optional/ratemonitor.smx index 139dee24b..2b5917c1d 100644 Binary files a/addons/sourcemod/plugins/optional/ratemonitor.smx and b/addons/sourcemod/plugins/optional/ratemonitor.smx differ diff --git a/addons/sourcemod/plugins/optional/readyup.smx b/addons/sourcemod/plugins/optional/readyup.smx index 99df81b2d..90c553253 100644 Binary files a/addons/sourcemod/plugins/optional/readyup.smx and b/addons/sourcemod/plugins/optional/readyup.smx differ diff --git a/addons/sourcemod/plugins/optional/si_class_announce.smx b/addons/sourcemod/plugins/optional/si_class_announce.smx index 23bdb3ae3..fd49ec9aa 100644 Binary files a/addons/sourcemod/plugins/optional/si_class_announce.smx and b/addons/sourcemod/plugins/optional/si_class_announce.smx differ diff --git a/addons/sourcemod/plugins/optional/slots_vote.smx b/addons/sourcemod/plugins/optional/slots_vote.smx index 59c5cbcbf..3219ed6b0 100644 Binary files a/addons/sourcemod/plugins/optional/slots_vote.smx and b/addons/sourcemod/plugins/optional/slots_vote.smx differ diff --git a/addons/sourcemod/plugins/optional/spechud.smx b/addons/sourcemod/plugins/optional/spechud.smx index d34d38cb1..c75d900f8 100644 Binary files a/addons/sourcemod/plugins/optional/spechud.smx and b/addons/sourcemod/plugins/optional/spechud.smx differ diff --git a/addons/sourcemod/plugins/optional/survivor_mvp.smx b/addons/sourcemod/plugins/optional/survivor_mvp.smx index 902990036..f44cfef8f 100644 Binary files a/addons/sourcemod/plugins/optional/survivor_mvp.smx and b/addons/sourcemod/plugins/optional/survivor_mvp.smx differ diff --git a/addons/sourcemod/plugins/optional/weapon_loadout_vote.smx b/addons/sourcemod/plugins/optional/weapon_loadout_vote.smx index 231ef8fbb..43b27cc18 100644 Binary files a/addons/sourcemod/plugins/optional/weapon_loadout_vote.smx and b/addons/sourcemod/plugins/optional/weapon_loadout_vote.smx differ diff --git a/addons/sourcemod/scripting/8ball.sp b/addons/sourcemod/scripting/8ball.sp index 7fa51035b..54cb71f42 100644 --- a/addons/sourcemod/scripting/8ball.sp +++ b/addons/sourcemod/scripting/8ball.sp @@ -9,7 +9,7 @@ public Plugin myinfo = name = "8Ball", description = "Simple 8Ball Game Plugin. Works the same as Coinflip / Dice Roll.", author = "spoon", - version = "1.3", + version = "1.3.1", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -21,6 +21,9 @@ public void OnPluginStart() Action Command_8ball(int iClient, int iArgs) { + if (!iClient || !IsClientInGame(iClient)) + return Plugin_Handled; + if (iArgs == 0) { CPrintToChat(iClient, "%t %t", "Tag", "Usage"); diff --git a/addons/sourcemod/scripting/MeleeInTheSafeRoom.sp b/addons/sourcemod/scripting/MeleeInTheSafeRoom.sp index f290f1232..1f02cdfee 100644 --- a/addons/sourcemod/scripting/MeleeInTheSafeRoom.sp +++ b/addons/sourcemod/scripting/MeleeInTheSafeRoom.sp @@ -1,369 +1,352 @@ #pragma semicolon 1 +#pragma newdecls required #include #include -#define VERSION "2.0.7" - -new Handle:g_hEnabled; -new Handle:g_hWeaponRandom; -new Handle:g_hWeaponRandomAmount; -new Handle:g_hWeaponBaseballBat; -new Handle:g_hWeaponCricketBat; -new Handle:g_hWeaponCrowbar; -new Handle:g_hWeaponElecGuitar; -new Handle:g_hWeaponFireAxe; -new Handle:g_hWeaponFryingPan; -new Handle:g_hWeaponGolfClub; -new Handle:g_hWeaponKnife; -new Handle:g_hWeaponKatana; -new Handle:g_hWeaponMachete; -new Handle:g_hWeaponRiotShield; -new Handle:g_hWeaponTonfa; - -new bool:g_bSpawnedMelee; - -new g_iMeleeClassCount = 0; -new g_iMeleeRandomSpawn[20]; -new g_iRound = 2; - -new String:g_sMeleeClass[16][32]; - -public Plugin:myinfo = +#define PLUGIN_VERSION "3.0" + +#define TEAM_SURVIVOR 2 + +#define MAX_MELEE_CLASSES 32 +#define MELEE_CLASS_LENGTH 64 +#define MAX_RANDOM_SPAWNS 32 + +// Custom-list weapons: string-table prefix to match, paired with its cvar name suffix. +static const char g_sCustomMeleeClass[][] = +{ + "baseball_bat", + "cricket_bat", + "crowbar", + "electric_guitar", + "fireaxe", + "frying_pan", + "golfclub", + "hunting_knife", + "katana", + "machete", + "riotshield", + "tonfa" +}; + +static const char g_sCustomMeleeCvarSuffix[][] = +{ + "BaseballBat", + "CricketBat", + "Crowbar", + "ElecGuitar", + "FireAxe", + "FryingPan", + "GolfClub", + "Knife", + "Katana", + "Machete", + "RiotShield", + "Tonfa" +}; + +static const char g_sPrecacheModels[][] = +{ + "models/weapons/melee/v_bat.mdl", + "models/weapons/melee/v_cricket_bat.mdl", + "models/weapons/melee/v_crowbar.mdl", + "models/weapons/melee/v_electric_guitar.mdl", + "models/weapons/melee/v_fireaxe.mdl", + "models/weapons/melee/v_frying_pan.mdl", + "models/weapons/melee/v_golfclub.mdl", + "models/weapons/melee/v_katana.mdl", + "models/weapons/melee/v_machete.mdl", + "models/weapons/melee/v_tonfa.mdl", + "models/weapons/melee/w_bat.mdl", + "models/weapons/melee/w_cricket_bat.mdl", + "models/weapons/melee/w_crowbar.mdl", + "models/weapons/melee/w_electric_guitar.mdl", + "models/weapons/melee/w_fireaxe.mdl", + "models/weapons/melee/w_frying_pan.mdl", + "models/weapons/melee/w_golfclub.mdl", + "models/weapons/melee/w_katana.mdl", + "models/weapons/melee/w_machete.mdl", + "models/weapons/melee/w_tonfa.mdl", + "models/w_models/weapons/w_sniper_scout.mdl", + "models/v_models/v_snip_scout.mdl" +}; + +static const char g_sPrecacheScripts[][] = +{ + "scripts/melee/baseball_bat.txt", + "scripts/melee/cricket_bat.txt", + "scripts/melee/crowbar.txt", + "scripts/melee/electric_guitar.txt", + "scripts/melee/fireaxe.txt", + "scripts/melee/frying_pan.txt", + "scripts/melee/golfclub.txt", + "scripts/melee/katana.txt", + "scripts/melee/machete.txt", + "scripts/melee/tonfa.txt" +}; + +ConVar + g_cvEnabled, + g_cvRandom, + g_cvRandomAmount, + g_cvCustomMeleeCount[sizeof(g_sCustomMeleeClass)], + g_cvGameMode; + +Handle g_hSpawnTimer; + +bool g_bSpawnedMelee; + +int g_iMeleeClassCount; +char g_sMeleeClass[MAX_MELEE_CLASSES][MELEE_CLASS_LENGTH]; + +// Random picks from the first half, replayed in the second half of a versus round +// so both teams get the same saferoom melee set. +int g_iSavedSpawns[MAX_RANDOM_SPAWNS]; +int g_iSavedSpawnCount; + +public Plugin myinfo = { - name = "Melee In The Saferoom", - author = "N3wton", - description = "Spawns a selection of melee weapons in the saferoom, at the start of each round.", - version = VERSION + name = "Melee In The Saferoom", + author = "N3wton", + description = "Spawns a selection of melee weapons in the saferoom, at the start of each round.", + version = PLUGIN_VERSION }; -public OnPluginStart() +public void OnPluginStart() +{ + if (GetEngineVersion() != Engine_Left4Dead2) { + SetFailState("Melee In The Saferoom is only supported on Left 4 Dead 2."); + } + + g_cvGameMode = FindConVar("mp_gamemode"); + + CreateConVar("l4d2_MITSR_Version", PLUGIN_VERSION, "The version of Melee In The Saferoom", FCVAR_NOTIFY | FCVAR_DONTRECORD); + g_cvEnabled = CreateConVar("l4d2_MITSR_Enabled", "1", "Should the plugin be enabled"); + g_cvRandom = CreateConVar("l4d2_MITSR_Random", "1", "Spawn Random Weapons (1) or custom list (0)"); + g_cvRandomAmount = CreateConVar("l4d2_MITSR_Amount", "8", "Number of weapons to spawn if l4d2_MITSR_Random is 1"); + + char sName[64], sDescription[128]; + for (int i = 0; i < sizeof(g_sCustomMeleeClass); i++) { + FormatEx(sName, sizeof(sName), "l4d2_MITSR_%s", g_sCustomMeleeCvarSuffix[i]); + FormatEx(sDescription, sizeof(sDescription), "Number of %s to spawn (l4d2_MITSR_Random must be 0)", g_sCustomMeleeClass[i]); + g_cvCustomMeleeCount[i] = CreateConVar(sName, "1", sDescription); + } + + HookEvent("round_start", Event_RoundStart); + + RegAdminCmd("sm_melee", Command_SMMelee, ADMFLAG_KICK, "Lists all melee weapons spawnable in the current campaign"); +} + +public void OnMapStart() +{ + g_hSpawnTimer = null; + g_bSpawnedMelee = false; + g_iMeleeClassCount = 0; + g_iSavedSpawnCount = 0; + + for (int i = 0; i < sizeof(g_sPrecacheModels); i++) { + PrecacheModel(g_sPrecacheModels[i], true); + } + + for (int i = 0; i < sizeof(g_sPrecacheScripts); i++) { + PrecacheGeneric(g_sPrecacheScripts[i], true); + } + + // NextMod hands out scouts through weapon customization; spawning one here + // forces the weapon into the precache table before any late conversion. + int iScout = CreateEntityByName("weapon_sniper_scout"); + if (iScout != -1) { + DispatchSpawn(iScout); + RemoveEdict(iScout); + } +} + +public void OnMapEnd() { - decl String:GameName[12]; - GetGameFolderName(GameName, sizeof(GameName)); - if( !StrEqual(GameName, "left4dead2") ) - SetFailState( "Melee In The Saferoom is only supported on left 4 dead 2." ); - - CreateConVar( "l4d2_MITSR_Version", VERSION, "The version of Melee In The Saferoom"); - g_hEnabled = CreateConVar( "l4d2_MITSR_Enabled", "1", "Should the plugin be enabled"); - g_hWeaponRandom = CreateConVar( "l4d2_MITSR_Random", "1", "Spawn Random Weapons (1) or custom list (0)"); - g_hWeaponRandomAmount = CreateConVar( "l4d2_MITSR_Amount", "8", "Number of weapons to spawn if l4d2_MITSR_Random is 1"); - g_hWeaponBaseballBat = CreateConVar( "l4d2_MITSR_BaseballBat", "1", "Number of baseball bats to spawn (l4d2_MITSR_Random must be 0)"); - g_hWeaponCricketBat = CreateConVar( "l4d2_MITSR_CricketBat", "1", "Number of cricket bats to spawn (l4d2_MITSR_Random must be 0)"); - g_hWeaponCrowbar = CreateConVar( "l4d2_MITSR_Crowbar", "1", "Number of crowbars to spawn (l4d2_MITSR_Random must be 0)"); - g_hWeaponElecGuitar = CreateConVar( "l4d2_MITSR_ElecGuitar", "1", "Number of electric guitars to spawn (l4d2_MITSR_Random must be 0)"); - g_hWeaponFireAxe = CreateConVar( "l4d2_MITSR_FireAxe", "1", "Number of fireaxes to spawn (l4d2_MITSR_Random must be 0)"); - g_hWeaponFryingPan = CreateConVar( "l4d2_MITSR_FryingPan", "1", "Number of frying pans to spawn (l4d2_MITSR_Random must be 0)"); - g_hWeaponGolfClub = CreateConVar( "l4d2_MITSR_GolfClub", "1", "Number of golf clubs to spawn (l4d2_MITSR_Random must be 0)"); - g_hWeaponKnife = CreateConVar( "l4d2_MITSR_Knife", "1", "Number of knifes to spawn (l4d2_MITSR_Random must be 0)"); - g_hWeaponKatana = CreateConVar( "l4d2_MITSR_Katana", "1", "Number of katanas to spawn (l4d2_MITSR_Random must be 0)"); - g_hWeaponMachete = CreateConVar( "l4d2_MITSR_Machete", "1", "Number of machetes to spawn (l4d2_MITSR_Random must be 0)"); - g_hWeaponRiotShield = CreateConVar( "l4d2_MITSR_RiotShield", "1", "Number of riot shields to spawn (l4d2_MITSR_Random must be 0)"); - g_hWeaponTonfa = CreateConVar( "l4d2_MITSR_Tonfa", "1", "Number of tonfas to spawn (l4d2_MITSR_Random must be 0)"); - - HookEvent( "round_start", Event_RoundStart ); - - RegAdminCmd("sm_melee", Command_SMMelee, ADMFLAG_KICK, "Lists all melee weapons spawnable in current campaign" ); + g_hSpawnTimer = null; } -Action:Command_SMMelee(client, args) +void Event_RoundStart(Event event, const char[] name, bool dontBroadcast) { - for( new i = 0; i < g_iMeleeClassCount; i++ ) - { - PrintToChat( client, "%d : %s", i, g_sMeleeClass[i] ); - } + if (!g_cvEnabled.BoolValue) { + return; + } + + g_bSpawnedMelee = false; + GetMeleeClasses(); + + delete g_hSpawnTimer; + g_hSpawnTimer = CreateTimer(1.0, Timer_SpawnMelee, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE); } -public OnMapStart() +Action Timer_SpawnMelee(Handle timer) { - PrecacheModel( "models/weapons/melee/v_bat.mdl", true ); - PrecacheModel( "models/weapons/melee/v_cricket_bat.mdl", true ); - PrecacheModel( "models/weapons/melee/v_crowbar.mdl", true ); - PrecacheModel( "models/weapons/melee/v_electric_guitar.mdl", true ); - PrecacheModel( "models/weapons/melee/v_fireaxe.mdl", true ); - PrecacheModel( "models/weapons/melee/v_frying_pan.mdl", true ); - PrecacheModel( "models/weapons/melee/v_golfclub.mdl", true ); - PrecacheModel( "models/weapons/melee/v_katana.mdl", true ); - PrecacheModel( "models/weapons/melee/v_machete.mdl", true ); - PrecacheModel( "models/weapons/melee/v_tonfa.mdl", true ); - - PrecacheModel( "models/weapons/melee/w_bat.mdl", true ); - PrecacheModel( "models/weapons/melee/w_cricket_bat.mdl", true ); - PrecacheModel( "models/weapons/melee/w_crowbar.mdl", true ); - PrecacheModel( "models/weapons/melee/w_electric_guitar.mdl", true ); - PrecacheModel( "models/weapons/melee/w_fireaxe.mdl", true ); - PrecacheModel( "models/weapons/melee/w_frying_pan.mdl", true ); - PrecacheModel( "models/weapons/melee/w_golfclub.mdl", true ); - PrecacheModel( "models/weapons/melee/w_katana.mdl", true ); - PrecacheModel( "models/weapons/melee/w_machete.mdl", true ); - PrecacheModel( "models/weapons/melee/w_tonfa.mdl", true ); - PrecacheModel( "models/w_models/weapons/w_sniper_scout.mdl"); - PrecacheModel( "models/v_models/v_snip_scout.mdl"); - - PrecacheGeneric( "scripts/melee/baseball_bat.txt", true ); - PrecacheGeneric( "scripts/melee/cricket_bat.txt", true ); - PrecacheGeneric( "scripts/melee/crowbar.txt", true ); - PrecacheGeneric( "scripts/melee/electric_guitar.txt", true ); - PrecacheGeneric( "scripts/melee/fireaxe.txt", true ); - PrecacheGeneric( "scripts/melee/frying_pan.txt", true ); - PrecacheGeneric( "scripts/melee/golfclub.txt", true ); - PrecacheGeneric( "scripts/melee/katana.txt", true ); - PrecacheGeneric( "scripts/melee/machete.txt", true ); - PrecacheGeneric( "scripts/melee/tonfa.txt", true ); - - new index = CreateEntityByName("weapon_sniper_scout"); - DispatchSpawn(index); - RemoveEdict(index); + if (g_bSpawnedMelee) { + g_hSpawnTimer = null; + return Plugin_Stop; + } + + if (g_iMeleeClassCount == 0) { + GetMeleeClasses(); + if (g_iMeleeClassCount == 0) { + return Plugin_Continue; + } + } + + int iClient = GetAnySurvivor(); + if (iClient == 0) { + return Plugin_Continue; + } + + float fPosition[3], fAngle[3]; + GetClientAbsOrigin(iClient, fPosition); + fPosition[2] += 20.0; + fAngle[0] = 90.0; + + if (g_cvRandom.BoolValue) { + SpawnRandomList(fPosition, fAngle); + } else { + SpawnCustomList(fPosition, fAngle); + } + + g_bSpawnedMelee = true; + g_hSpawnTimer = null; + return Plugin_Stop; } -Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast) +Action Command_SMMelee(int client, int args) { - if( !GetConVarBool( g_hEnabled ) ) return Plugin_Continue; - - g_bSpawnedMelee = false; - - if( g_iRound == 2 && IsVersus() ) g_iRound = 1; else g_iRound = 2; - - GetMeleeClasses(); - - CreateTimer( 1.0, Timer_SpawnMelee ); - - return Plugin_Continue; + if (g_iMeleeClassCount == 0) { + GetMeleeClasses(); + } + + ReplyToCommand(client, "[MITSR] %d melee classes available:", g_iMeleeClassCount); + for (int i = 0; i < g_iMeleeClassCount; i++) { + ReplyToCommand(client, "%d : %s", i, g_sMeleeClass[i]); + } + + return Plugin_Handled; } -Action:Timer_SpawnMelee( Handle:timer ) +void SpawnRandomList(const float fPosition[3], const float fAngle[3]) { - new client = GetInGameClient(); - - if( client != 0 && !g_bSpawnedMelee ) - { - decl Float:SpawnPosition[3], Float:SpawnAngle[3]; - GetClientAbsOrigin( client, SpawnPosition ); - SpawnPosition[2] += 20; SpawnAngle[0] = 90.0; - - if( GetConVarBool( g_hWeaponRandom ) ) - { - new i = 0; - while( i < GetConVarInt( g_hWeaponRandomAmount ) ) - { - new RandomMelee = GetRandomInt( 0, g_iMeleeClassCount-1 ); - if( IsVersus() && g_iRound == 2 ) RandomMelee = g_iMeleeRandomSpawn[i]; - SpawnMelee( g_sMeleeClass[RandomMelee], SpawnPosition, SpawnAngle ); - if( IsVersus() && g_iRound == 1 ) g_iMeleeRandomSpawn[i] = RandomMelee; - i++; - } - g_bSpawnedMelee = true; - } - else - { - SpawnCustomList( SpawnPosition, SpawnAngle ); - g_bSpawnedMelee = true; - } - } - else - { - if( !g_bSpawnedMelee ) CreateTimer( 1.0, Timer_SpawnMelee ); - } + if (IsVersus() && InSecondHalfOfRound() && g_iSavedSpawnCount > 0) { + for (int i = 0; i < g_iSavedSpawnCount; i++) { + SpawnMelee(g_sMeleeClass[g_iSavedSpawns[i]], fPosition, fAngle); + } + return; + } + + int iAmount = g_cvRandomAmount.IntValue; + if (iAmount > MAX_RANDOM_SPAWNS) { + iAmount = MAX_RANDOM_SPAWNS; + } + + g_iSavedSpawnCount = 0; + + for (int i = 0; i < iAmount; i++) { + int iPick = GetRandomInt(0, g_iMeleeClassCount - 1); + SpawnMelee(g_sMeleeClass[iPick], fPosition, fAngle); + g_iSavedSpawns[g_iSavedSpawnCount++] = iPick; + } } -stock SpawnCustomList( Float:Position[3], Float:Angle[3] ) +void SpawnCustomList(const float fPosition[3], const float fAngle[3]) { - decl String:ScriptName[32]; - - //Spawn Basseball Bats - if( GetConVarInt( g_hWeaponBaseballBat ) > 0 ) - { - for( new i = 0; i < GetConVarInt( g_hWeaponBaseballBat ); i++ ) - { - GetScriptName( "baseball_bat", ScriptName ); - SpawnMelee( ScriptName, Position, Angle ); - } - } - - //Spawn Cricket Bats - if( GetConVarInt( g_hWeaponCricketBat ) > 0 ) - { - for( new i = 0; i < GetConVarInt( g_hWeaponCricketBat ); i++ ) - { - GetScriptName( "cricket_bat", ScriptName ); - SpawnMelee( ScriptName, Position, Angle ); - } - } - - //Spawn Crowbars - if( GetConVarInt( g_hWeaponCrowbar ) > 0 ) - { - for( new i = 0; i < GetConVarInt( g_hWeaponCrowbar ); i++ ) - { - GetScriptName( "crowbar", ScriptName ); - SpawnMelee( ScriptName, Position, Angle ); - } - } - - //Spawn Electric Guitars - if( GetConVarInt( g_hWeaponElecGuitar ) > 0 ) - { - for( new i = 0; i < GetConVarInt( g_hWeaponElecGuitar ); i++ ) - { - GetScriptName( "electric_guitar", ScriptName ); - SpawnMelee( ScriptName, Position, Angle ); - } - } - - //Spawn Fireaxes - if( GetConVarInt( g_hWeaponFireAxe ) > 0 ) - { - for( new i = 0; i < GetConVarInt( g_hWeaponFireAxe ); i++ ) - { - GetScriptName( "fireaxe", ScriptName ); - SpawnMelee( ScriptName, Position, Angle ); - } - } - - //Spawn Frying Pans - if( GetConVarInt( g_hWeaponFryingPan ) > 0 ) - { - for( new i = 0; i < GetConVarInt( g_hWeaponFryingPan ); i++ ) - { - GetScriptName( "frying_pan", ScriptName ); - SpawnMelee( ScriptName, Position, Angle ); - } - } - - //Spawn Golfclubs - if( GetConVarInt( g_hWeaponGolfClub ) > 0 ) - { - for( new i = 0; i < GetConVarInt( g_hWeaponGolfClub ); i++ ) - { - GetScriptName( "golfclub", ScriptName ); - SpawnMelee( ScriptName, Position, Angle ); - } - } - - //Spawn Knifes - if( GetConVarInt( g_hWeaponKnife ) > 0 ) - { - for( new i = 0; i < GetConVarInt( g_hWeaponKnife ); i++ ) - { - GetScriptName( "hunting_knife", ScriptName ); - SpawnMelee( ScriptName, Position, Angle ); - } - } - - //Spawn Katanas - if( GetConVarInt( g_hWeaponKatana ) > 0 ) - { - for( new i = 0; i < GetConVarInt( g_hWeaponKatana ); i++ ) - { - GetScriptName( "katana", ScriptName ); - SpawnMelee( ScriptName, Position, Angle ); - } - } - - //Spawn Machetes - if( GetConVarInt( g_hWeaponMachete ) > 0 ) - { - for( new i = 0; i < GetConVarInt( g_hWeaponMachete ); i++ ) - { - GetScriptName( "machete", ScriptName ); - SpawnMelee( ScriptName, Position, Angle ); - } - } - - //Spawn RiotShields - if( GetConVarInt( g_hWeaponRiotShield ) > 0 ) - { - for( new i = 0; i < GetConVarInt( g_hWeaponRiotShield ); i++ ) - { - GetScriptName( "riotshield", ScriptName ); - SpawnMelee( ScriptName, Position, Angle ); - } - } - - //Spawn Tonfas - if( GetConVarInt( g_hWeaponTonfa ) > 0 ) - { - for( new i = 0; i < GetConVarInt( g_hWeaponTonfa ); i++ ) - { - GetScriptName( "tonfa", ScriptName ); - SpawnMelee( ScriptName, Position, Angle ); - } - } + char sScriptName[MELEE_CLASS_LENGTH]; + + for (int i = 0; i < sizeof(g_sCustomMeleeClass); i++) { + int iCount = g_cvCustomMeleeCount[i].IntValue; + if (iCount < 1) { + continue; + } + + // Skip weapons the current campaign doesn't offer instead of + // substituting an arbitrary entry from the string table. + if (!GetScriptName(g_sCustomMeleeClass[i], sScriptName, sizeof(sScriptName))) { + continue; + } + + for (int j = 0; j < iCount; j++) { + SpawnMelee(sScriptName, fPosition, fAngle); + } + } } -stock SpawnMelee( const String:Class[32], Float:Position[3], Float:Angle[3] ) +void SpawnMelee(const char[] sScriptName, const float fBasePosition[3], const float fBaseAngle[3]) { - decl Float:SpawnPosition[3], Float:SpawnAngle[3]; - SpawnPosition = Position; - SpawnAngle = Angle; - - SpawnPosition[0] += ( -10 + GetRandomInt( 0, 20 ) ); - SpawnPosition[1] += ( -10 + GetRandomInt( 0, 20 ) ); - SpawnPosition[2] += GetRandomInt( 0, 10 ); - SpawnAngle[1] = GetRandomFloat( 0.0, 360.0 ); - - new MeleeSpawn = CreateEntityByName( "weapon_melee" ); - DispatchKeyValue( MeleeSpawn, "melee_script_name", Class ); - DispatchSpawn( MeleeSpawn ); - TeleportEntity(MeleeSpawn, SpawnPosition, SpawnAngle, NULL_VECTOR ); + float fPosition[3], fAngle[3]; + fPosition = fBasePosition; + fAngle = fBaseAngle; + + fPosition[0] += GetRandomFloat(-10.0, 10.0); + fPosition[1] += GetRandomFloat(-10.0, 10.0); + fPosition[2] += GetRandomFloat(0.0, 10.0); + fAngle[1] = GetRandomFloat(0.0, 360.0); + + int iMelee = CreateEntityByName("weapon_melee"); + if (iMelee == -1) { + return; + } + + DispatchKeyValue(iMelee, "melee_script_name", sScriptName); + DispatchSpawn(iMelee); + TeleportEntity(iMelee, fPosition, fAngle, NULL_VECTOR); } -stock SpawnScout(Float:Position[3], Float:Angle[3]) +void GetMeleeClasses() { - decl Float:SpawnPosition[3], Float:SpawnAngle[3]; - SpawnPosition = Position; - SpawnAngle = Angle; - - SpawnPosition[0] += ( -10 + GetRandomInt( 0, 20 ) ); - SpawnPosition[1] += ( -10 + GetRandomInt( 0, 20 ) ); - SpawnPosition[2] += GetRandomInt( 0, 10 ); - SpawnAngle[1] = GetRandomFloat( 0.0, 360.0 ); - - new Spawn = CreateEntityByName("weapon_sniper_scout"); - DispatchSpawn(Spawn); - TeleportEntity(Spawn, SpawnPosition, SpawnAngle, NULL_VECTOR ); + g_iMeleeClassCount = 0; + + int iTable = FindStringTable("MeleeWeapons"); + if (iTable == INVALID_STRING_TABLE) { + return; + } + + int iCount = GetStringTableNumStrings(iTable); + if (iCount > MAX_MELEE_CLASSES) { + iCount = MAX_MELEE_CLASSES; + } + + for (int i = 0; i < iCount; i++) { + ReadStringTable(iTable, i, g_sMeleeClass[i], MELEE_CLASS_LENGTH); + } + + g_iMeleeClassCount = iCount; } -stock GetMeleeClasses() +bool GetScriptName(const char[] sClass, char[] sScriptName, int iLength) { - new MeleeStringTable = FindStringTable( "MeleeWeapons" ); - g_iMeleeClassCount = GetStringTableNumStrings( MeleeStringTable ); - - for( new i = 0; i < g_iMeleeClassCount; i++ ) - { - ReadStringTable( MeleeStringTable, i, g_sMeleeClass[i], 32 ); - } + for (int i = 0; i < g_iMeleeClassCount; i++) { + if (StrContains(g_sMeleeClass[i], sClass, false) == 0) { + strcopy(sScriptName, iLength, g_sMeleeClass[i]); + return true; + } + } + + return false; } -stock GetScriptName( const String:Class[32], String:ScriptName[32] ) +int GetAnySurvivor() { - for( new i = 0; i < g_iMeleeClassCount; i++ ) - { - if( StrContains( g_sMeleeClass[i], Class, false ) == 0 ) - { - Format( ScriptName, 32, "%s", g_sMeleeClass[i] ); - return; - } - } - Format( ScriptName, 32, "%s", g_sMeleeClass[0] ); + for (int i = 1; i <= MaxClients; i++) { + if (IsClientInGame(i) && GetClientTeam(i) == TEAM_SURVIVOR && IsPlayerAlive(i)) { + return i; + } + } + + return 0; } -stock GetInGameClient() +bool InSecondHalfOfRound() { - for( new x = 1; x <= GetClientCount( true ); x++ ) - { - if( IsClientInGame( x ) && GetClientTeam( x ) == 2 ) - { - return x; - } - } - return 0; + return view_as(GameRules_GetProp("m_bInSecondHalfOfRound")); } -stock bool:IsVersus() +bool IsVersus() { - new String:GameMode[32]; - GetConVarString( FindConVar( "mp_gamemode" ), GameMode, 32 ); - if( StrContains( GameMode, "versus", false ) != -1 ) return true; - return false; -} \ No newline at end of file + char sGameMode[32]; + g_cvGameMode.GetString(sGameMode, sizeof(sGameMode)); + + return StrContains(sGameMode, "versus", false) != -1; +} diff --git a/addons/sourcemod/scripting/annoyance_exploit_fixes.sp b/addons/sourcemod/scripting/annoyance_exploit_fixes.sp index 27aa4ffdd..1686b7339 100644 --- a/addons/sourcemod/scripting/annoyance_exploit_fixes.sp +++ b/addons/sourcemod/scripting/annoyance_exploit_fixes.sp @@ -33,15 +33,14 @@ public Plugin myinfo = name = "[L4D2] Annoyance/Exploit Fixes", author = "Sir", description = "A compilation of 'fixes' to deal with annoyances and exploits.", - version = "0.2", - url = "" + version = "0.2.1", + url = "https://github.com/SirPlease/L4D2-Competitive-Rework" } public void OnPluginStart() { LoadTranslations("annoyance_exploit_fixes.phrases"); - // Command Listener AddCommandListener(Listener_CallVote, "callvote"); } @@ -92,7 +91,7 @@ Action Listener_CallVote(int client, const char[] command, int argc) { int target = GetClientOfUserId(StringToInt(sVoteArgument)); - if (!target) + if (!target || !IsClientInGame(target)) return Plugin_Handled; // Block kickvotes not aimed at players in the same team. diff --git a/addons/sourcemod/scripting/autopause.sp b/addons/sourcemod/scripting/autopause.sp index fbd289908..cc15ad040 100644 --- a/addons/sourcemod/scripting/autopause.sp +++ b/addons/sourcemod/scripting/autopause.sp @@ -39,7 +39,7 @@ public Plugin myinfo = name = "L4D2 Auto-pause", author = "Darkid, Griffin, StarterX4, Forgetest, J.", description = "When a player disconnects due to crash, automatically pause the game. When they rejoin, give them a correct spawn timer.", - version = "2.4", + version = "2.4.1", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" } @@ -118,7 +118,7 @@ public void OnClientPutInServer(int client) if (convarDebug.BoolValue) { - Format(sDebugMessage, sizeof(sDebugMessage), "[Autopause (OnClientPutInServer)] Crashed Player %s rejoined.", sAuthId); + FormatEx(sDebugMessage, sizeof(sDebugMessage), "[Autopause (OnClientPutInServer)] Crashed Player %s rejoined.", sAuthId); DebugLog(sDebugMessage); } @@ -131,7 +131,7 @@ public void OnClientPutInServer(int client) if (convarDebug.BoolValue) { - Format(sDebugMessage, sizeof(sDebugMessage), "[Autopause (OnClientPutInServer)] All crashed players rejoined. Force Unpause was triggered."); + strcopy(sDebugMessage, sizeof(sDebugMessage), "[Autopause (OnClientPutInServer)] All crashed players rejoined. Force Unpause was triggered."); DebugLog(sDebugMessage); } } @@ -186,7 +186,7 @@ void Event_PlayerTeam(Event hEvent, char[] sEventName, bool dontBroadcast) if (convarDebug.BoolValue) { - Format(sDebugMessage, sizeof(sDebugMessage), "[AutoPause (%s)] Added player %s to the survivor team.", sEventName, sAuthId); + FormatEx(sDebugMessage, sizeof(sDebugMessage), "[AutoPause (%s)] Added player %s to the survivor team.", sEventName, sAuthId); DebugLog(sDebugMessage); } } @@ -201,7 +201,7 @@ void Event_PlayerTeam(Event hEvent, char[] sEventName, bool dontBroadcast) if (convarDebug.BoolValue) { - Format(sDebugMessage, sizeof(sDebugMessage), "[AutoPause (%s)] Player %s rejoined the infected, set spawn timer to %f.", sEventName, sAuthId, fSpawnTime); + FormatEx(sDebugMessage, sizeof(sDebugMessage), "[AutoPause (%s)] Player %s rejoined the infected, set spawn timer to %f.", sEventName, sAuthId, fSpawnTime); DebugLog(sDebugMessage); } } @@ -210,7 +210,7 @@ void Event_PlayerTeam(Event hEvent, char[] sEventName, bool dontBroadcast) if (convarDebug.BoolValue) { - Format(sDebugMessage, sizeof(sDebugMessage), "[AutoPause (%s)] Added player %s to the infected team.", sEventName, sAuthId); + FormatEx(sDebugMessage, sizeof(sDebugMessage), "[AutoPause (%s)] Added player %s to the infected team.", sEventName, sAuthId); DebugLog(sDebugMessage); } } @@ -220,7 +220,7 @@ void Event_PlayerTeam(Event hEvent, char[] sEventName, bool dontBroadcast) if (convarDebug.BoolValue) { - Format(sDebugMessage, sizeof(sDebugMessage), "[AutoPause (%s)] Removed player %s from the %s team.", sEventName, sAuthId, newTeam == L4D_TEAM_SURVIVOR ? "survivor" : "infected"); + FormatEx(sDebugMessage, sizeof(sDebugMessage), "[AutoPause (%s)] Removed player %s from the %s team.", sEventName, sAuthId, newTeam == L4D_TEAM_SURVIVOR ? "survivor" : "infected"); DebugLog(sDebugMessage); } } @@ -246,7 +246,7 @@ void Event_PlayerDisconnect(Event hEvent, char[] sEventName, bool dontBroadcast) { if (convarDebug.BoolValue) { - Format(sDebugMessage, sizeof(sDebugMessage), "[AutoPause (%s)] Player %N left the game but is a dead Survivor", sEventName, client); + FormatEx(sDebugMessage, sizeof(sDebugMessage), "[AutoPause (%s)] Player %N left the game but is a dead Survivor", sEventName, client); DebugLog(sDebugMessage); } return; @@ -256,11 +256,11 @@ void Event_PlayerDisconnect(Event hEvent, char[] sEventName, bool dontBroadcast) hEvent.GetString("reason", sReason, sizeof(sReason)); char sTimedOut[64]; - Format(sTimedOut, sizeof(sTimedOut), "%N timed out", client); + FormatEx(sTimedOut, sizeof(sTimedOut), "%N timed out", client); if (convarDebug.BoolValue) { - Format(sDebugMessage, sizeof(sDebugMessage), "[AutoPause (%s)] Player %N (%s) left the game: %s", sEventName, client, sAuthId, sReason); + FormatEx(sDebugMessage, sizeof(sDebugMessage), "[AutoPause (%s)] Player %N (%s) left the game: %s", sEventName, client, sAuthId, sReason); DebugLog(sDebugMessage); } @@ -289,7 +289,7 @@ void Event_PlayerDisconnect(Event hEvent, char[] sEventName, bool dontBroadcast) { if (convarDebug.BoolValue) { - Format(sDebugMessage, sizeof(sDebugMessage), "[AutoPause (%s)] Player %s left the game with %f time until spawn.", sEventName, sAuthId, fTimeLeft); + FormatEx(sDebugMessage, sizeof(sDebugMessage), "[AutoPause (%s)] Player %s left the game with %f time until spawn.", sEventName, sAuthId, fTimeLeft); DebugLog(sDebugMessage); } diff --git a/addons/sourcemod/scripting/caster_assister.sp b/addons/sourcemod/scripting/caster_assister.sp index ee6d72df9..08455b51f 100644 --- a/addons/sourcemod/scripting/caster_assister.sp +++ b/addons/sourcemod/scripting/caster_assister.sp @@ -14,7 +14,7 @@ public Plugin myinfo = name = "Caster Assister", author = "CanadaRox, Sir, Forgetest", description = "Allows spectators to control their own specspeed and move vertically", - version = "2.3", + version = "2.3.1", url = "" }; @@ -74,7 +74,7 @@ void PlayerTeam_Event(Event event, const char[] name, bool dontBroadcast) Action SetSpecspeed_Cmd(int client, int args) { - if (GetClientTeam(client) != 1) + if (!IsValidClient(client) || GetClientTeam(client) != 1) { return Plugin_Handled; } @@ -96,7 +96,7 @@ Action SetSpecspeed_Cmd(int client, int args) Action SetSpecspeedIncrement_Cmd(int client, int args) { - if (GetClientTeam(client) != 1) + if (!IsValidClient(client) || GetClientTeam(client) != 1) { return Plugin_Handled; } @@ -114,7 +114,7 @@ Action SetSpecspeedIncrement_Cmd(int client, int args) Action IncreaseSpecspeed_Cmd(int client, int args) { - if (GetClientTeam(client) != 1) + if (!IsValidClient(client) || GetClientTeam(client) != 1) { return Plugin_Handled; } @@ -125,7 +125,7 @@ Action IncreaseSpecspeed_Cmd(int client, int args) Action DecreaseSpecspeed_Cmd(int client, int args) { - if (GetClientTeam(client) != 1) + if (!IsValidClient(client) || GetClientTeam(client) != 1) { return Plugin_Handled; } @@ -145,7 +145,7 @@ stock void IncreaseSpecspeed(int client, float difference) Action SetVerticalIncrement_Cmd(int client, int args) { - if (GetClientTeam(client) != 1) + if (!IsValidClient(client) || GetClientTeam(client) != 1) { return Plugin_Handled; } diff --git a/addons/sourcemod/scripting/caster_system.sp b/addons/sourcemod/scripting/caster_system.sp index 4499c0039..44d96b2d6 100644 --- a/addons/sourcemod/scripting/caster_system.sp +++ b/addons/sourcemod/scripting/caster_system.sp @@ -6,7 +6,7 @@ #pragma semicolon 1 #pragma newdecls required -#define PLUGIN_VERSION "1.0" +#define PLUGIN_VERSION "1.0.1" public Plugin myinfo = { @@ -214,7 +214,7 @@ Action CasterCheck(Handle timer, int userid) Action Cast_Cmd(int client, int args) { - if (!client) return Plugin_Continue; + if (!client || !IsClientInGame(client)) return Plugin_Continue; char buffer[64]; GetClientAuthId(client, AuthId_Steam2, buffer, sizeof(buffer)); @@ -283,15 +283,20 @@ Action Caster_Cmd(int client, int args) Action NotCasting_Cmd(int client, int args) { + if (!client) return Plugin_Continue; + char buffer[64]; - + if (args < 1) // If no target is specified, assumes self-uncasting { GetClientAuthId(client, AuthId_Steam2, buffer, sizeof(buffer)); if (casterTrie.Remove(buffer)) { - CPrintToChat(client, "%t", "Reconnect1"); - CPrintToChat(client, "%t", "Reconnect2"); + if (IsClientInGame(client)) + { + CPrintToChat(client, "%t", "Reconnect1"); + CPrintToChat(client, "%t", "Reconnect2"); + } Call_StartForward(g_hFWD_CasterUnregistered); Call_PushCell(client); @@ -420,14 +425,14 @@ Action PrintCasters_Cmd(int client, int args) Action KickSpecs_Cmd(int client, int args) { - AdminId id = GetUserAdmin(client); - if (id != INVALID_ADMIN_ID && GetAdminFlag(id, Admin_Ban)) // Check for specific admin flag + AdminId id = client ? GetUserAdmin(client) : INVALID_ADMIN_ID; + if (!client || (id != INVALID_ADMIN_ID && GetAdminFlag(id, Admin_Ban))) // Console (client 0) has full authority; otherwise check for specific admin flag { CreateTimer(2.0, Timer_KickSpecs); CPrintToChatAll("%t", "KickSpecsAdmin", client); return Plugin_Handled; } - + // Filter spectator if (GetClientTeam(client) == L4D2Team_Spectator) { diff --git a/addons/sourcemod/scripting/cfg_motd.sp b/addons/sourcemod/scripting/cfg_motd.sp index df7456f4b..7df54d7d6 100644 --- a/addons/sourcemod/scripting/cfg_motd.sp +++ b/addons/sourcemod/scripting/cfg_motd.sp @@ -11,7 +11,7 @@ public Plugin:myinfo = name = "Config Description", author = "Visor", description = "Displays a descriptive MOTD on desire", - version = "0.2", + version = "0.2.1", url = "https://github.com/Attano/smplugins" }; @@ -24,12 +24,16 @@ public OnPluginStart() RegConsoleCmd("sm_cfg", ShowMOTD, "Show a MOTD describing the current config"); } -Action:ShowMOTD(client, args) +Action:ShowMOTD(client, args) { + if (!client || !IsClientInGame(client)) + return Plugin_Handled; + decl String:title[64], String:url[192]; - + GetConVarString(hCvarMotdTitle, title, sizeof(title)); GetConVarString(hCvarMotdUrl, url, sizeof(url)); - + ShowMOTDPanel(client, title, url, MOTDPANEL_TYPE_URL); + return Plugin_Handled; } \ No newline at end of file diff --git a/addons/sourcemod/scripting/changelog.sp b/addons/sourcemod/scripting/changelog.sp index a3c16e8d1..2488c40f5 100644 --- a/addons/sourcemod/scripting/changelog.sp +++ b/addons/sourcemod/scripting/changelog.sp @@ -8,8 +8,8 @@ public Plugin:myinfo = name = "L4D2 Change Log Command", description = "Does things :)", author = "Spoon", - version = "3.0.5", - url = "https://github.com/spoon-l4d2/" + version = "3.0.6", + url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; new Handle:linkCVar; @@ -22,7 +22,11 @@ public OnPluginStart() Action:ChangeLog_CMD(client, args) { + if (!client || !IsClientInGame(client)) + return Plugin_Handled; + new String:link[128]; GetConVarString(linkCVar, link, sizeof(link)); CPrintToChat(client, "{blue}[{green}ChangeLog{blue}]{default} You can view the change log @ {blue}%s", link); + return Plugin_Handled; } \ No newline at end of file diff --git a/addons/sourcemod/scripting/checkpoint-rage-control.sp b/addons/sourcemod/scripting/checkpoint-rage-control.sp index 37a59e3eb..b468b45f3 100644 --- a/addons/sourcemod/scripting/checkpoint-rage-control.sp +++ b/addons/sourcemod/scripting/checkpoint-rage-control.sp @@ -58,7 +58,7 @@ public Plugin myinfo = name = "Checkpoint Rage Control", author = "ProdigySim, Visor", description = "Enable tank to lose rage while survivors are in saferoom", - version = "0.3.1", + version = "0.3.2", url = "https://github.com/Attano/L4D2-Competitive-Framework" } @@ -348,7 +348,7 @@ void LoadTranslation(const char[] translation) sPath[PLATFORM_MAX_PATH], sName[64]; - Format(sName, sizeof(sName), "translations/%s.txt", translation); + FormatEx(sName, sizeof(sName), "translations/%s.txt", translation); BuildPath(Path_SM, sPath, sizeof(sPath), sName); if (!FileExists(sPath)) SetFailState("Missing translation file %s.txt", translation); diff --git a/addons/sourcemod/scripting/code_patcher.sp b/addons/sourcemod/scripting/code_patcher.sp index 277b69ce3..8b103d78c 100644 --- a/addons/sourcemod/scripting/code_patcher.sp +++ b/addons/sourcemod/scripting/code_patcher.sp @@ -21,7 +21,7 @@ public Plugin myinfo = { name = "Code patcher", author = "Jahze?, A1m`", - version = "1.1", + version = "1.1.1", description = "Code patcher", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -122,7 +122,7 @@ Action CodePatchPatchCommand(int args) char key[MAX_PATCH_NAME_LENGTH + 32]; char value[MAX_VALUE_LENGTH + 1]; - Format(key, sizeof(key), "%s_signature", name); + FormatEx(key, sizeof(key), "%s_signature", name); if (!GameConfGetKeyValue(hGameConfig, key, value, sizeof(value))) { PrintToServer("Could not find key '%s'", key); return Plugin_Handled; @@ -134,7 +134,7 @@ Action CodePatchPatchCommand(int args) return Plugin_Handled; } - Format(key, sizeof(key), "%s_offset", name); + FormatEx(key, sizeof(key), "%s_offset", name); if (!GameConfGetKeyValue(hGameConfig, key, value, sizeof(value))) { PrintToServer("Could not find key '%s'", key); return Plugin_Handled; @@ -146,7 +146,7 @@ Action CodePatchPatchCommand(int args) return Plugin_Handled; } - Format(key, sizeof(key), "%s_length_%s", name, (bIsWindows) ? "windows" : "linux"); + FormatEx(key, sizeof(key), "%s_length_%s", name, (bIsWindows) ? "windows" : "linux"); if (!GameConfGetKeyValue(hGameConfig, key, value, sizeof(value))) { PrintToServer("Could not find key '%s'", key); return Plugin_Handled; @@ -159,7 +159,7 @@ Action CodePatchPatchCommand(int args) return Plugin_Handled; } - Format(key, sizeof(key), "%s_bytes_%s", name, (bIsWindows) ? "windows" : "linux"); + FormatEx(key, sizeof(key), "%s_bytes_%s", name, (bIsWindows) ? "windows" : "linux"); if (!GameConfGetKeyValue(hGameConfig, key, value, sizeof(value))) { PrintToServer("Could not find key '%s'", key); diff --git a/addons/sourcemod/scripting/command_buffer.sp b/addons/sourcemod/scripting/command_buffer.sp index 73f78816a..dd74d98ab 100644 --- a/addons/sourcemod/scripting/command_buffer.sp +++ b/addons/sourcemod/scripting/command_buffer.sp @@ -18,7 +18,7 @@ -#define PLUGIN_VERSION "2.9" +#define PLUGIN_VERSION "2.9.1" /*====================================================================================== Plugin Info: @@ -146,7 +146,7 @@ public void OnPluginStart() char cvar[64]; for( int i = 0; i < MAX_CVARS; i++ ) { - Format(cvar, sizeof(cvar), "sm_cvar_test_%d", i); + FormatEx(cvar, sizeof(cvar), "sm_cvar_test_%d", i); CreateConVar(cvar, "0"); } AutoExecConfig(true, "sm_cvar_test"); @@ -162,7 +162,7 @@ Action sm_cvar_test(int client, int args) char temp[64]; for( int i = 0; i < MAX_CVARS; i++ ) { - Format(temp, sizeof(temp), "sm_cvar_test_%d", i); + FormatEx(temp, sizeof(temp), "sm_cvar_test_%d", i); cvar = FindConVar(temp); if( cvar != null && cvar.IntValue != 1 ) cv++; } diff --git a/addons/sourcemod/scripting/confoglcompmod.sp b/addons/sourcemod/scripting/confoglcompmod.sp index de7d6f5a9..c047474bd 100644 --- a/addons/sourcemod/scripting/confoglcompmod.sp +++ b/addons/sourcemod/scripting/confoglcompmod.sp @@ -3,7 +3,7 @@ #define DEBUG_ALL 0 -#define PLUGIN_VERSION "2.4.7" +#define PLUGIN_VERSION "2.5.0" // Using these macros, you can disable unnecessary modules, // and they will not be included in the plugin at compile time, diff --git a/addons/sourcemod/scripting/confoglcompmod/ClientSettings.sp b/addons/sourcemod/scripting/confoglcompmod/ClientSettings.sp index fc5ab2836..1cb7c8895 100644 --- a/addons/sourcemod/scripting/confoglcompmod/ClientSettings.sp +++ b/addons/sourcemod/scripting/confoglcompmod/ClientSettings.sp @@ -148,15 +148,15 @@ static Action _ClientSettings_Cmd(int client, int args) char message[256], shortbuf[64]; for (int i = 0; i < iSize; i++) { ClientSettingsArray.GetArray(i, clsetting, sizeof(clsetting)); - Format(message, sizeof(message), "[Confogl] Client CVar: %s ", clsetting.CLSE_cvar); + FormatEx(message, sizeof(message), "[Confogl] Client CVar: %s ", clsetting.CLSE_cvar); if (clsetting.CLSE_hasMin) { - Format(shortbuf, sizeof(shortbuf), "Min: %f ", clsetting.CLSE_min); + FormatEx(shortbuf, sizeof(shortbuf), "Min: %f ", clsetting.CLSE_min); StrCat(message, sizeof(message), shortbuf); } if (clsetting.CLSE_hasMax) { - Format(shortbuf, sizeof(shortbuf), "Max: %f ", clsetting.CLSE_max); + FormatEx(shortbuf, sizeof(shortbuf), "Max: %f ", clsetting.CLSE_max); StrCat(message, sizeof(message), shortbuf); } diff --git a/addons/sourcemod/scripting/confoglcompmod/ItemTracking.sp b/addons/sourcemod/scripting/confoglcompmod/ItemTracking.sp index f4a9d6ab6..6f5d1f55b 100644 --- a/addons/sourcemod/scripting/confoglcompmod/ItemTracking.sp +++ b/addons/sourcemod/scripting/confoglcompmod/ItemTracking.sp @@ -5,6 +5,20 @@ #define IT_MODULE_NAME "ItemTracking" +#define PF_KEEP 0 +#define PF_CULL_WINDOW 1 +#define PF_CULL_SEP 2 +#define PF_CULL_LIMIT 3 +#define PF_NO_FLOW -1 // no nav/flow data: always kept, excluded from spacing + +static int PF_GLOW_KEEP[3] = {255, 255, 255}; // white +static int PF_GLOW_CULL[4][3] = { + {0, 0, 0}, // PF_KEEP (unused) + {255, 0, 0}, // PF_CULL_WINDOW: red + {255, 165, 0}, // PF_CULL_SEP: orange + {0, 255, 255} // PF_CULL_LIMIT: cyan +}; + // Item lists for tracking/decoding/etc enum /*ItemList*/ { @@ -110,8 +124,16 @@ static ConVar g_hCvarConsistentSpawns = null, g_hCvarMapSpecificSpawns = null, g_hCvarIgnorePlayerItems = null, + g_hCvarPillFlowMin = null, + g_hCvarPillFlowMax = null, + g_hCvarPillFlowSeparation = null, + g_hCvarPillFlowFinale = null, + g_hCvarPillFlowVisualize = null, g_hCvarLimits[ItemList_Size] = {null, ...}; // CVAR Handle Array for item limits +static bool + g_bPillLimitHandled = false; // Pill flow filter ran and owns the pills limit this round + static ArrayList g_hItemSpawns[ItemList_Size] = {null, ...}; // ADT Array Handle for actual item spawns @@ -125,11 +147,19 @@ void IT_OnModuleStart() g_hCvarMapSpecificSpawns = CreateConVarEx("itemtracking_mapspecific", "0", "Change how mapinfo.txt overrides work. 0 = ignore mapinfo.txt, 1 = allow limit reduction, 2 = allow limit increases.", _, true, 0.0, true, 3.0); g_hCvarIgnorePlayerItems = CreateConVarEx("itemtracking_playeritems", "0", "Ignore items that players spawn with. 0 = Nope, 1 = Yes. (Non-issue in versus modes)", _, true, 0.0, true, 1.0); + // Pill flow window. Per-map override keys in mapinfo.txt (map section): + // "pillflow_min", "pillflow_max", "pillflow_separation" (floats, same meaning as the cvars). + g_hCvarPillFlowMin = CreateConVarEx("pills_flow_min", "0", "Minimum map flow fraction (0.0-1.0) where pain pills may spawn. Pills earlier than this are removed. 0 with max 1 and separation 0 = flow filter off.", _, true, 0.0, true, 1.0); + g_hCvarPillFlowMax = CreateConVarEx("pills_flow_max", "1", "Maximum map flow fraction (0.0-1.0) where pain pills may spawn. Pills later than this are removed.", _, true, 0.0, true, 1.0); + g_hCvarPillFlowSeparation = CreateConVarEx("pills_flow_separation", "0", "Minimum flow-fraction gap between two kept pill spawns (0.05 = 5% of map flow). Of a too-close pair the earlier spawn wins. 0 = no separation enforced.", _, true, 0.0, true, 1.0); + g_hCvarPillFlowFinale = CreateConVarEx("pills_flow_finale", "0", "Apply the pill flow window on finale maps. 0 = finales exempt.", _, true, 0.0, true, 1.0); + g_hCvarPillFlowVisualize = CreateConVarEx("pills_flow_visualize", "0", "Debug: 1 = don't remove pills, glow instead: white = kept, red = outside flow window, orange = too close to previous pill, cyan = over the pills limit. 2 = remove as normal, then glow the surviving pills white.", _, true, 0.0, true, 2.0); + char sNameBuf[64], sCvarDescBuf[256]; // Create itemlimit cvars for (int i = 0; i < ItemList_Size; i++) { - Format(sNameBuf, sizeof(sNameBuf), "%s_limit", g_sItemNames[i][IN_shortname]); - Format(sCvarDescBuf, sizeof(sCvarDescBuf), "Limits the number of %s on each map. -1: no limit; >=0: limit to cvar value", g_sItemNames[i][IN_longname]); + FormatEx(sNameBuf, sizeof(sNameBuf), "%s_limit", g_sItemNames[i][IN_shortname]); + FormatEx(sCvarDescBuf, sizeof(sCvarDescBuf), "Limits the number of %s on each map. -1: no limit; >=0: limit to cvar value", g_sItemNames[i][IN_longname]); g_hCvarLimits[i] = CreateConVarEx(sNameBuf, "-1", sCvarDescBuf); } @@ -231,6 +261,7 @@ static void EnumAndElimSpawns() } EnumerateSpawns(); + g_bPillLimitHandled = ApplyPillFlowFilter(); RemoveToLimits(); } @@ -238,6 +269,11 @@ static void GenerateStoredSpawns() { KillRegisteredItems(); SpawnItems(); + + // Repaint glows on the respawned entities. + if (g_hCvarPillFlowVisualize.IntValue > 0) { + ApplyPillFlowFilter(); + } } // l4d2lib plugin @@ -315,7 +351,7 @@ static void SpawnItems() char sModelname[PLATFORM_MAX_PATH]; for (int itemidx = 0; itemidx < ItemList_Size; itemidx++) { - Format(sModelname, sizeof(sModelname), "models/w_models/weapons/w_eq_%s.mdl", g_sItemNames[itemidx][IN_modelname]); + FormatEx(sModelname, sizeof(sModelname), "models/w_models/weapons/w_eq_%s.mdl", g_sItemNames[itemidx][IN_modelname]); arrsize = g_hItemSpawns[itemidx].Length; @@ -342,12 +378,29 @@ static void SpawnItems() TeleportEntity(itement, origins, angles, NULL_VECTOR); DispatchSpawn(itement); SetEntityMoveType(itement, MOVETYPE_NONE); + + /* + Keep the stored entry pointing at the live entity so passes that + run after the respawn (e.g. the pill flow filter) address the + round-2 entity, not the killed round-1 one. + */ + curitem.IT_entity = itement; + g_hItemSpawns[itemidx].SetArray(idx, curitem, sizeof(curitem)); } } } static void EnumerateSpawns() { + /* + Start every enumeration from a clean slate. + Without this, configs running savespawns 0 stack round-2 entries on round-1 leftovers + and mapspecific 0 leaks spawns across maps (OnMapStart only clears when mapspecific != 0) + */ + for (int i = 0; i < ItemList_Size; i++) { + g_hItemSpawns[i].Clear(); + } + ItemTracking curitem; float origins[3], angles[3]; @@ -424,6 +477,11 @@ static void RemoveToLimits() int curlimit = 0, killidx = 0; for (int itemidx = 0; itemidx < ItemList_Size; itemidx++) { + // The pill flow filter already enforced the pills limit (evenly spaced by flow instead of random) + if (itemidx == IL_PainPills && g_bPillLimitHandled) { + continue; + } + curlimit = g_iItemLimits[itemidx]; if (curlimit > 0) { @@ -453,6 +511,227 @@ static void RemoveToLimits() } } +static float PF_GetSetting(const char[] sKey, ConVar hCvar) +{ + if (IsMapDataAvailable()) { + return GetMapValueFloat(sKey, hCvar.FloatValue); + } + + return hCvar.FloatValue; +} + +// Returns true when the filter is active (= it owns the pills limit this round). +static bool ApplyPillFlowFilter() +{ + float fFlowMin = PF_GetSetting("pillflow_min", g_hCvarPillFlowMin); + float fFlowMax = PF_GetSetting("pillflow_max", g_hCvarPillFlowMax); + float fSep = PF_GetSetting("pillflow_separation", g_hCvarPillFlowSeparation); + + if (fFlowMin <= 0.0 && fFlowMax >= 1.0 && fSep <= 0.0) { + return false; + } + + if (fFlowMax < fFlowMin) { + LogError("[%s] pillflow_max (%.2f) < pillflow_min (%.2f); pill flow filter disabled.", IT_MODULE_NAME, fFlowMax, fFlowMin); + return false; + } + + if (!g_hCvarPillFlowFinale.BoolValue && L4D_IsMissionFinalMap()) { + if (IsDebugEnabled()) { + LogMessage("[%s] Finale map, pill flow filter skipped.", IT_MODULE_NAME); + } + return false; + } + + float fMaxFlowDist = L4D2Direct_GetMapMaxFlowDistance(); + if (fMaxFlowDist <= 0.0) { + return false; + } + + ArrayList hSpawns = g_hItemSpawns[IL_PainPills]; + int iCount = hSpawns.Length; + if (!iCount) { + return true; + } + + int iVisualize = g_hCvarPillFlowVisualize.IntValue; + bool bVisualize = (iVisualize == 1); // mode 1 glows instead of removing; mode 2 removes and glows survivors + ItemTracking curitem; + float fOrigins[3]; + + // Resolve each stored pill spawn to a flow fraction and apply the window. + float[] fPct = new float[iCount]; + int[] iReason = new int[iCount]; + + for (int i = 0; i < iCount; i++) { + hSpawns.GetArray(i, curitem, sizeof(curitem)); + GetSpawnOrigins(fOrigins, curitem); + + Address pNav = L4D_GetNearestNavArea(fOrigins, 120.0, true, false, false, 2); + if (pNav == Address_Null) { + pNav = L4D2Direct_GetTerrorNavArea(fOrigins); + } + + float fFlow = (pNav != Address_Null) ? L4D2Direct_GetTerrorNavAreaFlow(pNav) : -1.0; + if (fFlow < 0.0) { + fPct[i] = -1.0; + iReason[i] = PF_NO_FLOW; + continue; + } + + fPct[i] = fFlow / fMaxFlowDist; + if (fPct[i] > 1.0) { + fPct[i] = 1.0; + } + + if (fPct[i] < fFlowMin || fPct[i] > fFlowMax) { + iReason[i] = PF_CULL_WINDOW; + } + } + + // Index order sorted by ascending flow (spacing passes walk the map start->end). + int[] iOrder = new int[iCount]; + for (int i = 0; i < iCount; i++) { + iOrder[i] = i; + } + for (int i = 1; i < iCount; i++) { + int tmp = iOrder[i]; + int j = i - 1; + while (j >= 0 && fPct[iOrder[j]] > fPct[tmp]) { + iOrder[j + 1] = iOrder[j]; + j--; + } + iOrder[j + 1] = tmp; + } + + // Minimum flow separation; of a too-close cluster the earliest spawn wins. + if (fSep > 0.0) { + float fLastKept = -1.0; + for (int k = 0; k < iCount; k++) { + int i = iOrder[k]; + if (iReason[i] != PF_KEEP) { + continue; + } + if (fLastKept >= 0.0 && fPct[i] - fLastKept < fSep) { + iReason[i] = PF_CULL_SEP; + } else { + fLastKept = fPct[i]; + } + } + } + + /* + Enforce the pills limit here, evenly spaced by flow. + Spawns without flow data can't be spaced, so they occupy limit slots off the top. + */ + int iLimit = g_iItemLimits[IL_PainPills]; + if (iLimit >= 0) { + int iKept = 0, iNoFlow = 0; + for (int i = 0; i < iCount; i++) { + if (iReason[i] == PF_KEEP) { + iKept++; + } else if (iReason[i] == PF_NO_FLOW) { + iNoFlow++; + } + } + + int iSlots = iLimit - iNoFlow; + if (iSlots < 0) { + /* + More flowless spawns than the limit alone allows: remove the extra. + No flow data means there is nothing to space them by, so array order decides + */ + int iExcess = -iSlots; + for (int i = iCount - 1; i >= 0 && iExcess > 0; i--) { + if (iReason[i] == PF_NO_FLOW) { + iReason[i] = PF_CULL_LIMIT; + iExcess--; + } + } + iSlots = 0; + } + + if (iSlots < iKept) { + bool[] bSelected = new bool[iCount]; + for (int slot = 0; slot < iSlots; slot++) { + // Ideal flow for this slot + float fWant = fFlowMin + (fFlowMax - fFlowMin) * (float(slot) + 0.5) / float(iSlots); + + int best = -1; + float fBestDist = 0.0; + for (int i = 0; i < iCount; i++) { + if (iReason[i] != PF_KEEP || bSelected[i]) { + continue; + } + float d = fPct[i] - fWant; + if (d < 0.0) { + d = -d; + } + if (best == -1 || d < fBestDist) { + best = i; + fBestDist = d; + } + } + if (best != -1) { + bSelected[best] = true; + } + } + + for (int i = 0; i < iCount; i++) { + if (iReason[i] == PF_KEEP && !bSelected[i]) { + iReason[i] = PF_CULL_LIMIT; + } + } + } + } + + // Apply: kill+erase culled spawns (descending so indices stay valid), or + // just glow everything in visualize mode. + int iRemoved[4] = {0, ...}; // indexed by PF_CULL_* reason + + for (int i = iCount - 1; i >= 0; i--) { + hSpawns.GetArray(i, curitem, sizeof(curitem)); + + if (iReason[i] <= PF_KEEP) { + if (IsDebugEnabled()) { + LogMessage("[%s] Pill spawn %d flow=%.1f%% KEPT%s", IT_MODULE_NAME, curitem.IT_entity, + fPct[i] * 100.0, iReason[i] == PF_NO_FLOW ? " (no flow data)" : ""); + } + if (iVisualize > 0) { + L4D2_SetEntityGlow(curitem.IT_entity, L4D2Glow_Constant, 0, 0, PF_GLOW_KEEP, false); + } + continue; + } + + if (IsDebugEnabled()) { + static const char sReasons[4][] = {"", "outside window", "separation", "limit spacing"}; + LogMessage("[%s] Pill spawn %d flow=%.1f%% %s (%s)", IT_MODULE_NAME, curitem.IT_entity, + fPct[i] * 100.0, bVisualize ? "WOULD REMOVE" : "REMOVED", sReasons[iReason[i]]); + } + iRemoved[iReason[i]]++; + + if (bVisualize) { + L4D2_SetEntityGlow(curitem.IT_entity, L4D2Glow_Constant, 0, 0, PF_GLOW_CULL[iReason[i]], false); + } else { + if (IsValidEdict(curitem.IT_entity)) { + KillEntity(curitem.IT_entity); + } + hSpawns.Erase(i); + } + } + + if (IsDebugEnabled()) { + LogMessage("[%s] Pill flow window %.0f%%-%.0f%% sep %.1f%%: %d kept, %d %s (window), %d (separation), %d (limit spacing).%s", + IT_MODULE_NAME, fFlowMin * 100.0, fFlowMax * 100.0, fSep * 100.0, + iCount - iRemoved[PF_CULL_WINDOW] - iRemoved[PF_CULL_SEP] - iRemoved[PF_CULL_LIMIT], + iRemoved[PF_CULL_WINDOW], bVisualize ? "flagged" : "removed", + iRemoved[PF_CULL_SEP], iRemoved[PF_CULL_LIMIT], + bVisualize ? " (visualize: nothing deleted; white = kept, red = window, orange = separation, cyan = limit)" : ""); + } + + return true; +} + static void SetSpawnOrigins(const float buf[3], ItemTracking spawn) { spawn.IT_origins = buf[0]; diff --git a/addons/sourcemod/scripting/confoglcompmod/MapInfo.sp b/addons/sourcemod/scripting/confoglcompmod/MapInfo.sp index 9f72df343..b72f1e8cd 100644 --- a/addons/sourcemod/scripting/confoglcompmod/MapInfo.sp +++ b/addons/sourcemod/scripting/confoglcompmod/MapInfo.sp @@ -100,6 +100,12 @@ static Action MI_KV_CmdSave(int client, int args) static Action MI_KV_CmdSaveLoc(int client, int args) { + // This command saves the caller's own position, so it needs an in-game caller. + if (!client || !IsClientInGame(client)) { + ReplyToCommand(client, "This command can only be used by an in-game player."); + return Plugin_Handled; + } + bool updateinfo = false; char sCurMap[128]; GetCurrentMap(sCurMap, sizeof(sCurMap)); diff --git a/addons/sourcemod/scripting/confoglcompmod/WeaponCustomization.sp b/addons/sourcemod/scripting/confoglcompmod/WeaponCustomization.sp index 1ae120bb0..0dd7242c8 100644 --- a/addons/sourcemod/scripting/confoglcompmod/WeaponCustomization.sp +++ b/addons/sourcemod/scripting/confoglcompmod/WeaponCustomization.sp @@ -82,7 +82,7 @@ static void WC_PlayerUse_Event(Event hEvent, const char[] sEventName, bool bDont SetCommandFlags("give", flags ^ FCVAR_CHEAT); char sTemp[64]; - Format(sTemp, sizeof(sTemp), "give %s", WC_sLastWeapon); + FormatEx(sTemp, sizeof(sTemp), "give %s", WC_sLastWeapon); FakeClientCommand(client, sTemp); SetCommandFlags("give", flags); diff --git a/addons/sourcemod/scripting/confoglcompmod/WeaponInformation.sp b/addons/sourcemod/scripting/confoglcompmod/WeaponInformation.sp index 507034fa5..bc2d4b5d5 100644 --- a/addons/sourcemod/scripting/confoglcompmod/WeaponInformation.sp +++ b/addons/sourcemod/scripting/confoglcompmod/WeaponInformation.sp @@ -713,7 +713,7 @@ static int WI_GetWeaponIndex(int iEntity, const char[] sEntityClassName) continue; } - Format(sBuffer, sizeof(sBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[WeaponIndex], SPAWN_SURFIX); + FormatEx(sBuffer, sizeof(sBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[WeaponIndex], SPAWN_SURFIX); if (strcmp(sEntityClassName, sBuffer) != 0) { continue; @@ -764,7 +764,7 @@ static bool WI_IsStatic(int iEntity, int iWeaponIndex) char sEntityClassName[MAX_ENTITY_NAME_LENGTH], sBuffer[MAX_ENTITY_NAME_LENGTH]; GetEdictClassname(iEntity, sEntityClassName, sizeof(sEntityClassName)); - Format(sBuffer, sizeof(sBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[iWeaponIndex], SPAWN_SURFIX); + FormatEx(sBuffer, sizeof(sBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[iWeaponIndex], SPAWN_SURFIX); if (strcmp(sEntityClassName, sBuffer) != 0) { return false; @@ -834,7 +834,7 @@ static void WI_ReplaceWeapon(int iEntity, int iWeaponIndex, bool bSpawnerEvent = iEntity = CreateEntityByName("weapon_spawn"); SetEntProp(iEntity, Prop_Send, "m_weaponID", Weapon_Attributes[iWeaponIndex][WeaponID]); - Format(sModelBuffer, sizeof(sModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[iWeaponIndex], MODEL_SURFIX); + FormatEx(sModelBuffer, sizeof(sModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[iWeaponIndex], MODEL_SURFIX); SetEntityModel(iEntity, sModelBuffer); TeleportEntity(iEntity, fOrigin, fRotation, NULL_VECTOR); @@ -862,7 +862,7 @@ static void WI_ReplaceWeapon(int iEntity, int iWeaponIndex, bool bSpawnerEvent = ) { iWeaponIndex = Weapon_Attributes[iWeaponIndex][ReplacementIndex]; SetEntProp(iEntity, Prop_Send, "m_weaponID", Weapon_Attributes[iWeaponIndex][WeaponID]); - Format(sModelBuffer, sizeof(sModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[iWeaponIndex], MODEL_SURFIX); + FormatEx(sModelBuffer, sizeof(sModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[iWeaponIndex], MODEL_SURFIX); SetEntityModel(iEntity, sModelBuffer); #if (DEBUG_WI) @@ -962,7 +962,7 @@ static void WI_ReplaceWeapon(int iEntity, int iWeaponIndex, bool bSpawnerEvent = iWeaponIndex = Weapon_Attributes[iWeaponIndex][Tier1EquivalentIndex]; SetEntProp(iEntity, Prop_Send, "m_weaponID", Weapon_Attributes[iWeaponIndex][WeaponID]); - Format(sModelBuffer, sizeof(sModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[iWeaponIndex], MODEL_SURFIX); + FormatEx(sModelBuffer, sizeof(sModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[iWeaponIndex], MODEL_SURFIX); SetEntityModel(iEntity, sModelBuffer); #if (DEBUG_WI) @@ -1116,7 +1116,7 @@ static void WI_ReplaceExtra(int iEntity, int iWeaponIndex) KillEntity(iEntity); - Format(sSpawnBuffer, sizeof(sSpawnBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[WEAPON_PAIN_PILLS_INDEX], SPAWN_SURFIX); + FormatEx(sSpawnBuffer, sizeof(sSpawnBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[WEAPON_PAIN_PILLS_INDEX], SPAWN_SURFIX); iEntity = CreateEntityByName(sSpawnBuffer); TeleportEntity(iEntity, fOrigin, fRotation, NULL_VECTOR); @@ -1131,7 +1131,7 @@ static void WI_ReplaceExtra(int iEntity, int iWeaponIndex) KillEntity(iEntity); - Format(sSpawnBuffer, sizeof(sSpawnBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[WEAPON_PAIN_PILLS_INDEX], SPAWN_SURFIX); + FormatEx(sSpawnBuffer, sizeof(sSpawnBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[WEAPON_PAIN_PILLS_INDEX], SPAWN_SURFIX); iEntity = CreateEntityByName(sSpawnBuffer); TeleportEntity(iEntity, fOrigin, fRotation, NULL_VECTOR); @@ -1166,7 +1166,7 @@ static void WI_PrecacheModels() continue; } - Format(ModelBuffer, sizeof(ModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[index], MODEL_SURFIX); + FormatEx(ModelBuffer, sizeof(ModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[index], MODEL_SURFIX); if (IsModelPrecached(ModelBuffer)) { continue; diff --git a/addons/sourcemod/scripting/confoglcompmod/includes/configs.sp b/addons/sourcemod/scripting/confoglcompmod/includes/configs.sp index ddeea0673..b933b05f3 100644 --- a/addons/sourcemod/scripting/confoglcompmod/includes/configs.sp +++ b/addons/sourcemod/scripting/confoglcompmod/includes/configs.sp @@ -59,7 +59,7 @@ bool SetCustomCfg(const char[] cfgname) return true; } - Format(customCfgPath, sizeof(customCfgPath), "%s%s%c%s", cfgPath, customCfgDir, DirSeparator, cfgname); + FormatEx(customCfgPath, sizeof(customCfgPath), "%s%s%c%s", cfgPath, customCfgDir, DirSeparator, cfgname); if (!DirExists(customCfgPath)) { Debug_LogError(CONFIGS_MODULE_NAME, "Custom config directory %s does not exist!", customCfgPath); // Revert customCfgPath @@ -86,7 +86,7 @@ bool SetCustomCfg(const char[] cfgname) void BuildConfigPath(char[] buffer, const int maxlength, const char[] sFileName) { if (customCfgPath[0]) { - Format(buffer, maxlength, "%s%s", customCfgPath, sFileName); + FormatEx(buffer, maxlength, "%s%s", customCfgPath, sFileName); if (FileExists(buffer)) { if (IsDebugEnabled()) { @@ -101,7 +101,7 @@ void BuildConfigPath(char[] buffer, const int maxlength, const char[] sFileName) } } - Format(buffer, maxlength, "%s%s", configsPath, sFileName); + FormatEx(buffer, maxlength, "%s%s", configsPath, sFileName); if (IsDebugEnabled()) { LogMessage("[%s] Built default config path: %s", CONFIGS_MODULE_NAME, buffer); } @@ -116,7 +116,7 @@ void ExecuteCfg(const char[] sFileName) char sFilePath[PLATFORM_MAX_PATH]; if (customCfgPath[0]) { - Format(sFilePath, sizeof(sFilePath), "%s%s", customCfgPath, sFileName); + FormatEx(sFilePath, sizeof(sFilePath), "%s%s", customCfgPath, sFileName); if (FileExists(sFilePath)) { if (IsDebugEnabled()) { @@ -133,7 +133,7 @@ void ExecuteCfg(const char[] sFileName) } } - Format(sFilePath, sizeof(sFilePath), "%s%s", cfgPath, sFileName); + FormatEx(sFilePath, sizeof(sFilePath), "%s%s", cfgPath, sFileName); if (FileExists(sFilePath)) { if (IsDebugEnabled()) { diff --git a/addons/sourcemod/scripting/confoglcompmod/includes/customtags.sp b/addons/sourcemod/scripting/confoglcompmod/includes/customtags.sp index 7c84646b6..cf1fb0da2 100644 --- a/addons/sourcemod/scripting/confoglcompmod/includes/customtags.sp +++ b/addons/sourcemod/scripting/confoglcompmod/includes/customtags.sp @@ -42,7 +42,7 @@ stock void AddCustomServerTag(const char[] tag) } char new_tags[SV_TAG_SIZE]; - Format(new_tags, sizeof(new_tags), "%s%s%s", current_tags, (current_tags[0] != 0) ? "," : "", tag); + FormatEx(new_tags, sizeof(new_tags), "%s%s%s", current_tags, (current_tags[0] != 0) ? "," : "", tag); int flags = sv_tags.Flags; sv_tags.Flags = flags & ~FCVAR_NOTIFY; diff --git a/addons/sourcemod/scripting/confoglcompmod/includes/functions.sp b/addons/sourcemod/scripting/confoglcompmod/includes/functions.sp index 818186058..59627490c 100644 --- a/addons/sourcemod/scripting/confoglcompmod/includes/functions.sp +++ b/addons/sourcemod/scripting/confoglcompmod/includes/functions.sp @@ -26,7 +26,7 @@ stock ConVar CreateConVarEx(const char[] name, const char[] defaultValue, const char sBuffer[128]; ConVar cvar = null; - Format(sBuffer, sizeof(sBuffer), "%s%s", CVAR_PREFIX, name); + FormatEx(sBuffer, sizeof(sBuffer), "%s%s", CVAR_PREFIX, name); flags = flags | CVAR_FLAGS; cvar = CreateConVar(sBuffer, defaultValue, description, flags, hasMin, min, hasMax, max); @@ -36,7 +36,7 @@ stock ConVar CreateConVarEx(const char[] name, const char[] defaultValue, const stock ConVar FindConVarEx(const char[] name) { char sBuffer[128]; - Format(sBuffer, sizeof(sBuffer), "%s%s", CVAR_PREFIX, name); + FormatEx(sBuffer, sizeof(sBuffer), "%s%s", CVAR_PREFIX, name); return FindConVar(sBuffer); } diff --git a/addons/sourcemod/scripting/current.sp b/addons/sourcemod/scripting/current.sp index 81ff89db7..95939325b 100644 --- a/addons/sourcemod/scripting/current.sp +++ b/addons/sourcemod/scripting/current.sp @@ -14,7 +14,7 @@ public Plugin myinfo = name = "L4D2 Survivor Progress", author = "CanadaRox, Visor", description = "Print survivor progress in flow percents ", - version = "2.0.5", + version = "2.0.7", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -29,6 +29,9 @@ public void OnPluginStart() Action CurrentCmd(int client, int args) { + if (!client || !IsClientInGame(client)) + return Plugin_Handled; + int boss_proximity = RoundToNearest(GetBossProximity() * 100.0); CPrintToChat(client, "%t %t", "Tag", "Current", boss_proximity); return Plugin_Handled; @@ -80,7 +83,7 @@ stock void LoadTranslation(const char[] translation) sPath[PLATFORM_MAX_PATH], sName[64]; - Format(sName, sizeof(sName), "translations/%s.txt", translation); + FormatEx(sName, sizeof(sName), "translations/%s.txt", translation); BuildPath(Path_SM, sPath, sizeof(sPath), sName); if (!FileExists(sPath)) SetFailState("Missing translation file %s.txt", translation); diff --git a/addons/sourcemod/scripting/fix_pill_pass.sp b/addons/sourcemod/scripting/fix_pill_pass.sp new file mode 100644 index 000000000..b0c7efcbf --- /dev/null +++ b/addons/sourcemod/scripting/fix_pill_pass.sp @@ -0,0 +1,109 @@ +#pragma semicolon 1 +#pragma newdecls required + +#include +#include +#include +#include + +#define GAMEDATA "fix_pill_pass" +#define PASS_INFLIGHT_WINDOW 0.5 + +int g_iOffs_m_hDroppingPlayer = -1; // CTerrorWeapon: the survivor who threw the item +int g_iOffs_m_hDropTarget = -1; // CTerrorWeapon: the survivor the item is headed to +MemoryPatch g_hIsInCombatPatch; + +float g_fIncomingPassAt[MAXPLAYERS + 1]; + +public Plugin myinfo = +{ + name = "[L4D/2] Fix Pill Passing", + author = "Alan, A1m`, Forgetest, Sir", + description = "Fixes being unable to pass Pills to Survivor considered 'In Combat' + Pills being thrown away.", + version = "1.0" +}; + +public void OnPluginStart() +{ + int iBaseOffs = FindSendPropInfo("CTerrorWeapon", "m_nUpgradedPrimaryAmmoLoaded"); + if (iBaseOffs == -1) + SetFailState("Could not find offset: CTerrorWeapon->m_nUpgradedPrimaryAmmoLoaded"); + + g_iOffs_m_hDroppingPlayer = iBaseOffs + 8; + g_iOffs_m_hDropTarget = iBaseOffs + 12; + + GameData hGameData = new GameData(GAMEDATA); + if (hGameData == null) + SetFailState("Failed to load \"%s.txt\" gamedata.", GAMEDATA); + + g_hIsInCombatPatch = MemoryPatch.CreateFromConf(hGameData, "IsInCombatPillPass"); + if (g_hIsInCombatPatch == null || !g_hIsInCombatPatch.Validate()) + SetFailState("Failed to validate \"IsInCombatPillPass\" target."); + if (!g_hIsInCombatPatch.Enable()) + SetFailState("Failed to patch \"IsInCombatPillPass\" target."); + + DynamicDetour hDetour = DynamicDetour.FromConf(hGameData, "CBaseBeltItem::SecondaryAttack"); + if (!hDetour) + SetFailState("Missing signature \""..."CBaseBeltItem::SecondaryAttack"..."\""); + if (!hDetour.Enable(Hook_Post, BaseBeltItem_SecondaryAttack_Post)) + SetFailState("Failed to detour \""..."CBaseBeltItem::SecondaryAttack"..."\""); + + delete hDetour; + delete hGameData; + + HookEvent("round_start", Event_RoundStart, EventHookMode_PostNoCopy); +} + +public void OnPluginEnd() +{ + if (g_hIsInCombatPatch != null) + g_hIsInCombatPatch.Disable(); +} + +void Event_RoundStart(Event event, const char[] sEventName, bool dontBroadcast) +{ + for (int i = 1; i <= MaxClients; ++i) + g_fIncomingPassAt[i] = 0.0; +} + +MRESReturn BaseBeltItem_SecondaryAttack_Post(int pThis) +{ + /* + The pills only become an ownerless world entity when the game actually throws them + to a teammate with a free slot; any other outcome keeps them held, nothing to do. + */ + if (GetEntPropEnt(pThis, Prop_Send, "m_hOwner") != -1) + return MRES_Ignored; + + int iTarget = GetEntDataEnt2(pThis, g_iOffs_m_hDropTarget); + int iThrower = GetEntDataEnt2(pThis, g_iOffs_m_hDroppingPlayer); + + if (!IsValidSurvivor(iTarget) || !IsValidSurvivor(iThrower)) + return MRES_Ignored; + + float fNow = GetGameTime(); + float fSince = fNow - g_fIncomingPassAt[iTarget]; + + /* + Someone is already passing pills to this target and they haven't landed yet, so the + target's slot will be taken - this pass can't be delivered and would drop on the + floor. Hand it straight back to the thrower instead. + */ + if (fSince >= 0.0 && fSince < PASS_INFLIGHT_WINDOW) + { + EquipPlayerWeapon(iThrower, pThis); + return MRES_Ignored; + } + + /* + First pass to this target: let it through, remember it so a follow-up before it lands + gets bounced back above, and drop it at the target's feet so GiveThink hands it over. + */ + g_fIncomingPassAt[iTarget] = fNow; + return MRES_Ignored; +} + +bool IsValidSurvivor(int client) +{ + return client >= 1 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2; +} diff --git a/addons/sourcemod/scripting/holdout_bonus.sp b/addons/sourcemod/scripting/holdout_bonus.sp index 383b47e14..de1cfec97 100644 --- a/addons/sourcemod/scripting/holdout_bonus.sp +++ b/addons/sourcemod/scripting/holdout_bonus.sp @@ -96,7 +96,7 @@ public Plugin myinfo = name = "Holdout Bonus", author = "Tabun", description = "Gives bonus for (partially) surviving holdout/camping events. (Requires penalty_bonus.)", - version = "0.1.1", + version = "0.1.2", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -571,14 +571,14 @@ Action Cmd_DisplayBonus(int client, int args) // build message: current / round's bonus if (!g_bHoldoutThisRound) { - Format(sMsg, sizeof(sMsg), "no holdout event this round."); + strcopy(sMsg, sizeof(sMsg), "no holdout event this round."); } else { if (g_bHoldoutActive) { - Format(sMsg, sizeof(sMsg), "\x04%i\x01 out of \x05%i\x01 [\x04%i\x01/\x05%i\x01 sec].", CalculateHoldOutBonus(), g_iPointsBonus, g_iProgress, g_iHoldoutTime); + FormatEx(sMsg, sizeof(sMsg), "\x04%i\x01 out of \x05%i\x01 [\x04%i\x01/\x05%i\x01 sec].", CalculateHoldOutBonus(), g_iPointsBonus, g_iProgress, g_iHoldoutTime); } else if (g_iActualBonus) { - Format(sMsg, sizeof(sMsg), "\x04%i\x01 out of \x05%i\x01 [event over].", g_iActualBonus, g_iPointsBonus); + FormatEx(sMsg, sizeof(sMsg), "\x04%i\x01 out of \x05%i\x01 [event over].", g_iActualBonus, g_iPointsBonus); } else { - Format(sMsg, sizeof(sMsg), "\x04%i\x01 out of \x05%i\x01 [not started yet].", g_iActualBonus, g_iPointsBonus); + FormatEx(sMsg, sizeof(sMsg), "\x04%i\x01 out of \x05%i\x01 [not started yet].", g_iActualBonus, g_iPointsBonus); } } diff --git a/addons/sourcemod/scripting/include/colors.inc b/addons/sourcemod/scripting/include/colors.inc index 35d5c93d3..cde5a5c5f 100644 --- a/addons/sourcemod/scripting/include/colors.inc +++ b/addons/sourcemod/scripting/include/colors.inc @@ -137,7 +137,7 @@ stock void CPrintToChat(int client, const char[] szMessage, any ...) SetGlobalTransTarget(client); - Format(szBuffer, sizeof(szBuffer), "\x01%s", szMessage); + FormatEx(szBuffer, sizeof(szBuffer), "\x01%s", szMessage); VFormat(szCMessage, sizeof(szCMessage), szBuffer, 3); int index = CFormat(szCMessage, sizeof(szCMessage)); @@ -284,7 +284,7 @@ stock void CPrintToChatEx(int client, int author, const char[] szMessage, any .. SetGlobalTransTarget(client); - Format(szBuffer, sizeof(szBuffer), "\x01%s", szMessage); + FormatEx(szBuffer, sizeof(szBuffer), "\x01%s", szMessage); VFormat(szCMessage, sizeof(szCMessage), szBuffer, 4); int index = CFormat(szCMessage, sizeof(szCMessage), author); diff --git a/addons/sourcemod/scripting/include/l4d2util_weapons.inc b/addons/sourcemod/scripting/include/l4d2util_weapons.inc index 61c3c7a56..09671bcf5 100644 --- a/addons/sourcemod/scripting/include/l4d2util_weapons.inc +++ b/addons/sourcemod/scripting/include/l4d2util_weapons.inc @@ -344,7 +344,7 @@ stock int ConvertWeaponSpawn(int entity, int wepid, int count = 5, const char[] SetEntityModel(entity, model); } else { GetWeaponModel(wepid, buf, sizeof(buf)); - Format(modelName, sizeof(modelName), "models%s", buf); + FormatEx(modelName, sizeof(modelName), "models%s", buf); SetEntityModel(entity, modelName); } diff --git a/addons/sourcemod/scripting/include/left4dhooks_stocks.inc b/addons/sourcemod/scripting/include/left4dhooks_stocks.inc index afbc187ca..ab1bd73e9 100644 --- a/addons/sourcemod/scripting/include/left4dhooks_stocks.inc +++ b/addons/sourcemod/scripting/include/left4dhooks_stocks.inc @@ -1476,7 +1476,7 @@ stock bool L4D2_CreateInstructorHint(const char[] name, } char finalizedColor[16]; - Format(finalizedColor, 16, "%d,%d,%d", color[0], color[1], color[2]); + FormatEx(finalizedColor, 16, "%d,%d,%d", color[0], color[1], color[2]); event.SetString("hint_name", name); event.SetInt("hint_target", target); diff --git a/addons/sourcemod/scripting/l4d2_allow_cs_weapons.sp b/addons/sourcemod/scripting/l4d2_allow_cs_weapons.sp new file mode 100644 index 000000000..b75933ce5 --- /dev/null +++ b/addons/sourcemod/scripting/l4d2_allow_cs_weapons.sp @@ -0,0 +1,37 @@ +#pragma semicolon 1 +#pragma newdecls required + +#include +#include + +#define GAMEDATA "l4d2_allow_cs_weapons" + +public Plugin myinfo = +{ + name = "[L4D2] Allow CS weapons on every map.", + author = "Sir", + description = "Force weapon spawners to ignore the 'no_cs_weapons' KeyValue, allowing for CS weapons on every map.", + version = "1.0" +}; + +public void OnPluginStart() +{ + GameData hGameData = new GameData(GAMEDATA); + if (hGameData == null) + SetFailState("Failed to load \"%s.txt\" gamedata.", GAMEDATA); + + DynamicDetour hDetour = DynamicDetour.FromConf(hGameData, "CDirectorItemManager::AreCSWeaponsAllowed"); + if (!hDetour) + SetFailState("Missing signature \"CDirectorItemManager::AreCSWeaponsAllowed\""); + if (!hDetour.Enable(Hook_Pre, DirectorItemManager_AreCSWeaponsAllowed)) + SetFailState("Failed to detour \"CDirectorItemManager::AreCSWeaponsAllowed\""); + + delete hDetour; + delete hGameData; +} + +MRESReturn DirectorItemManager_AreCSWeaponsAllowed(DHookReturn hReturn) +{ + hReturn.Value = true; + return MRES_Supercede; +} diff --git a/addons/sourcemod/scripting/l4d2_character_fix.sp b/addons/sourcemod/scripting/l4d2_character_fix.sp index 1803530e3..eb5455df4 100644 --- a/addons/sourcemod/scripting/l4d2_character_fix.sp +++ b/addons/sourcemod/scripting/l4d2_character_fix.sp @@ -12,7 +12,7 @@ public Plugin myinfo = { name = "Character Fix", author = "someone", - version = "0.2", + version = "0.2.1", description = "Fixes character change exploit in 1v1, 2v2, 3v3", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -26,7 +26,7 @@ public void OnPluginStart() Action TeamCmd(int iClient, const char[] sCommand, int iArgc) { - if (iClient == 0 || iArgc < 1) { + if (!iClient || !IsClientInGame(iClient) || iArgc < 1) { return Plugin_Continue; } diff --git a/addons/sourcemod/scripting/l4d2_ghost_warp.sp b/addons/sourcemod/scripting/l4d2_ghost_warp.sp index b300f9eed..e1e4a8c71 100644 --- a/addons/sourcemod/scripting/l4d2_ghost_warp.sp +++ b/addons/sourcemod/scripting/l4d2_ghost_warp.sp @@ -43,7 +43,7 @@ public Plugin myinfo = name = "Infected Warp", author = "Confogl Team, CanadaRox, A1m`", description = "Allows infected to warp to survivors", - version = "2.4.1", + version = "2.4.2", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -112,7 +112,8 @@ Action Cmd_WarpToSurvivor(int iClient, int iArgs) return Plugin_Handled; } - if (GetClientTeam(iClient) != L4D2Team_Infected + if (!IsClientInGame(iClient) + || GetClientTeam(iClient) != L4D2Team_Infected || GetEntProp(iClient, Prop_Send, "m_isGhost", 1) < 1 || !IsPlayerAlive(iClient) ) { diff --git a/addons/sourcemod/scripting/l4d2_horde_equaliser.sp b/addons/sourcemod/scripting/l4d2_horde_equaliser.sp index 2e812134f..fa008b7e1 100644 --- a/addons/sourcemod/scripting/l4d2_horde_equaliser.sp +++ b/addons/sourcemod/scripting/l4d2_horde_equaliser.sp @@ -42,7 +42,7 @@ public Plugin myinfo = name = "L4D2 Horde Equaliser", author = "Visor (original idea by Sir), A1m`", description = "Make certain event hordes finite", - version = "3.0.10", + version = "3.0.11", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -234,7 +234,7 @@ stock void LoadTranslation(const char[] translation) sPath[PLATFORM_MAX_PATH], sName[64]; - Format(sName, sizeof(sName), "translations/%s.txt", translation); + FormatEx(sName, sizeof(sName), "translations/%s.txt", translation); BuildPath(Path_SM, sPath, sizeof(sPath), sName); if (!FileExists(sPath)) SetFailState("Missing translation file %s.txt", translation); diff --git a/addons/sourcemod/scripting/l4d2_hybrid_scoremod.sp b/addons/sourcemod/scripting/l4d2_hybrid_scoremod.sp index 745090cb9..b08b847ac 100644 --- a/addons/sourcemod/scripting/l4d2_hybrid_scoremod.sp +++ b/addons/sourcemod/scripting/l4d2_hybrid_scoremod.sp @@ -54,7 +54,7 @@ public Plugin:myinfo = name = "L4D2 Scoremod+", author = "Visor", description = "The next generation scoring mod", - version = "2.2.5", + version = "2.2.6", url = "https://github.com/Attano/L4D2-Competitive-Framework" }; @@ -370,7 +370,7 @@ public Action:L4D2_OnEndVersusModeRound(bool:countSurvivors) { SetConVarInt(hCvarValveSurvivalBonus, RoundToFloor(fSurvivorBonus[team] / iSurvivalMultiplier)); fSurvivorBonus[team] = float(GetConVarInt(hCvarValveSurvivalBonus) * iSurvivalMultiplier); // workaround for the discrepancy caused by RoundToFloor() - Format(sSurvivorState[team], 32, "%s%i\x01/\x05%i\x01", (iSurvivalMultiplier == iTeamSize ? "\x05" : "\x04"), iSurvivalMultiplier, iTeamSize); + FormatEx(sSurvivorState[team], 32, "%s%i\x01/\x05%i\x01", (iSurvivalMultiplier == iTeamSize ? "\x05" : "\x04"), iSurvivalMultiplier, iTeamSize); #if SM2_DEBUG PrintToChatAll("\x01Survival bonus cvar updated. Value: \x05%i\x01 [multiplier: \x05%i\x01]", GetConVarInt(hCvarValveSurvivalBonus), iSurvivalMultiplier); #endif @@ -379,7 +379,7 @@ public Action:L4D2_OnEndVersusModeRound(bool:countSurvivors) { fSurvivorBonus[team] = 0.0; SetConVarInt(hCvarValveSurvivalBonus, 0); - Format(sSurvivorState[team], 32, "\x04%s\x01", (iSurvivalMultiplier == 0 ? "wiped out" : "bonus depleted")); + FormatEx(sSurvivorState[team], 32, "\x04%s\x01", (iSurvivalMultiplier == 0 ? "wiped out" : "bonus depleted")); bTiebreakerEligibility[team] = (iSurvivalMultiplier == iTeamSize); } diff --git a/addons/sourcemod/scripting/l4d2_hybrid_scoremod_zone.sp b/addons/sourcemod/scripting/l4d2_hybrid_scoremod_zone.sp index 76bfdc21b..75ca810e6 100644 --- a/addons/sourcemod/scripting/l4d2_hybrid_scoremod_zone.sp +++ b/addons/sourcemod/scripting/l4d2_hybrid_scoremod_zone.sp @@ -54,7 +54,7 @@ public Plugin:myinfo = name = "L4D2 Scoremod+", author = "Visor, Sir", description = "The next generation scoring mod", - version = "2.2.6", + version = "2.2.7", url = "https://github.com/Attano/L4D2-Competitive-Framework" }; @@ -406,7 +406,7 @@ public Action:L4D2_OnEndVersusModeRound(bool:countSurvivors) { SetConVarInt(hCvarValveSurvivalBonus, RoundToFloor(fSurvivorBonus[team] / iSurvivalMultiplier)); fSurvivorBonus[team] = float(GetConVarInt(hCvarValveSurvivalBonus) * iSurvivalMultiplier); // workaround for the discrepancy caused by RoundToFloor() - Format(sSurvivorState[team], 32, "%s%i\x01/\x05%i\x01", (iSurvivalMultiplier == iTeamSize ? "\x05" : "\x04"), iSurvivalMultiplier, iTeamSize); + FormatEx(sSurvivorState[team], 32, "%s%i\x01/\x05%i\x01", (iSurvivalMultiplier == iTeamSize ? "\x05" : "\x04"), iSurvivalMultiplier, iTeamSize); #if SM2_DEBUG PrintToChatAll("\x01Survival bonus cvar updated. Value: \x05%i\x01 [multiplier: \x05%i\x01]", GetConVarInt(hCvarValveSurvivalBonus), iSurvivalMultiplier); #endif @@ -415,7 +415,7 @@ public Action:L4D2_OnEndVersusModeRound(bool:countSurvivors) { fSurvivorBonus[team] = 0.0; SetConVarInt(hCvarValveSurvivalBonus, 0); - Format(sSurvivorState[team], 32, "\x04%s\x01", (iSurvivalMultiplier == 0 ? "wiped out" : "bonus depleted")); + FormatEx(sSurvivorState[team], 32, "\x04%s\x01", (iSurvivalMultiplier == 0 ? "wiped out" : "bonus depleted")); bTiebreakerEligibility[team] = (iSurvivalMultiplier == iTeamSize); } diff --git a/addons/sourcemod/scripting/l4d2_incap_fire_fix.sp b/addons/sourcemod/scripting/l4d2_incap_fire_fix.sp new file mode 100644 index 000000000..5ac3a2899 --- /dev/null +++ b/addons/sourcemod/scripting/l4d2_incap_fire_fix.sp @@ -0,0 +1,43 @@ +#pragma semicolon 1 +#pragma newdecls required + +#include +#include + +#define BUFFER_TIME 0.5 +bool g_bBlocked[MAXPLAYERS + 1]; + +public Plugin myinfo = +{ + name = "[L4D/2] Incap Fire Fix", + author = "Sir", + description = "Lets incapacitated survivors fire their weapon normally (with sound) while holding shove", + version = "1.0.1", + url = "https://github.com/SirPlease/L4D2-Competitive-Rework" +}; + +public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon) +{ + if (!IsClientInGame(client) || GetClientTeam(client) != 2) + return Plugin_Continue; + + if (GetEntProp(client, Prop_Send, "m_isIncapacitated", 1) > 0) + { + int wep = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"); + if (wep != -1 && GetEntProp(wep, Prop_Send, "m_iClip1") > 0) + { + SetEntPropFloat(wep, Prop_Send, "m_flNextSecondaryAttack", GetGameTime() + BUFFER_TIME); + g_bBlocked[client] = true; + } + } + else if (g_bBlocked[client]) + { + int wep = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"); + if (wep != -1) + SetEntPropFloat(wep, Prop_Send, "m_flNextSecondaryAttack", GetGameTime()); + + g_bBlocked[client] = false; + } + + return Plugin_Continue; +} diff --git a/addons/sourcemod/scripting/l4d2_penalty_bonus.sp b/addons/sourcemod/scripting/l4d2_penalty_bonus.sp index 3c8329945..71c55cea5 100644 --- a/addons/sourcemod/scripting/l4d2_penalty_bonus.sp +++ b/addons/sourcemod/scripting/l4d2_penalty_bonus.sp @@ -86,7 +86,7 @@ public Plugin myinfo = name = "Penalty bonus system", author = "Tabun, A1m`", description = "Allows other plugins to set bonuses for a round that will be given even if the saferoom is not reached.", - version = "2.1", + version = "2.1.1", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -326,12 +326,12 @@ void DisplayBonus(int iClient = -1) for (int iRound = 0; iRound <= iRoundNum; iRound++) { if (g_bRoundOver[iRound]) { - Format(sMsgPartHdr, sizeof(sMsgPartHdr), "Round \x05%i\x01 extra bonus", iRound + 1); + FormatEx(sMsgPartHdr, sizeof(sMsgPartHdr), "Round \x05%i\x01 extra bonus", iRound + 1); } else { - Format(sMsgPartHdr, sizeof(sMsgPartHdr), "Current extra bonus"); + strcopy(sMsgPartHdr, sizeof(sMsgPartHdr), "Current extra bonus"); } - Format(sMsgPartBon, sizeof(sMsgPartBon), "\x04%4d\x01", g_iBonus[iRound]); + FormatEx(sMsgPartBon, sizeof(sMsgPartBon), "\x04%4d\x01", g_iBonus[iRound]); if (g_iDefibsUsed[iRound]) { Format(sMsgPartBon, sizeof(sMsgPartBon), "%s (- \x04%d\x01 defib penalty)", sMsgPartBon, g_iOriginalPenalty * g_iDefibsUsed[iRound]); @@ -354,9 +354,9 @@ void ReportChange(int iBonusChange, int iClient = -1, bool bAbsoluteSet = false) // report bonus to all char sMsgPartBon[48]; if (bAbsoluteSet) { // set to a specific value - Format(sMsgPartBon, sizeof(sMsgPartBon), "Extra bonus set to: \x04%i\x01", g_iBonus[RoundNum()]); + FormatEx(sMsgPartBon, sizeof(sMsgPartBon), "Extra bonus set to: \x04%i\x01", g_iBonus[RoundNum()]); } else { - Format(sMsgPartBon, sizeof(sMsgPartBon), "Extra bonus change: %s\x04%i\x01", (iBonusChange > 0) ? "\x04+\x01" : "\x03-\x01", RoundFloat(FloatAbs(float(iBonusChange)))); + FormatEx(sMsgPartBon, sizeof(sMsgPartBon), "Extra bonus change: %s\x04%i\x01", (iBonusChange > 0) ? "\x04+\x01" : "\x03-\x01", RoundFloat(FloatAbs(float(iBonusChange)))); } if (iClient == -1) { diff --git a/addons/sourcemod/scripting/l4d2_playstats.sp b/addons/sourcemod/scripting/l4d2_playstats.sp index 0724e1257..0d2716f35 100644 --- a/addons/sourcemod/scripting/l4d2_playstats.sp +++ b/addons/sourcemod/scripting/l4d2_playstats.sp @@ -487,7 +487,7 @@ public Plugin myinfo = name = "Player Statistics", author = "Tabun, A1m`", description = "Tracks statistics, even when clients disconnect. MVP, Skills, Accuracy, etc.", - version = "1.1.3", + version = "1.1.4", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -1328,7 +1328,7 @@ Action Cmd_StatsDisplayGeneral(int client, int args) } char bufBasic[CONBUFSIZELARGE]; - Format(bufBasic, CONBUFSIZELARGE, "|------------------------------------------------------------------------------|\n"); + strcopy(bufBasic, CONBUFSIZELARGE, "|------------------------------------------------------------------------------|\n"); Format(bufBasic, CONBUFSIZELARGE, "%s| /stats command help in chat: '/stats [argument [argument]]' |\n", bufBasic); Format(bufBasic, CONBUFSIZELARGE, "%s| in console: 'sm_stats [arguments...]' |\n", bufBasic); Format(bufBasic, CONBUFSIZELARGE, "%s|------------------------------------------------------------------------------|\n", bufBasic); @@ -1345,7 +1345,7 @@ Action Cmd_StatsDisplayGeneral(int client, int args) PrintToServer(bufBasic); } - Format(bufBasic, CONBUFSIZELARGE, "|------------------------------------------------------------------------------|\n"); + strcopy(bufBasic, CONBUFSIZELARGE, "|------------------------------------------------------------------------------|\n"); Format(bufBasic, CONBUFSIZELARGE, "%s| arguments: |\n", bufBasic); Format(bufBasic, CONBUFSIZELARGE, "%s|------------------------------------------------------------------------------|\n", bufBasic); Format(bufBasic, CONBUFSIZELARGE, "%s| 'round' ('r') / 'game' ('g') : for this round; or for entire game so far |\n", bufBasic); @@ -1360,7 +1360,7 @@ Action Cmd_StatsDisplayGeneral(int client, int args) PrintToServer(bufBasic); } - Format(bufBasic, CONBUFSIZELARGE, "|------------------------------------------------------------------------------|\n"); + strcopy(bufBasic, CONBUFSIZELARGE, "|------------------------------------------------------------------------------|\n"); Format(bufBasic, CONBUFSIZELARGE, "%s| examples: |\n", bufBasic); Format(bufBasic, CONBUFSIZELARGE, "%s|------------------------------------------------------------------------------|\n", bufBasic); Format(bufBasic, CONBUFSIZELARGE, "%s| '/stats skill round all' => shows skeets etc for all players, this round |\n", bufBasic); @@ -1548,77 +1548,77 @@ Action Cmd_Cookie_SetPrintFlags(int client, int args) int part = 0; if (iFlags & AUTO_MVPCHAT_ROUND) { - Format(tmpStr[part], 24, "mvp/chat(round)"); + strcopy(tmpStr[part], 24, "mvp/chat(round)"); part++; } if (iFlags & AUTO_MVPCHAT_GAME) { - Format(tmpStr[part], 24, "mvp/chat(game)"); + strcopy(tmpStr[part], 24, "mvp/chat(game)"); part++; } if (iFlags & AUTO_MVPCON_ROUND) { - Format(tmpStr[part], 24, "mvp(round)"); + strcopy(tmpStr[part], 24, "mvp(round)"); part++; } if (iFlags & AUTO_MVPCON_GAME) { - Format(tmpStr[part], 24, "mvp(game)"); + strcopy(tmpStr[part], 24, "mvp(game)"); part++; } if (iFlags & AUTO_MVPCON_MORE_ROUND) { - Format(tmpStr[part], 24, "mvp/more(round)"); + strcopy(tmpStr[part], 24, "mvp/more(round)"); part++; } if (iFlags & AUTO_MVPCON_MORE_GAME) { - Format(tmpStr[part], 24, "mvp/more(game)"); + strcopy(tmpStr[part], 24, "mvp/more(game)"); part++; } if (iFlags & AUTO_MVPCON_TANK) { - Format(tmpStr[part], 24, "mvp/tankfight"); + strcopy(tmpStr[part], 24, "mvp/tankfight"); part++; } if (iFlags & AUTO_SKILLCON_ROUND) { - Format(tmpStr[part], 24, "skill/special(round)"); + strcopy(tmpStr[part], 24, "skill/special(round)"); part++; } if (iFlags & AUTO_SKILLCON_GAME) { - Format(tmpStr[part], 24, "skill/special(game)"); + strcopy(tmpStr[part], 24, "skill/special(game)"); part++; } if (iFlags & AUTO_FFCON_ROUND) { - Format(tmpStr[part], 24, "ff(round)"); + strcopy(tmpStr[part], 24, "ff(round)"); part++; } if (iFlags & AUTO_FFCON_GAME) { - Format(tmpStr[part], 24, "ff(game)"); + strcopy(tmpStr[part], 24, "ff(game)"); part++; } if (iFlags & AUTO_ACCCON_ROUND) { - Format(tmpStr[part], 24, "accuracy(round)"); + strcopy(tmpStr[part], 24, "accuracy(round)"); part++; } if (iFlags & AUTO_ACCCON_GAME) { - Format(tmpStr[part], 24, "accuracy(game)"); + strcopy(tmpStr[part], 24, "accuracy(game)"); part++; } if (iFlags & AUTO_ACCCON_MORE_ROUND) { - Format(tmpStr[part], 24, "acc/more(round)"); + strcopy(tmpStr[part], 24, "acc/more(round)"); part++; } if (iFlags & AUTO_ACCCON_MORE_GAME) { - Format(tmpStr[part], 24, "acc/more(game)"); + strcopy(tmpStr[part], 24, "acc/more(game)"); part++; } @@ -3237,14 +3237,14 @@ void DisplayStats(int client = -1, int round = -1, bool bTeam = true, int iTeam FormatTimeAsDuration(strTmp, sizeof(strTmp), GetTime() - g_strGameData[gmStartTime]); LeftPadString(strTmp, sizeof(strTmp), 14); } else { - Format(strTmp, sizeof(strTmp), " (not started)"); + strcopy(strTmp, sizeof(strTmp), " (not started)"); } // spawn/kill ratio FormatPercentage(strTmpA, sizeof(strTmpA), g_strAllRoundData[team][rndSIKilled], g_strAllRoundData[team][rndSISpawned], false); // never a decimal LeftPadString(strTmpA, sizeof(strTmpA), 4); - Format(bufBasicHeader, CONBUFSIZE, "\n"); + strcopy(bufBasicHeader, CONBUFSIZE, "\n"); Format(bufBasicHeader, CONBUFSIZE, "%s| General Stats |\n", bufBasicHeader); Format(bufBasicHeader, CONBUFSIZE, "%s|----------------------|---------------------------|\n", bufBasicHeader); Format(bufBasicHeader, CONBUFSIZE, "%s| Time: %14s | Rounds/Fails: %4i /%5i |\n", bufBasicHeader, strTmp, g_iRound, g_strGameData[gmFailed]); @@ -3286,7 +3286,7 @@ void DisplayStats(int client = -1, int round = -1, bool bTeam = true, int iTeam } // round header - Format(bufBasicHeader, CONBUFSIZE, "\n| General data per game round -- %11s |\n", (bTeam) ? ((team == LTEAM_A) ? "Team A " : "Team B ") : "ALL Players"); + FormatEx(bufBasicHeader, CONBUFSIZE, "\n| General data per game round -- %11s |\n", (bTeam) ? ((team == LTEAM_A) ? "Team A " : "Team B ") : "ALL Players"); // | ###. ############### | ###h ##m ##s | ##### | ###### | ##### | ##### | #### | ##### | ###### | Format(bufBasicHeader, CONBUFSIZE, "%s|---------------------------------------------------------------------------------------------------|\n", bufBasicHeader); @@ -3427,14 +3427,14 @@ void DisplayStatsMVPChat(int client, bool bRound = true, bool bTeam = true, int if (listNumber && (client == -1 || client == found) && IS_VALID_CLIENT(found) && !IsFakeClient(found) && g_iCookieValue[found] != -1) { if (iBrevityFlags & BREV_PERCENT) { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] Your rank - SI: #\x03%d \x01(\x05%d \x01dmg,\x05 %d \x01kills)", + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] Your rank - SI: #\x03%d \x01(\x05%d \x01dmg,\x05 %d \x01kills)", (bRound) ? "" : " - Game", (i + 1), (bRound) ? g_strRoundPlayerData[index][team][plySIDamage] : g_strPlayerData[index][plySIDamage], (bRound) ? g_strRoundPlayerData[index][team][plySIKilled] : g_strPlayerData[index][plySIKilled] ); } else if (iBrevityFlags & BREV_ABSOLUTE) { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] Your rank - SI: #\x03%d \x01(dmg \x04%i%%\x01, kills \x04%i%%\x01)", + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] Your rank - SI: #\x03%d \x01(dmg \x04%i%%\x01, kills \x04%i%%\x01)", (bRound) ? "" : " - Game", (i + 1), RoundFloat((bRound) ? @@ -3446,7 +3446,7 @@ void DisplayStatsMVPChat(int client, bool bRound = true, bool bTeam = true, int ((float(g_strPlayerData[index][plySIKilled]) / float(g_strAllRoundData[team][rndSIKilled])) * 100)) ); } else { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] Your rank - SI: #\x03%d \x01(\x05%d \x01dmg [\x04%i%%\x01],\x05 %d \x01kills [\x04%i%%\x01])", + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] Your rank - SI: #\x03%d \x01(\x05%d \x01dmg [\x04%i%%\x01],\x05 %d \x01kills [\x04%i%%\x01])", (bRound) ? "" : " - Game", (i + 1), (bRound) ? g_strRoundPlayerData[index][team][plySIDamage] : g_strPlayerData[index][plySIDamage], @@ -3505,13 +3505,13 @@ void DisplayStatsMVPChat(int client, bool bRound = true, bool bTeam = true, int if (listNumber && (client == -1 || client == found) && IS_VALID_CLIENT(found) && !IsFakeClient(found) && g_iCookieValue[found] != -1) { if (iBrevityFlags & BREV_PERCENT) { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] Your rank - CI: #\x03%d \x01(\x05 %d \x01kills)", + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] Your rank - CI: #\x03%d \x01(\x05 %d \x01kills)", (bRound) ? "" : " - Game", (i + 1), (bRound) ? g_strRoundPlayerData[index][team][plyCommon] : g_strPlayerData[index][plyCommon] ); } else if (iBrevityFlags & BREV_ABSOLUTE) { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] Your rank - CI: #\x03%d \x01(kills \x04%i%%\x01)", + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] Your rank - CI: #\x03%d \x01(kills \x04%i%%\x01)", (bRound) ? "" : " - Game", (i + 1), RoundFloat((bRound) ? @@ -3520,7 +3520,7 @@ void DisplayStatsMVPChat(int client, bool bRound = true, bool bTeam = true, int ) ); } else { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] Your rank - CI: #\x03%d \x01(\x05 %d \x01kills [\x04%i%%\x01])", + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] Your rank - CI: #\x03%d \x01(\x05 %d \x01kills [\x04%i%%\x01])", (bRound) ? "" : " - Game", (i + 1), (bRound) ? g_strRoundPlayerData[index][team][plyCommon] : g_strPlayerData[index][plyCommon], @@ -3574,7 +3574,7 @@ void DisplayStatsMVPChat(int client, bool bRound = true, bool bTeam = true, int } if (listNumber && (client == -1 || client == found) && IS_VALID_CLIENT(found) && !IsFakeClient(found) && g_iCookieValue[found] != -1) { - Format(tmpBuffer, sizeof(tmpBuffer), "[LVP%s] Your rank - FF: #\x03%d \x01(\x05%d \x01dmg)", + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[LVP%s] Your rank - FF: #\x03%d \x01(\x05%d \x01dmg)", (bRound) ? "" : " - Game", (i + 1), (bRound) ? g_strRoundPlayerData[index][team][plyFFGiven] : g_strPlayerData[index][plyFFGiven] @@ -3633,20 +3633,20 @@ void GetMVPChatString(char[] printBuffer, const int iLen, bool bRound = true, bo // report if (mvp_SI == -1 && mvp_Common == -1 && !(iBrevityFlags & BREV_SI && iBrevityFlags & BREV_CI)) { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP%s]: (not enough action yet)\n", (bRound) ? "" : " - Game"); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP%s]: (not enough action yet)\n", (bRound) ? "" : " - Game"); StrCat(printBuffer, iLen, tmpBuffer); } else { if (!(iBrevityFlags & BREV_SI)) { if (mvp_SI > -1) { if (iBrevityFlags & BREV_PERCENT) { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] SI:\x03 %s \x01(\x05%d \x01dmg,\x05 %d \x01kills)\n", + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] SI:\x03 %s \x01(\x05%d \x01dmg,\x05 %d \x01kills)\n", (bRound) ? "" : " - Game", g_sPlayerName[mvp_SI], (bRound) ? g_strRoundPlayerData[mvp_SI][team][plySIDamage] : g_strPlayerData[mvp_SI][plySIDamage], (bRound) ? g_strRoundPlayerData[mvp_SI][team][plySIKilled] : g_strPlayerData[mvp_SI][plySIKilled] ); } else if (iBrevityFlags & BREV_ABSOLUTE) { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] SI:\x03 %s \x01(dmg \x04%i%%\x01, kills \x04%i%%\x01)\n", + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] SI:\x03 %s \x01(dmg \x04%i%%\x01, kills \x04%i%%\x01)\n", (bRound) ? "" : " - Game", g_sPlayerName[mvp_SI], RoundFloat((bRound) ? @@ -3659,7 +3659,7 @@ void GetMVPChatString(char[] printBuffer, const int iLen, bool bRound = true, bo ) ); } else { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] SI:\x03 %s \x01(\x05%d \x01dmg[\x04%i%%\x01],\x05 %d \x01kills [\x04%i%%\x01])\n", + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] SI:\x03 %s \x01(\x05%d \x01dmg[\x04%i%%\x01],\x05 %d \x01kills [\x04%i%%\x01])\n", (bRound) ? "" : " - Game", g_sPlayerName[mvp_SI], (bRound) ? g_strRoundPlayerData[mvp_SI][team][plySIDamage] : g_strPlayerData[mvp_SI][plySIDamage], @@ -3677,7 +3677,7 @@ void GetMVPChatString(char[] printBuffer, const int iLen, bool bRound = true, bo StrCat(printBuffer, iLen, tmpBuffer); } else { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] SI: \x03(nobody)\x01\n", (bRound) ? "" : " - Game"); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] SI: \x03(nobody)\x01\n", (bRound) ? "" : " - Game"); StrCat(printBuffer, iLen, tmpBuffer); } } @@ -3687,13 +3687,13 @@ void GetMVPChatString(char[] printBuffer, const int iLen, bool bRound = true, bo // safeguarded to only show if total common kills logged in scope if (mvp_Common > -1 && (bRound && g_strRoundData[g_iRound][team][rndCommon] || !bRound && g_strAllRoundData[team][rndCommon])) { if (iBrevityFlags & BREV_PERCENT) { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] CI:\x03 %s \x01(\x05%d \x01common)\n", + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] CI:\x03 %s \x01(\x05%d \x01common)\n", (bRound) ? "" : " - Game", g_sPlayerName[mvp_Common], (bRound) ? g_strRoundPlayerData[mvp_Common][team][plyCommon] : g_strPlayerData[mvp_Common][plyCommon] ); } else if (iBrevityFlags & BREV_ABSOLUTE) { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] CI:\x03 %s \x01(\x04%i%%\x01)\n", + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] CI:\x03 %s \x01(\x04%i%%\x01)\n", (bRound) ? "" : " - Game", g_sPlayerName[mvp_Common], RoundFloat((bRound) ? @@ -3702,7 +3702,7 @@ void GetMVPChatString(char[] printBuffer, const int iLen, bool bRound = true, bo ) ); } else { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] CI:\x03 %s \x01(\x05%d \x01common [\x04%i%%\x01])\n", + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP%s] CI:\x03 %s \x01(\x05%d \x01common [\x04%i%%\x01])\n", (bRound) ? "" : " - Game", g_sPlayerName[mvp_Common], (bRound) ? g_strRoundPlayerData[mvp_Common][team][plyCommon] : g_strPlayerData[mvp_Common][plyCommon], @@ -3721,13 +3721,13 @@ void GetMVPChatString(char[] printBuffer, const int iLen, bool bRound = true, bo // FF if (!(iBrevityFlags & BREV_FF)) { if (mvp_FF == -1) { - Format(tmpBuffer, sizeof(tmpBuffer), "[LVP%s] FF: no friendly fire at all!\n", + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[LVP%s] FF: no friendly fire at all!\n", (bRound) ? "" : " - Game" ); StrCat(printBuffer, iLen, tmpBuffer); } else { - Format(tmpBuffer, sizeof(tmpBuffer), "[LVP%s] FF:\x03 %s \x01(\x05%d \x01dmg)\n", + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[LVP%s] FF:\x03 %s \x01(\x05%d \x01dmg)\n", (bRound) ? "" : " - Game", g_sPlayerName[mvp_FF], (bRound) ? g_strRoundPlayerData[mvp_FF][team][plyFFGiven] : g_strPlayerData[mvp_FF][plyFFGiven] @@ -3759,11 +3759,11 @@ void DisplayStatsMVP(int client, bool bTank = false, bool bMore = false, bool bR if (bTank) { if (bTankUp) { - Format(bufBasicHeader, CONBUFSIZE, "\n| Survivor MVP Stats -- Tank Fight (not showing table, tank is still up...) |\n"); + strcopy(bufBasicHeader, CONBUFSIZE, "\n| Survivor MVP Stats -- Tank Fight (not showing table, tank is still up...) |\n"); Format(bufBasicHeader, CONBUFSIZE, "%s|------------------------------------------------------------------------------|", bufBasicHeader); g_iConsoleBufChunks = -1; } else { - Format(bufBasicHeader, CONBUFSIZE, "\n| Survivor MVP Stats -- Tank Fight -- %10s -- %11s |\n", + FormatEx(bufBasicHeader, CONBUFSIZE, "\n| Survivor MVP Stats -- Tank Fight -- %10s -- %11s |\n", (bRound) ? "This Round" : "ALL Rounds", (bTeam) ? ((team == LTEAM_A) ? "Team A " : "Team B ") : "ALL Players" ); @@ -3789,7 +3789,7 @@ void DisplayStatsMVP(int client, bool bTank = false, bool bMore = false, bool bR } } } else if (bMore) { - Format(bufBasicHeader, CONBUFSIZE, "\n| Survivor MVP Stats -- More Stats -- %10s -- %11s |\n", + FormatEx(bufBasicHeader, CONBUFSIZE, "\n| Survivor MVP Stats -- More Stats -- %10s -- %11s |\n", (bRound) ? "This Round" : "ALL Rounds", (bTeam) ? ((team == LTEAM_A) ? "Team A " : "Team B ") : "ALL Players" ); @@ -3816,7 +3816,7 @@ void DisplayStatsMVP(int client, bool bTank = false, bool bMore = false, bool bR ); } } else { - Format(bufBasicHeader, CONBUFSIZE, + FormatEx(bufBasicHeader, CONBUFSIZE, "\n| Survivor MVP Stats -- %10s -- %11s |\n", (bRound) ? "This Round" : "ALL Rounds", (bTeam) ? ((team == LTEAM_A) ? "Team A " : "Team B ") : "ALL Players" @@ -3856,14 +3856,14 @@ void DisplayStatsMVP(int client, bool bTank = false, bool bMore = false, bool bR FormatTimeAsDuration(strTmp[0], s_len, fullTime, false); RightPadString(strTmp[0], s_len, 13); } else { - FormatEx(strTmp[0], s_len, "(not started)"); + strcopy(strTmp[0], s_len, "(not started)"); } if (tankTime) { FormatTimeAsDuration(strTmp[1], s_len, tankTime, false); RightPadString(strTmp[1], s_len, 13); } else { - FormatEx(strTmp[1], s_len, " "); + strcopy(strTmp[1], s_len, " "); } if (g_bPauseAvailable) { @@ -3871,10 +3871,10 @@ void DisplayStatsMVP(int client, bool bTank = false, bool bMore = false, bool bR FormatTimeAsDuration(strTmp[2], s_len, pauseTime, false); RightPadString(strTmp[2], s_len, 13); } else { - FormatEx(strTmp[2], s_len, " "); + strcopy(strTmp[2], s_len, " "); } } else { - FormatEx(strTmp[2], s_len, " "); + strcopy(strTmp[2], s_len, " "); } FormatEx(bufBasicFooter, CONBUFSIZE, @@ -4167,28 +4167,28 @@ void GetFunFactChatString(char[] printBuffer, const int iLen, bool bRound = true switch (wPick) { case FFACT_TYPE_CROWN: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01crowned \x05%d \x01witches.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01crowned \x05%d \x01witches.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick] ); } case FFACT_TYPE_DRAWCROWN: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01draw-crowned \x05%d \x01witches.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01draw-crowned \x05%d \x01witches.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick] ); } case FFACT_TYPE_SKEETS: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01skeeted \x05%d \x01hunters.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01skeeted \x05%d \x01hunters.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick] ); } case FFACT_TYPE_MELEESKEETS: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01skeeted \x05%d \x01hunter%s with a melee weapon.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01skeeted \x05%d \x01hunter%s with a melee weapon.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick], @@ -4196,42 +4196,42 @@ void GetFunFactChatString(char[] printBuffer, const int iLen, bool bRound = true ); } case FFACT_TYPE_M2: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01shoved \x05%d \x01special infected.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01shoved \x05%d \x01special infected.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick] ); } case FFACT_TYPE_MELEETANK: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01got \x05%d \x01melee swings on the tank.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01got \x05%d \x01melee swings on the tank.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick] ); } case FFACT_TYPE_CUT: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01cut \x05%d \x01tongue cuts.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01cut \x05%d \x01tongue cuts.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick] ); } case FFACT_TYPE_POP: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01popped \x05%d \x01boomers.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01popped \x05%d \x01boomers.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick] ); } case FFACT_TYPE_DEADSTOP: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01deadstopped \x05%d \x01hunters.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01deadstopped \x05%d \x01hunters.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick] ); } case FFACT_TYPE_LEVELS: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01fully leveled \x05%d \x01chargers.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01fully leveled \x05%d \x01chargers.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick] @@ -4239,21 +4239,21 @@ void GetFunFactChatString(char[] printBuffer, const int iLen, bool bRound = true } // infected case FFACT_TYPE_HUNTERDP: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01landed \x05%d \x01highpounces with hunters.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01landed \x05%d \x01highpounces with hunters.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick] ); } case FFACT_TYPE_JOCKEYDP: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01landed \x05%d \x01highpounces with jockeys.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01landed \x05%d \x01highpounces with jockeys.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick] ); } case FFACT_TYPE_DCHARGE: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01death-charged \x05%d \x01 survivor%s.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01death-charged \x05%d \x01 survivor%s.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick], @@ -4261,21 +4261,21 @@ void GetFunFactChatString(char[] printBuffer, const int iLen, bool bRound = true ); } case FFACT_TYPE_SCRATCH: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01did a total of \x05%d \x01damage by scratching (standing) survivors.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01did a total of \x05%d \x01damage by scratching (standing) survivors.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick] ); } case FFACT_TYPE_BOOMDMG: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01got a total of \x05%d \x01damage by common hits on boomed (standing) survivors.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01got a total of \x05%d \x01damage by common hits on boomed (standing) survivors.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick] ); } case FFACT_TYPE_SPITDMG: { - Format(printBuffer, iLen, "[%s fact] \x04%s \x01did a total of \x05%d \x01spit-damage on (standing) survivors.\n", + FormatEx(printBuffer, iLen, "[%s fact] \x04%s \x01did a total of \x05%d \x01spit-damage on (standing) survivors.\n", (bRound) ? "Round" : "Game", g_sPlayerName[ wTypeHighPly[wPick] ], wTypeHighVal[wPick] @@ -4302,7 +4302,7 @@ void DisplayStatsAccuracy(int client, bool bDetails = false, bool bRound = false char bufBasicHeader[CONBUFSIZE]; if (bDetails) { - Format(bufBasicHeader, + FormatEx(bufBasicHeader, CONBUFSIZE, "\n| Accuracy -- Details -- %10s -- %11s hits on SI; headshots on SI; hits on tank |\n", (bRound) ? "This Round" : "ALL Rounds", @@ -4330,7 +4330,7 @@ void DisplayStatsAccuracy(int client, bool bDetails = false, bool bRound = false ); } } else { - Format(bufBasicHeader, CONBUFSIZE, "\n| Accuracy Stats -- %10s -- %11s hits (pellets/bullets); acc prc; headshots prc (of hits) |\n", + FormatEx(bufBasicHeader, CONBUFSIZE, "\n| Accuracy Stats -- %10s -- %11s hits (pellets/bullets); acc prc; headshots prc (of hits) |\n", (bRound) ? "This Round" : "ALL Rounds", (bTeam) ? ((team == LTEAM_A) ? "Team A " : "Team B ") : "ALL Players" ); @@ -4419,7 +4419,7 @@ void DisplayStatsSpecial(int client, bool bRound = true, bool bTeam = true, bool char bufBasicHeader[CONBUFSIZE]; - Format(bufBasicHeader, CONBUFSIZE, + FormatEx(bufBasicHeader, CONBUFSIZE, "\n| Special -- %10s -- %11s skts(full/hurt/melee); lvl(full/hurt); crwn(full/draw) |\n", (bRound) ? "This Round" : "ALL Rounds", (bTeam) ? ((team == LTEAM_A) ? "Team A " : "Team B ") : "ALL Players" @@ -4511,7 +4511,7 @@ void DisplayStatsInfected(int client, bool bRound = true, bool bTeam = true, boo char bufBasicHeader[CONBUFSIZE]; - Format(bufBasicHeader, CONBUFSIZE, + FormatEx(bufBasicHeader, CONBUFSIZE, "\n| Infected -- %10s -- %11s |\n", (bRound) ? "This Round" : "ALL Rounds", (bTeam) ? ((team == LTEAM_A) ? "Team A " : "Team B ") : "ALL Players" @@ -4626,14 +4626,14 @@ void DisplayStatsFriendlyFire(int client, bool bRound = true, bool bTeam = true, } if (bNoStatsToShow) { - Format(bufBasicHeader, CONBUFSIZE, "\nFF: No Friendly Fire done, not showing table."); + strcopy(bufBasicHeader, CONBUFSIZE, "\nFF: No Friendly Fire done, not showing table."); g_iConsoleBufChunks = -1; } else { // prepare buffer(s) for printing BuildConsoleBufferFriendlyFireGiven(bRound, bTeam, iTeam); // friendly fire -- given - Format(bufBasicHeader,CONBUFSIZE, + FormatEx(bufBasicHeader,CONBUFSIZE, "\n| Friendly Fire -- Given / Offenders -- %10s -- %11s |\n", (bRound) ? "This Round" : "ALL Rounds", (bTeam) ? ((team == LTEAM_A) ? "Team A " : "Team B ") : "ALL Players" @@ -4710,7 +4710,7 @@ void DisplayStatsFriendlyFire(int client, bool bRound = true, bool bTeam = true, BuildConsoleBufferFriendlyFireTaken(bRound, bTeam, iTeam); // friendly fire -- taken - Format(bufBasicHeader, CONBUFSIZE, + FormatEx(bufBasicHeader, CONBUFSIZE, "\n| Friendly Fire -- Received / Victims -- %10s -- %11s |\n", (bRound) ? "This Round" : "ALL Rounds", (bTeam) ? ((team == LTEAM_A) ? "Team A " : "Team B ") : "ALL Players" @@ -4806,7 +4806,7 @@ void BuildConsoleBufferGeneral(bool bTeam = true, int iTeam = -1) Format(strTmpMap, 15, "%s", strTmpMap); } - Format(strTmp[0], s_len, "%3d. %15s", i + 1, strTmpMap); + FormatEx(strTmp[0], s_len, "%3d. %15s", i + 1, strTmpMap); // round time tmpRoundTime = 0; @@ -4820,56 +4820,56 @@ void BuildConsoleBufferGeneral(bool bTeam = true, int iTeam = -1) FormatTimeAsDuration(strTmp[1], s_len, tmpRoundTime); LeftPadString(strTmp[1], s_len, 12); } else { - Format(strTmp[1], s_len, " "); + strcopy(strTmp[1], s_len, " "); } // si if (g_strRoundData[i][team][rndSIKilled]) { - Format(strTmp[2], s_len, "%5d", g_strRoundData[i][team][rndSIKilled]); + FormatEx(strTmp[2], s_len, "%5d", g_strRoundData[i][team][rndSIKilled]); } else { - Format(strTmp[2], s_len, " "); + strcopy(strTmp[2], s_len, " "); } // common if (g_strRoundData[i][team][rndCommon]) { - Format(strTmp[3], s_len, "%6d", g_strRoundData[i][team][rndCommon]); + FormatEx(strTmp[3], s_len, "%6d", g_strRoundData[i][team][rndCommon]); } else { - Format(strTmp[3], s_len, " "); + strcopy(strTmp[3], s_len, " "); } // deaths if (g_strRoundData[i][team][rndDeaths]) { - Format(strTmp[4], s_len, "%6d", g_strRoundData[i][team][rndDeaths]); + FormatEx(strTmp[4], s_len, "%6d", g_strRoundData[i][team][rndDeaths]); } else { - Format(strTmp[4], s_len, " "); + strcopy(strTmp[4], s_len, " "); } // incaps if (g_strRoundData[i][team][rndIncaps]) { - Format(strTmp[5], s_len, "%6d", g_strRoundData[i][team][rndIncaps]); + FormatEx(strTmp[5], s_len, "%6d", g_strRoundData[i][team][rndIncaps]); } else { - Format(strTmp[5], s_len, " "); + strcopy(strTmp[5], s_len, " "); } // kits if (g_strRoundData[i][team][rndKitsUsed]) { - Format(strTmp[6], s_len, "%4d", g_strRoundData[i][team][rndKitsUsed]); + FormatEx(strTmp[6], s_len, "%4d", g_strRoundData[i][team][rndKitsUsed]); } else { - Format(strTmp[6], s_len, " "); + strcopy(strTmp[6], s_len, " "); } // pills if (g_strRoundData[i][team][rndPillsUsed]) { - Format(strTmp[7], s_len, "%6d", g_strRoundData[i][team][rndPillsUsed]); + FormatEx(strTmp[7], s_len, "%6d", g_strRoundData[i][team][rndPillsUsed]); } else { - Format(strTmp[7], s_len, " "); + strcopy(strTmp[7], s_len, " "); } // restarts if (g_strRoundData[i][team][rndRestarts]) { - Format(strTmp[8], s_len, "%8d", g_strRoundData[i][team][rndRestarts]); + FormatEx(strTmp[8], s_len, "%8d", g_strRoundData[i][team][rndRestarts]); } else { - Format(strTmp[8], s_len, " "); + strcopy(strTmp[8], s_len, " "); } // cut into chunks: @@ -4935,70 +4935,70 @@ void BuildConsoleBufferSpecial(bool bRound = false, bool bTeam = true, int iTeam if (bRound && (g_strRoundPlayerData[i][team][plySkeets] || g_strRoundPlayerData[i][team][plySkeetsHurt] || g_strRoundPlayerData[i][team][plySkeetsMelee]) || !bRound && (g_strPlayerData[i][plySkeets] || g_strPlayerData[i][plySkeetsHurt] || g_strPlayerData[i][plySkeetsMelee]) ) { - Format(strTmp[0], s_len, "%4d /%4d /%4d", + FormatEx(strTmp[0], s_len, "%4d /%4d /%4d", ((bRound) ? g_strRoundPlayerData[i][team][plySkeets] : g_strPlayerData[i][plySkeets]), ((bRound) ? g_strRoundPlayerData[i][team][plySkeetsHurt] : g_strPlayerData[i][plySkeetsHurt]), ((bRound) ? g_strRoundPlayerData[i][team][plySkeetsMelee] : g_strPlayerData[i][plySkeetsMelee]) ); } else { - Format(strTmp[0], s_len, " "); + strcopy(strTmp[0], s_len, " "); } // levels if (bRound && (g_strRoundPlayerData[i][team][plyLevels] || g_strRoundPlayerData[i][team][plyLevelsHurt]) || !bRound && (g_strPlayerData[i][plyLevels] || g_strPlayerData[i][plyLevelsHurt]) ) { - Format(strTmp[1], s_len, "%3d /%4d", + FormatEx(strTmp[1], s_len, "%3d /%4d", ((bRound) ? g_strRoundPlayerData[i][team][plyLevels] : g_strPlayerData[i][plyLevels]), ((bRound) ? g_strRoundPlayerData[i][team][plyLevelsHurt] : g_strPlayerData[i][plyLevelsHurt]) ); } else { - Format(strTmp[1], s_len, " "); + strcopy(strTmp[1], s_len, " "); } // crowns if (bRound && (g_strRoundPlayerData[i][team][plyCrowns] || g_strRoundPlayerData[i][team][plyCrownsHurt]) || !bRound && (g_strPlayerData[i][plyCrowns] || g_strPlayerData[i][plyCrownsHurt]) ) { - Format(strTmp[2], s_len, "%3d /%4d", + FormatEx(strTmp[2], s_len, "%3d /%4d", ((bRound) ? g_strRoundPlayerData[i][team][plyCrowns] : g_strPlayerData[i][plyCrowns]), ((bRound) ? g_strRoundPlayerData[i][team][plyCrownsHurt] : g_strPlayerData[i][plyCrownsHurt]) ); } else { - Format(strTmp[2], s_len, " "); + strcopy(strTmp[2], s_len, " "); } // pops if (bRound && g_strRoundPlayerData[i][team][plyPops] || !bRound && g_strPlayerData[i][plyPops]) { - Format(strTmp[3], s_len, "%4d", + FormatEx(strTmp[3], s_len, "%4d", ((bRound) ? g_strRoundPlayerData[i][team][plyPops] : g_strPlayerData[i][plyPops]) ); } else { - Format(strTmp[3], s_len, " "); + strcopy(strTmp[3], s_len, " "); } // cuts if (bRound && (g_strRoundPlayerData[i][team][plyTongueCuts] || g_strRoundPlayerData[i][team][plySelfClears]) || !bRound && (g_strPlayerData[i][plyTongueCuts] || g_strPlayerData[i][plySelfClears]) ) { - Format(strTmp[4], s_len, "%4d /%5d", + FormatEx(strTmp[4], s_len, "%4d /%5d", ((bRound) ? g_strRoundPlayerData[i][team][plyTongueCuts] : g_strPlayerData[i][plyTongueCuts]), ((bRound) ? g_strRoundPlayerData[i][team][plySelfClears] : g_strPlayerData[i][plySelfClears]) ); } else { - Format(strTmp[4], s_len, " "); + strcopy(strTmp[4], s_len, " "); } // deadstops & m2s if (bRound && (g_strRoundPlayerData[i][team][plyShoves] || g_strRoundPlayerData[i][team][plyDeadStops]) || !bRound && (g_strPlayerData[i][plyShoves] || g_strPlayerData[i][plyDeadStops]) ) { - Format(strTmp[5], s_len, "%4d /%4d", + FormatEx(strTmp[5], s_len, "%4d /%4d", ((bRound) ? g_strRoundPlayerData[i][team][plyDeadStops] : g_strPlayerData[i][plyDeadStops]), ((bRound) ? g_strRoundPlayerData[i][team][plyShoves] : g_strPlayerData[i][plyShoves]) ); } else { - Format(strTmp[5], s_len, " "); + strcopy(strTmp[5], s_len, " "); } // cut into chunks: @@ -5069,53 +5069,53 @@ void BuildConsoleBufferInfected(bool bRound = false, bool bTeam = true, int iTea if (bRound && (g_strRoundPlayerInfData[i][team][infDmgTotal]) || !bRound && (g_strPlayerInfData[i][infDmgTotal]) ) { - Format(strTmp[0], s_len, "%5d / %5d", + FormatEx(strTmp[0], s_len, "%5d / %5d", ((bRound) ? g_strRoundPlayerInfData[i][team][infDmgUpright] : g_strPlayerInfData[i][infDmgUpright]), ((bRound) ? g_strRoundPlayerInfData[i][team][infDmgTotal] : g_strPlayerInfData[i][infDmgTotal]) ); } else { - Format(strTmp[0], s_len, " "); + strcopy(strTmp[0], s_len, " "); } // commons if (bRound && (g_strRoundPlayerInfData[i][team][infCommon]) || !bRound && (g_strPlayerInfData[i][infCommon]) ) { - Format(strTmp[1], s_len, " %5d", + FormatEx(strTmp[1], s_len, " %5d", ((bRound) ? g_strRoundPlayerInfData[i][team][infCommon] : g_strPlayerInfData[i][infCommon]) ); } else { - Format(strTmp[1], s_len, " "); + strcopy(strTmp[1], s_len, " "); } // hunter dps if (bRound && (g_strRoundPlayerInfData[i][team][infHunterDPs]) || !bRound && (g_strPlayerInfData[i][infHunterDPs]) ) { - Format(strTmp[2], s_len, " %3d /%5d", + FormatEx(strTmp[2], s_len, " %3d /%5d", ((bRound) ? g_strRoundPlayerInfData[i][team][infHunterDPs] : g_strPlayerInfData[i][infHunterDPs]), ((bRound) ? g_strRoundPlayerInfData[i][team][infHunterDPDmg] : g_strPlayerInfData[i][infHunterDPDmg]) ); } else { - Format(strTmp[2], s_len, " "); + strcopy(strTmp[2], s_len, " "); } // deathcharges if (bRound && g_strRoundPlayerInfData[i][team][infDeathCharges] || !bRound && g_strPlayerInfData[i][infDeathCharges]) { - Format(strTmp[3], s_len, " %4d", + FormatEx(strTmp[3], s_len, " %4d", ((bRound) ? g_strRoundPlayerInfData[i][team][infDeathCharges] : g_strPlayerInfData[i][infDeathCharges]) ); } else { - Format(strTmp[3], s_len, " "); + strcopy(strTmp[3], s_len, " "); } // spawns if (bRound && g_strRoundPlayerInfData[i][team][infSpawns] || !bRound && g_strPlayerInfData[i][infSpawns]) { - Format(strTmp[4], s_len, " %4d", + FormatEx(strTmp[4], s_len, " %4d", ((bRound) ? g_strRoundPlayerInfData[i][team][infSpawns] : g_strPlayerInfData[i][infSpawns]) ); } else { - Format(strTmp[4], s_len, " "); + strcopy(strTmp[4], s_len, " "); } // time (%) @@ -5209,12 +5209,12 @@ void BuildConsoleBufferAccuracy(bool details = false, bool bRound = false, bool // shotgun: if (bRound && g_strRoundPlayerData[i][team][plyHitsShotgun] || !bRound && g_strPlayerData[i][plyHitsShotgun]) { - Format(strTmp[0], s_len, "%7d %7d", + FormatEx(strTmp[0], s_len, "%7d %7d", ((bRound) ? g_strRoundPlayerData[i][team][plyHitsSIShotgun] : g_strPlayerData[i][plyHitsSIShotgun]), ((bRound) ? g_strRoundPlayerData[i][team][plyHitsTankShotgun] : g_strPlayerData[i][plyHitsTankShotgun]) ); } else { - Format(strTmp[0], s_len, " "); + strcopy(strTmp[0], s_len, " "); } // smg: @@ -5229,13 +5229,13 @@ void BuildConsoleBufferAccuracy(bool details = false, bool bRound = false, bool Format(strTmpA, s_len, " %s", strTmpA); } - Format(strTmp[1], s_len, "%6d %5s%%%% %5d", + FormatEx(strTmp[1], s_len, "%6d %5s%%%% %5d", ((bRound) ? g_strRoundPlayerData[i][team][plyHitsSISmg] : g_strPlayerData[i][plyHitsSISmg]), strTmpA, ((bRound) ? g_strRoundPlayerData[i][team][plyHitsTankSmg] : g_strPlayerData[i][plyHitsTankSmg]) ); } else { - Format(strTmp[1], s_len, " "); + strcopy(strTmp[1], s_len, " "); } // sniper: @@ -5250,13 +5250,13 @@ void BuildConsoleBufferAccuracy(bool details = false, bool bRound = false, bool Format(strTmpA, s_len, " %s", strTmpA); } - Format(strTmp[2], s_len, "%6d %5s%%%% %5d", + FormatEx(strTmp[2], s_len, "%6d %5s%%%% %5d", ((bRound) ? g_strRoundPlayerData[i][team][plyHitsSISniper] : g_strPlayerData[i][plyHitsSISniper]), strTmpA, ((bRound) ? g_strRoundPlayerData[i][team][plyHitsTankSniper] : g_strPlayerData[i][plyHitsTankSniper]) ); } else { - Format(strTmp[2], s_len, " "); + strcopy(strTmp[2], s_len, " "); } // pistols: @@ -5271,13 +5271,13 @@ void BuildConsoleBufferAccuracy(bool details = false, bool bRound = false, bool Format(strTmpA, s_len, " %s", strTmpA); } - Format(strTmp[3], s_len, "%6d %5s%%%% %5d", + FormatEx(strTmp[3], s_len, "%6d %5s%%%% %5d", ((bRound) ? g_strRoundPlayerData[i][team][plyHitsSIPistol] : g_strPlayerData[i][plyHitsSIPistol]), strTmpA, ((bRound) ? g_strRoundPlayerData[i][team][plyHitsTankPistol] : g_strPlayerData[i][plyHitsTankPistol]) ); } else { - Format(strTmp[3], s_len, " "); + strcopy(strTmp[3], s_len, " "); } // cut into chunks: @@ -5335,12 +5335,12 @@ void BuildConsoleBufferAccuracy(bool details = false, bool bRound = false, bool Format(strTmpA, s_len, " %s", strTmpA); } - Format(strTmp[0], s_len, "%7d %5s%%%%", + FormatEx(strTmp[0], s_len, "%7d %5s%%%%", ((bRound) ? g_strRoundPlayerData[i][team][plyHitsShotgun] : g_strPlayerData[i][plyHitsShotgun]), strTmpA ); } else { - Format(strTmp[0], s_len, " "); + strcopy(strTmp[0], s_len, " "); } // smg: @@ -5365,13 +5365,13 @@ void BuildConsoleBufferAccuracy(bool details = false, bool bRound = false, bool Format(strTmpB, s_len, " %s", strTmpB); } - Format(strTmp[1], s_len, "%5d %5s%%%% %5s%%%%", + FormatEx(strTmp[1], s_len, "%5d %5s%%%% %5s%%%%", ((bRound) ? g_strRoundPlayerData[i][team][plyHitsSmg] : g_strPlayerData[i][plyHitsSmg]), strTmpA, strTmpB ); } else { - Format(strTmp[1], s_len, " "); + strcopy(strTmp[1], s_len, " "); } // sniper: @@ -5396,13 +5396,13 @@ void BuildConsoleBufferAccuracy(bool details = false, bool bRound = false, bool Format(strTmpB, s_len, " %s", strTmpB); } - Format(strTmp[2], s_len, "%5d %5s%%%% %5s%%%%", + FormatEx(strTmp[2], s_len, "%5d %5s%%%% %5s%%%%", ((bRound) ? g_strRoundPlayerData[i][team][plyHitsSniper] : g_strPlayerData[i][plyHitsSniper]), strTmpA, strTmpB ); } else { - Format(strTmp[2], s_len, " "); + strcopy(strTmp[2], s_len, " "); } // pistols: @@ -5427,13 +5427,13 @@ void BuildConsoleBufferAccuracy(bool details = false, bool bRound = false, bool Format(strTmpB, s_len, " %s", strTmpB); } - Format(strTmp[3], s_len, "%5d %5s%%%% %5s%%%%", + FormatEx(strTmp[3], s_len, "%5d %5s%%%% %5s%%%%", ((bRound) ? g_strRoundPlayerData[i][team][plyHitsPistol] : g_strPlayerData[i][plyHitsPistol]), strTmpA, strTmpB ); } else { - Format(strTmp[3], s_len, " "); + strcopy(strTmp[3], s_len, " "); } // cut into chunks: @@ -5511,7 +5511,7 @@ void BuildConsoleBufferMVP(bool bTank = false, bool bMore = false, bool bRound = ((bRound) ? g_strRoundPlayerData[i][team][plySIDamageTankUp] : g_strPlayerData[i][plySIDamageTankUp]) ); } else { - FormatEx(strTmp[0], s_len, " "); + strcopy(strTmp[0], s_len, " "); } // commons @@ -5520,7 +5520,7 @@ void BuildConsoleBufferMVP(bool bTank = false, bool bMore = false, bool bRound = ((bRound) ? g_strRoundPlayerData[i][team][plyCommonTankUp] : g_strPlayerData[i][plyCommonTankUp]) ); } else { - FormatEx(strTmp[1], s_len, " "); + strcopy(strTmp[1], s_len, " "); } // melee on tank @@ -5529,7 +5529,7 @@ void BuildConsoleBufferMVP(bool bTank = false, bool bMore = false, bool bRound = ((bRound) ? g_strRoundPlayerData[i][team][plyMeleesOnTank] : g_strPlayerData[i][plyMeleesOnTank]) ); } else { - FormatEx(strTmp[2], s_len, " "); + strcopy(strTmp[2], s_len, " "); } // rock skeets / eats ----- / ----- @@ -5541,7 +5541,7 @@ void BuildConsoleBufferMVP(bool bTank = false, bool bMore = false, bool bRound = ((bRound) ? g_strRoundPlayerData[i][team][plyRockEats] : g_strPlayerData[i][plyRockEats]) ); } else { - FormatEx(strTmp[3], s_len, " "); + strcopy(strTmp[3], s_len, " "); } // cut into chunks: @@ -5612,7 +5612,7 @@ void BuildConsoleBufferMVP(bool bTank = false, bool bMore = false, bool bRound = FormatPercentage(strTmpA, s_len, presTime, fullTime, false); // never a decimal LeftPadString(strTmpA, s_len, 7); - FormatEx(strTmpA, s_len, "%7s%s", + Format(strTmpA, s_len, "%7s%s", strTmpA, (presTime) ? "%%" : " " ); @@ -5621,10 +5621,10 @@ void BuildConsoleBufferMVP(bool bTank = false, bool bMore = false, bool bRound = FormatTimeAsDuration(strTmpB, s_len, presTime); LeftPadString(strTmpB, s_len, 13); } else { - Format(strTmpB, s_len, " "); + strcopy(strTmpB, s_len, " "); } - Format(strTmp[0], s_len, "%13s %8s", strTmpB, strTmpA); + FormatEx(strTmp[0], s_len, "%13s %8s", strTmpB, strTmpA); // time alive if (bRound) { @@ -5738,14 +5738,14 @@ void BuildConsoleBufferMVP(bool bTank = false, bool bMore = false, bool bRound = LeftPadString(strTmpA, s_len, 5); - Format(strTmp[0], s_len, "%4d %8d %5s%s", + FormatEx(strTmp[0], s_len, "%4d %8d %5s%s", (bRound) ? g_strRoundPlayerData[i][team][plySIKilled] : g_strPlayerData[i][plySIKilled], (bRound) ? g_strRoundPlayerData[i][team][plySIDamage] : g_strPlayerData[i][plySIDamage], strTmpA, (bRound && g_strRoundPlayerData[i][team][plySIDamage] || !bRound && g_strPlayerData[i][plySIDamage]) ? "%%" : " " ); } else { - FormatEx(strTmp[0], s_len, " " ); + strcopy(strTmp[0], s_len, " " ); } // commons @@ -5763,20 +5763,20 @@ void BuildConsoleBufferMVP(bool bTank = false, bool bMore = false, bool bRound = (bRound && g_strRoundPlayerData[i][team][plyCommon] || !bRound && g_strPlayerData[i][plyCommon]) ? "%%" : " " ); } else { - FormatEx(strTmp[1], s_len, " "); + strcopy(strTmp[1], s_len, " "); } // tank if (bTankUp) { // hide - FormatEx(strTmp[2], s_len, "%s", "hidden"); + strcopy(strTmp[2], s_len, "hidden"); } else { if (bRound && g_strRoundPlayerData[i][team][plyTankDamage] || !bRound && g_strPlayerData[i][plyTankDamage]) { FormatEx(strTmp[2], s_len, "%6d", (bRound) ? g_strRoundPlayerData[i][team][plyTankDamage] : g_strPlayerData[i][plyTankDamage] ); } else { - FormatEx(strTmp[2], s_len, " "); + strcopy(strTmp[2], s_len, " "); } } @@ -5786,7 +5786,7 @@ void BuildConsoleBufferMVP(bool bTank = false, bool bMore = false, bool bRound = (bRound) ? g_strRoundPlayerData[i][team][plyWitchDamage] : g_strPlayerData[i][plyWitchDamage] ); } else { - FormatEx(strTmp[3], s_len, " "); + strcopy(strTmp[3], s_len, " "); } // ff @@ -5795,7 +5795,7 @@ void BuildConsoleBufferMVP(bool bTank = false, bool bMore = false, bool bRound = (bRound) ? g_strRoundPlayerData[i][team][plyFFGiven] : g_strPlayerData[i][plyFFGiven] ); } else { - FormatEx(strTmp[4], s_len, " "); + strcopy(strTmp[4], s_len, " "); } // damage received @@ -5804,7 +5804,7 @@ void BuildConsoleBufferMVP(bool bTank = false, bool bMore = false, bool bRound = (bRound) ? g_strRoundPlayerData[i][team][plyDmgTaken] : g_strPlayerData[i][plyDmgTaken] ); } else { - FormatEx(strTmp[5], s_len, " "); + strcopy(strTmp[5], s_len, " "); } // time (%) @@ -5907,49 +5907,49 @@ void BuildConsoleBufferFriendlyFireGiven(bool bRound = true, bool bTeam = true, if (!bRound && g_strPlayerData[i][plyFFGivenTotal] || bRound && g_strRoundPlayerData[i][team][plyFFGivenTotal]) { FormatEx(strPrint[FFTYPE_TOTAL], s_len, "%7d", (!bRound) ? g_strPlayerData[i][plyFFGivenTotal] : g_strRoundPlayerData[i][team][plyFFGivenTotal]); } else { - FormatEx(strPrint[FFTYPE_TOTAL], s_len, " "); + strcopy(strPrint[FFTYPE_TOTAL], s_len, " "); } if (!bRound && g_strPlayerData[i][plyFFGivenPellet] || bRound && g_strRoundPlayerData[i][team][plyFFGivenPellet]) { FormatEx(strPrint[FFTYPE_PELLET], s_len, "%7d", (!bRound) ? g_strPlayerData[i][plyFFGivenPellet] : g_strRoundPlayerData[i][team][plyFFGivenPellet]); } else { - FormatEx(strPrint[FFTYPE_PELLET], s_len, " "); + strcopy(strPrint[FFTYPE_PELLET], s_len, " "); } if (!bRound && g_strPlayerData[i][plyFFGivenBullet] || bRound && g_strRoundPlayerData[i][team][plyFFGivenBullet]) { FormatEx(strPrint[FFTYPE_BULLET], s_len, "%7d", (!bRound) ? g_strPlayerData[i][plyFFGivenBullet] : g_strRoundPlayerData[i][team][plyFFGivenBullet]); } else { - FormatEx(strPrint[FFTYPE_BULLET], s_len, " "); + strcopy(strPrint[FFTYPE_BULLET], s_len, " "); } if (!bRound && g_strPlayerData[i][plyFFGivenMelee] || bRound && g_strRoundPlayerData[i][team][plyFFGivenMelee]) { FormatEx(strPrint[FFTYPE_MELEE], s_len, "%6d", (!bRound) ? g_strPlayerData[i][plyFFGivenMelee] : g_strRoundPlayerData[i][team][plyFFGivenMelee]); } else { - FormatEx(strPrint[FFTYPE_MELEE], s_len, " "); + strcopy(strPrint[FFTYPE_MELEE], s_len, " "); } if (!bRound && g_strPlayerData[i][plyFFGivenFire] || bRound && g_strRoundPlayerData[i][team][plyFFGivenFire]) { FormatEx(strPrint[FFTYPE_FIRE], s_len, "%6d", (!bRound) ? g_strPlayerData[i][plyFFGivenFire] : g_strRoundPlayerData[i][team][plyFFGivenFire]); } else { - FormatEx(strPrint[FFTYPE_FIRE], s_len, " "); + strcopy(strPrint[FFTYPE_FIRE], s_len, " "); } if (!bRound && g_strPlayerData[i][plyFFGivenIncap] || bRound && g_strRoundPlayerData[i][team][plyFFGivenIncap]) { FormatEx(strPrint[FFTYPE_INCAP], s_len, "%8d", (!bRound) ? g_strPlayerData[i][plyFFGivenIncap] : g_strRoundPlayerData[i][team][plyFFGivenIncap]); } else { - FormatEx(strPrint[FFTYPE_INCAP], s_len, " "); + strcopy(strPrint[FFTYPE_INCAP], s_len, " "); } if (!bRound && g_strPlayerData[i][plyFFGivenOther] || bRound && g_strRoundPlayerData[i][team][plyFFGivenOther]) { FormatEx(strPrint[FFTYPE_OTHER], s_len, "%6d", (!bRound) ? g_strPlayerData[i][plyFFGivenOther] : g_strRoundPlayerData[i][team][plyFFGivenOther]); } else { - FormatEx(strPrint[FFTYPE_OTHER], s_len, " "); + strcopy(strPrint[FFTYPE_OTHER], s_len, " "); } if (!bRound && g_strPlayerData[i][plyFFGivenSelf] || bRound && g_strRoundPlayerData[i][team][plyFFGivenSelf]) { FormatEx(strPrint[FFTYPE_SELF], s_len, "%7d", (!bRound) ? g_strPlayerData[i][plyFFGivenSelf] : g_strRoundPlayerData[i][team][plyFFGivenSelf]); } else { - FormatEx(strPrint[FFTYPE_SELF], s_len, " "); + strcopy(strPrint[FFTYPE_SELF], s_len, " "); } // cut into chunks: @@ -6025,49 +6025,49 @@ void BuildConsoleBufferFriendlyFireTaken (bool bRound = true, bool bTeam = true, if (!bRound && g_strPlayerData[i][plyFFTakenTotal] || bRound && g_strRoundPlayerData[i][team][plyFFTakenTotal]) { FormatEx(strPrint[FFTYPE_TOTAL], s_len, "%7d", (!bRound) ? g_strPlayerData[i][plyFFTakenTotal] : g_strRoundPlayerData[i][team][plyFFTakenTotal]); } else { - FormatEx(strPrint[FFTYPE_TOTAL], s_len, " "); + strcopy(strPrint[FFTYPE_TOTAL], s_len, " "); } if (!bRound && g_strPlayerData[i][plyFFTakenPellet] || !bRound && g_strRoundPlayerData[i][team][plyFFTakenPellet]) { FormatEx(strPrint[FFTYPE_PELLET], s_len, "%7d", (!bRound) ? g_strPlayerData[i][plyFFTakenPellet] : g_strRoundPlayerData[i][team][plyFFTakenPellet]); } else { - FormatEx(strPrint[FFTYPE_PELLET], s_len, " "); + strcopy(strPrint[FFTYPE_PELLET], s_len, " "); } if (!bRound && g_strPlayerData[i][plyFFTakenBullet] || bRound && g_strRoundPlayerData[i][team][plyFFTakenBullet]) { FormatEx(strPrint[FFTYPE_BULLET], s_len, "%7d", (!bRound) ? g_strPlayerData[i][plyFFTakenBullet] : g_strRoundPlayerData[i][team][plyFFTakenBullet]); } else { - FormatEx(strPrint[FFTYPE_BULLET], s_len, " "); + strcopy(strPrint[FFTYPE_BULLET], s_len, " "); } if (!bRound && g_strPlayerData[i][plyFFTakenMelee] || bRound && g_strRoundPlayerData[i][team][plyFFTakenMelee]) { FormatEx(strPrint[FFTYPE_MELEE], s_len, "%6d", (!bRound) ? g_strPlayerData[i][plyFFTakenMelee] : g_strRoundPlayerData[i][team][plyFFTakenMelee]); } else { - FormatEx(strPrint[FFTYPE_MELEE], s_len, " "); + strcopy(strPrint[FFTYPE_MELEE], s_len, " "); } if (!bRound && g_strPlayerData[i][plyFFTakenFire] || bRound && g_strRoundPlayerData[i][team][plyFFTakenFire]) { FormatEx(strPrint[FFTYPE_FIRE], s_len, "%6d", (!bRound) ? g_strPlayerData[i][plyFFTakenFire] : g_strRoundPlayerData[i][team][plyFFTakenFire]); } else { - FormatEx(strPrint[FFTYPE_FIRE], s_len, " "); + strcopy(strPrint[FFTYPE_FIRE], s_len, " "); } if (!bRound && g_strPlayerData[i][plyFFTakenIncap] || bRound && g_strRoundPlayerData[i][team][plyFFTakenIncap]) { FormatEx(strPrint[FFTYPE_INCAP], s_len, "%8d", (!bRound) ? g_strPlayerData[i][plyFFTakenIncap] : g_strRoundPlayerData[i][team][plyFFTakenIncap]); } else { - FormatEx(strPrint[FFTYPE_INCAP], s_len, " "); + strcopy(strPrint[FFTYPE_INCAP], s_len, " "); } if (!bRound && g_strPlayerData[i][plyFFTakenOther] || bRound && g_strRoundPlayerData[i][team][plyFFTakenOther]) { FormatEx(strPrint[FFTYPE_OTHER], s_len, "%6d", (!bRound) ? g_strPlayerData[i][plyFFTakenOther] : g_strRoundPlayerData[i][team][plyFFTakenOther]); } else { - FormatEx(strPrint[FFTYPE_OTHER], s_len, " "); + strcopy(strPrint[FFTYPE_OTHER], s_len, " "); } if (!bRound && g_strPlayerData[i][plyFallDamage] || bRound && g_strRoundPlayerData[i][team][plyFallDamage]) { FormatEx(strPrint[FFTYPE_SELF], s_len, "%7d", (!bRound) ? g_strRoundPlayerData[i][team][plyFallDamage] : g_strPlayerData[i][plyFallDamage]); } else { - FormatEx(strPrint[FFTYPE_SELF], s_len, " "); + strcopy(strPrint[FFTYPE_SELF], s_len, " "); } // cut into chunks: @@ -7002,7 +7002,7 @@ int GetWeaponTypeForClassname(const char[] classname) int GetPlayerIndexForClient(int client) { - if (client < 1 || client >= MaxClients || !IsClientInGame(client)) { + if (client < 1 || client > MaxClients || !IsClientInGame(client)) { return -1; } @@ -7010,7 +7010,7 @@ int GetPlayerIndexForClient(int client) // fake clients: if (IsFakeClient(client)) { - Format(sSteamId, sizeof(sSteamId), "BOT_%i", GetPlayerCharacter(client)); + FormatEx(sSteamId, sizeof(sSteamId), "BOT_%i", GetPlayerCharacter(client)); } else { GetClientAuthId(client, AuthId_Steam2, sSteamId, sizeof(sSteamId)); } @@ -7374,7 +7374,7 @@ void WriteStatsToFile(int iTeam, bool bSecondHalf) // only print this once (after both rounds played) if (!bFirstWrite) { // scores (both rounds) - FormatEx(strTmpLine, sizeof(strTmpLine), "[Scoring:]\n"); + strcopy(strTmpLine, sizeof(strTmpLine), "[Scoring:]\n"); StrCat(sStats, sizeof(sStats), strTmpLine); // the scores don't match A/B logical teams, but first/second team to play survivor @@ -7389,7 +7389,7 @@ void WriteStatsToFile(int iTeam, bool bSecondHalf) StrCat(sStats, sizeof(sStats), strTmpLine); // player names - FormatEx(strTmpLine, sizeof(strTmpLine), "[PlayerNames:]:\n"); + strcopy(strTmpLine, sizeof(strTmpLine), "[PlayerNames:]:\n"); StrCat(sStats, sizeof(sStats), strTmpLine); iPlayerCount = 0; @@ -7551,13 +7551,13 @@ void FormatTimeAsDuration(char[] text, int maxlength, int time, bool bPad = true char[] tmp = new char[maxlength]; if (time < 1) { - Format(text, maxlength, ""); + strcopy(text, maxlength, ""); return; } if (time > 3600) { int tmpHr = RoundToFloor(float(time) / 3600.0); - Format(tmp, maxlength, "%ih", tmpHr); + FormatEx(tmp, maxlength, "%ih", tmpHr); time -= (tmpHr * 3600); } @@ -7567,7 +7567,7 @@ void FormatTimeAsDuration(char[] text, int maxlength, int time, bool bPad = true } int tmpMin = RoundToFloor(float(time) / 60.0); - Format(tmp, maxlength, "%s%im", (bPad && tmpMin < 10) ? " " : "" , tmpMin); + FormatEx(tmp, maxlength, "%s%im", (bPad && tmpMin < 10) ? " " : "" , tmpMin); time -= (tmpMin * 60); } @@ -7583,7 +7583,7 @@ void FormatPercentage(char[] text, int maxlength, int part, int whole, bool bDec char[] strTmp = new char[maxlength]; if (!whole || !part) { - FormatEx(strTmp, maxlength, ""); + strcopy(strTmp, maxlength, ""); strcopy(text, maxlength, strTmp); return; } diff --git a/addons/sourcemod/scripting/l4d2_setscores.sp b/addons/sourcemod/scripting/l4d2_setscores.sp index c41af54ac..9a893fede 100644 --- a/addons/sourcemod/scripting/l4d2_setscores.sp +++ b/addons/sourcemod/scripting/l4d2_setscores.sp @@ -22,7 +22,7 @@ #define L4D_TEAM_SPECTATE 1 -#define PLUGIN_VERSION "1.5" +#define PLUGIN_VERSION "1.5.2" public Plugin myinfo = { @@ -92,9 +92,10 @@ Action Command_SetScores(int client, int args) bool IsAdmin = false; //Determine whether the user is admin and what action to take - if (GetUserAdmin(client) != INVALID_ADMIN_ID) { + //client 0 is the server console/RCON, which is always authorized and sets the scores directly + if (!client || GetUserAdmin(client) != INVALID_ADMIN_ID) { //If we are forcing admins to start votes, start a vote - if (!forceAdminsToVote.BoolValue) { + if (!client || !forceAdminsToVote.BoolValue) { SetScores(tempSurvivorScore, tempInfectedScore, client); return Plugin_Handled; } @@ -145,7 +146,7 @@ void StartScoreVote(const int survScore, const int infectScore, const int initia //Set the text for the vote, initiating client and handler char sBuffer[64]; - Format(sBuffer, sizeof(sBuffer), "Change scores to %d - %d?", survivorScore, infectedScore); + FormatEx(sBuffer, sizeof(sBuffer), "Change scores to %d - %d?", survivorScore, infectedScore); SetBuiltinVoteArgument(voteHandler, sBuffer); SetBuiltinVoteInitiator(voteHandler, initiator); SetBuiltinVoteResultCallback(voteHandler, ScoreVoteResultHandler); diff --git a/addons/sourcemod/scripting/l4d2_skill_detect.sp b/addons/sourcemod/scripting/l4d2_skill_detect.sp index 4f1989d9b..80cabb9a9 100644 --- a/addons/sourcemod/scripting/l4d2_skill_detect.sp +++ b/addons/sourcemod/scripting/l4d2_skill_detect.sp @@ -61,7 +61,7 @@ #include #include -#define PLUGIN_VERSION "1.1.2" +#define PLUGIN_VERSION "1.1.3" #define SHOTGUN_BLAST_TIME 0.1 #define POUNCE_CHECK_TIME 0.1 @@ -559,7 +559,7 @@ public void OnPluginStart() g_hCarTrie = CreateTrie(); static char logFile[PLATFORM_MAX_PATH]; - Format(logFile, sizeof(logFile), "/logs/l4d2_skill_detect.log"); + strcopy(logFile, sizeof(logFile), "/logs/l4d2_skill_detect.log"); BuildPath(Path_SM, g_sDebugFile, PLATFORM_MAX_PATH, logFile); if (g_bLateLoad) @@ -761,7 +761,7 @@ stock void LoadTranslation(const char[] translation) sPath[PLATFORM_MAX_PATH], sName[64]; - Format(sName, sizeof(sName), "translations/%s.txt", translation); + FormatEx(sName, sizeof(sName), "translations/%s.txt", translation); BuildPath(Path_SM, sPath, sizeof(sPath), sName); if (!FileExists(sPath)) { diff --git a/addons/sourcemod/scripting/l4d2_stats.sp b/addons/sourcemod/scripting/l4d2_stats.sp index ee4076d60..6bf822935 100644 --- a/addons/sourcemod/scripting/l4d2_stats.sp +++ b/addons/sourcemod/scripting/l4d2_stats.sp @@ -41,7 +41,7 @@ public Plugin myinfo = name = "L4D2 Realtime Stats", author = "Griffin, Philogl, Sir, A1m`", description = "Display Skeets/Etc to Chat to clients", - version = "1.2.3", + version = "1.2.4", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" } @@ -338,7 +338,7 @@ void Event_PlayerDeath(Event hEvent, const char[] sEventName, bool bDontBroadcas GetClientName(g_iBoomerClient, Boomer, sizeof(Boomer)); } else { - Format(Boomer, sizeof(Boomer), "AI"); + strcopy(Boomer, sizeof(Boomer), "AI"); } } else { @@ -347,7 +347,7 @@ void Event_PlayerDeath(Event hEvent, const char[] sEventName, bool bDontBroadcas GetClientName(victim, Boomer, sizeof(Boomer)); } else { - Format(Boomer, sizeof(Boomer), "AI"); + strcopy(Boomer, sizeof(Boomer), "AI"); } } //////// @@ -424,13 +424,13 @@ void Event_PlayerDeath(Event hEvent, const char[] sEventName, bool bDontBroadcas int assist_shots = g_iShotsDealt[victim][assisters[0][0]]; // Construct assisters string - Format(assister_string, sizeof(assister_string), "%N (%d/%d shot%s)", + FormatEx(assister_string, sizeof(assister_string), "%N (%d/%d shot%s)", assisters[0][0], assisters[0][1], g_iShotsDealt[victim][assisters[0][0]], assist_shots == 1 ? "" : "s"); for (i = 1; i < assister_count; i++) { assist_shots = g_iShotsDealt[victim][assisters[i][0]]; - Format(buf, sizeof(buf), ", %N (%d/%d shot%s)", assisters[i][0], assisters[i][1], assist_shots, assist_shots == 1 ? "" : "s"); + FormatEx(buf, sizeof(buf), ", %N (%d/%d shot%s)", assisters[i][0], assisters[i][1], assist_shots, assist_shots == 1 ? "" : "s"); StrCat(assister_string, sizeof(assister_string), buf); } diff --git a/addons/sourcemod/scripting/l4d2_tank_announce.sp b/addons/sourcemod/scripting/l4d2_tank_announce.sp index 542a57f41..2175630e9 100644 --- a/addons/sourcemod/scripting/l4d2_tank_announce.sp +++ b/addons/sourcemod/scripting/l4d2_tank_announce.sp @@ -11,7 +11,7 @@ #include #define REQUIRE_PLUGIN -#define PLUGIN_VERSION "1.4" +#define PLUGIN_VERSION "1.4.1" #define DANG "ui/pickup_secret01.wav" public Plugin myinfo = @@ -54,7 +54,7 @@ public void L4D_OnSpawnTank_Post(int client, const float vecPos[3], const float } else { - FormatEx(nameBuf, sizeof(nameBuf), "AI"); + strcopy(nameBuf, sizeof(nameBuf), "AI"); } } } diff --git a/addons/sourcemod/scripting/l4d2_tank_horde_monitor.sp b/addons/sourcemod/scripting/l4d2_tank_horde_monitor.sp index 9bb8315ee..2b88bfa2a 100644 --- a/addons/sourcemod/scripting/l4d2_tank_horde_monitor.sp +++ b/addons/sourcemod/scripting/l4d2_tank_horde_monitor.sp @@ -43,7 +43,7 @@ public Plugin myinfo = name = "L4D2 Tank Horde Monitor", author = "Derpduck, Visor (l4d2_horde_equaliser)", description = "Monitors and changes state of infinite hordes during tanks", - version = "1.3", + version = "1.3.1", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -343,7 +343,7 @@ stock void LoadTranslation(const char[] translation) sPath[PLATFORM_MAX_PATH], sName[64]; - Format(sName, sizeof(sName), "translations/%s.txt", translation); + FormatEx(sName, sizeof(sName), "translations/%s.txt", translation); BuildPath(Path_SM, sPath, sizeof(sPath), sName); if (!FileExists(sPath)) SetFailState("Missing translation file %s.txt", translation); diff --git a/addons/sourcemod/scripting/l4d2_tankrage.sp b/addons/sourcemod/scripting/l4d2_tankrage.sp index 9582fa958..de41eed49 100644 --- a/addons/sourcemod/scripting/l4d2_tankrage.sp +++ b/addons/sourcemod/scripting/l4d2_tankrage.sp @@ -23,7 +23,7 @@ public Plugin myinfo = name = "L4D2 Tank Rage", author = "Sir", description = "Manage Tank Rage when Survivors are running back.", - version = "1.0.2", + version = "1.0.3", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -219,7 +219,7 @@ stock void LoadTranslation(const char[] translation) sPath[PLATFORM_MAX_PATH], sName[64]; - Format(sName, sizeof(sName), "translations/%s.txt", translation); + FormatEx(sName, sizeof(sName), "translations/%s.txt", translation); BuildPath(Path_SM, sPath, sizeof(sPath), sName); if (!FileExists(sPath)) SetFailState("Missing translation file %s.txt", translation); diff --git a/addons/sourcemod/scripting/l4d_boss_percent.sp b/addons/sourcemod/scripting/l4d_boss_percent.sp index b38dfa84b..8971b6dd4 100644 --- a/addons/sourcemod/scripting/l4d_boss_percent.sp +++ b/addons/sourcemod/scripting/l4d_boss_percent.sp @@ -26,7 +26,7 @@ out what's going on :D Kinda makes my other plugins look bad huh :/ #include #include -#define PLUGIN_VERSION "3.2.6" +#define PLUGIN_VERSION "3.2.7" public Plugin myinfo = { @@ -661,11 +661,11 @@ Action Timer_UpdateReadyUpFooter(Handle timer) } else if (g_bCvarWitchPercent) // Display just Witch Percent { - FormatEx(p_sNewFooter, sizeof(p_sNewFooter), "%s", p_sWitchString); + strcopy(p_sNewFooter, sizeof(p_sNewFooter), p_sWitchString); } else if (g_bCvarTankPercent) // Display just Tank Percent { - FormatEx(p_sNewFooter, sizeof(p_sNewFooter), "%s", p_sTankString); + strcopy(p_sNewFooter, sizeof(p_sNewFooter), p_sTankString); } // Check to see if the Ready Up footer has already been added diff --git a/addons/sourcemod/scripting/l4d_boss_vote.sp b/addons/sourcemod/scripting/l4d_boss_vote.sp index e7076d739..27fc6266c 100644 --- a/addons/sourcemod/scripting/l4d_boss_vote.sp +++ b/addons/sourcemod/scripting/l4d_boss_vote.sp @@ -11,7 +11,7 @@ #include #include -#define PLUGIN_VERSION "3.2.6" +#define PLUGIN_VERSION "3.2.8" public Plugin myinfo = { @@ -82,6 +82,12 @@ bool RunVoteChecks(int client) Action VoteBossCmd(int client, int args) { + if (!client || !IsClientInGame(client)) + { + ReplyToCommand(client, "[Boss Vote] This command can only be used by an in-game player."); + return Plugin_Handled; + } + if (!GetConVarBool(g_hCvarBossVoting)) { return Plugin_Handled; } @@ -164,43 +170,43 @@ Action VoteBossCmd(int client, int args) // Set vote title if (bv_bTank && bv_bWitch) // Both Tank and Witch can be changed { - Format(bv_voteTitle, 64, "%T", "SetBosses", LANG_SERVER, bv_sTank, bv_sWitch); + FormatEx(bv_voteTitle, 64, "%T", "SetBosses", LANG_SERVER, bv_sTank, bv_sWitch); } else if (bv_bTank) // Only Tank can be changed { if (bv_iWitch == 0) { - Format(bv_voteTitle, 64, "%T", "SetTank", LANG_SERVER, bv_sTank); + FormatEx(bv_voteTitle, 64, "%T", "SetTank", LANG_SERVER, bv_sTank); } else { - Format(bv_voteTitle, 64, "%T", "SetOnlyTank", LANG_SERVER, bv_sTank); + FormatEx(bv_voteTitle, 64, "%T", "SetOnlyTank", LANG_SERVER, bv_sTank); } } else if (bv_bWitch) // Only Witch can be changed { if (bv_iTank == 0) { - Format(bv_voteTitle, 64, "%T", "SetWitch", LANG_SERVER, bv_sWitch); + FormatEx(bv_voteTitle, 64, "%T", "SetWitch", LANG_SERVER, bv_sWitch); } else { - Format(bv_voteTitle, 64, "%T", "SetOnlyWitch", LANG_SERVER, bv_sWitch); + FormatEx(bv_voteTitle, 64, "%T", "SetOnlyWitch", LANG_SERVER, bv_sWitch); } } else // Neither can be changed... ok... { if (bv_iTank == 0 && bv_iWitch == 0) { - Format(bv_voteTitle, 64, "%T", "SetBossesDisabled", LANG_SERVER); + FormatEx(bv_voteTitle, 64, "%T", "SetBossesDisabled", LANG_SERVER); } else if (bv_iTank == 0) { - Format(bv_voteTitle, 64, "%T", "SetTankDisabled", LANG_SERVER); + FormatEx(bv_voteTitle, 64, "%T", "SetTankDisabled", LANG_SERVER); } else if (bv_iWitch == 0) { - Format(bv_voteTitle, 64, "%T", "SetWitchDisabled", LANG_SERVER); + FormatEx(bv_voteTitle, 64, "%T", "SetWitchDisabled", LANG_SERVER); } else // Probably not. { @@ -253,25 +259,25 @@ void BossVoteResultHandler(Handle vote, int num_votes, int num_clients, const in if (bv_bTank && bv_bWitch) // Both Tank and Witch can be changed { char buffer[64]; - Format(buffer, sizeof(buffer), "%T", "SettingBoss", LANG_SERVER); + FormatEx(buffer, sizeof(buffer), "%T", "SettingBoss", LANG_SERVER); DisplayBuiltinVotePass(vote, buffer); } else if (bv_bTank) // Only Tank can be changed -- Witch must be static { char buffer[64]; - Format(buffer, sizeof(buffer), "%T", "SettingTank", LANG_SERVER); + FormatEx(buffer, sizeof(buffer), "%T", "SettingTank", LANG_SERVER); DisplayBuiltinVotePass(vote, buffer); } else if (bv_bWitch) // Only Witch can be changed -- Tank must be static { char buffer[64]; - Format(buffer, sizeof(buffer), "%T", "SettingWitch", LANG_SERVER); + FormatEx(buffer, sizeof(buffer), "%T", "SettingWitch", LANG_SERVER); DisplayBuiltinVotePass(vote, buffer); } else // Neither can be changed... ok... { char buffer[64]; - Format(buffer, sizeof(buffer), "%T", "SettingBossDisabled", LANG_SERVER); + FormatEx(buffer, sizeof(buffer), "%T", "SettingBossDisabled", LANG_SERVER); DisplayBuiltinVotePass(vote, buffer); } @@ -334,49 +340,52 @@ bool IsInteger(const char[] buffer) Action ForceTankCommand(int client, int args) { + if (client && !IsClientInGame(client)) + return Plugin_Handled; + if (!GetConVarBool(g_hCvarBossVoting)) { return Plugin_Handled; } if (IsDarkCarniRemix()) { - CPrintToChat(client, "%t", "CommandNotAvailable"); + CReplyToCommand(client, "%t", "CommandNotAvailable"); return Plugin_Handled; } - + if (IsStaticTankMap()) { - CPrintToChat(client, "%t", "TankSpawnStatic"); + CReplyToCommand(client, "%t", "TankSpawnStatic"); return Plugin_Handled; } - + if (!IsInReady()) { - CPrintToChat(client, "%t", "OnlyReadyUp"); + CReplyToCommand(client, "%t", "OnlyReadyUp"); return Plugin_Handled; } - + // Get Requested Tank Percent char bv_sTank[32]; GetCmdArg(1, bv_sTank, 32); - + // Make sure the cmd argument is a number if (!IsInteger(bv_sTank)) return Plugin_Handled; - + // Convert it to in int boy int p_iRequestedPercent = StringToInt(bv_sTank); - + if (p_iRequestedPercent < 0) { - CPrintToChat(client, "%t", "PercentageInvalid"); + CReplyToCommand(client, "%t", "PercentageInvalid"); return Plugin_Handled; } - + // Check if percent is within limits if (!IsTankPercentValid(p_iRequestedPercent)) { - CPrintToChat(client, "%t", "Percentagebanned"); + CReplyToCommand(client, "%t", "Percentagebanned"); return Plugin_Handled; } @@ -402,49 +411,52 @@ Action ForceTankCommand(int client, int args) Action ForceWitchCommand(int client, int args) { + if (client && !IsClientInGame(client)) + return Plugin_Handled; + if (!GetConVarBool(g_hCvarBossVoting)) { return Plugin_Handled; } if (IsDarkCarniRemix()) { - CPrintToChat(client, "%t", "CommandNotAvailable"); + CReplyToCommand(client, "%t", "CommandNotAvailable"); return Plugin_Handled; } - + if (IsStaticWitchMap()) { - CPrintToChat(client, "%t", "WitchSpawnStatic"); + CReplyToCommand(client, "%t", "WitchSpawnStatic"); return Plugin_Handled; } - + if (!IsInReady()) { - CPrintToChat(client, "%t", "OnlyReadyUp"); + CReplyToCommand(client, "%t", "OnlyReadyUp"); return Plugin_Handled; } - + // Get Requested Witch Percent char bv_sWitch[32]; GetCmdArg(1, bv_sWitch, 32); - + // Make sure the cmd argument is a number if (!IsInteger(bv_sWitch)) return Plugin_Handled; - + // Convert it to in int boy int p_iRequestedPercent = StringToInt(bv_sWitch); - + if (p_iRequestedPercent < 0) { - CPrintToChat(client, "%t", "PercentageInvalid"); + CReplyToCommand(client, "%t", "PercentageInvalid"); return Plugin_Handled; } - + // Check if percent is within limits if (!IsWitchPercentValid(p_iRequestedPercent)) { - CPrintToChat(client, "%t", "Percentagebanned"); + CReplyToCommand(client, "%t", "Percentagebanned"); return Plugin_Handled; } diff --git a/addons/sourcemod/scripting/l4d_console_spam.sp b/addons/sourcemod/scripting/l4d_console_spam.sp index be3952dfc..076f23d81 100644 --- a/addons/sourcemod/scripting/l4d_console_spam.sp +++ b/addons/sourcemod/scripting/l4d_console_spam.sp @@ -18,7 +18,7 @@ -#define PLUGIN_VERSION "1.3b" +#define PLUGIN_VERSION "1.3c" /*====================================================================================== Plugin Info: @@ -105,7 +105,7 @@ public void OnPluginStart() while( loop <= MAX_PATCHES ) { - Format(sTemp, sizeof(sTemp), "SpamPatch_Sig%d", loop); + FormatEx(sTemp, sizeof(sTemp), "SpamPatch_Sig%d", loop); patchAddr = GameConfGetAddress(hGameData, sTemp); if( patchAddr ) diff --git a/addons/sourcemod/scripting/l4d_tank_control_eq.sp b/addons/sourcemod/scripting/l4d_tank_control_eq.sp index ff5ff4a82..d5c4221ca 100644 --- a/addons/sourcemod/scripting/l4d_tank_control_eq.sp +++ b/addons/sourcemod/scripting/l4d_tank_control_eq.sp @@ -54,7 +54,7 @@ public Plugin myinfo = name = "L4D2 Tank Control", author = "arti, (Contributions by: Sheo, Sir, Altair-Sossai)", description = "Distributes the role of the tank evenly throughout the team, allows for overrides. (Includes forwards)", - version = "0.0.27", + version = "0.0.29", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" } @@ -416,7 +416,7 @@ void PlayerDeath_Event(Event hEvent, const char[] eName, bool dontBroadcast) Action Tank_Cmd(int client, int args) { // Only output if client is in-game and we have a queued tank - if (!IsClientInGame(client) || StrEqual(queuedTankSteamId, "")) + if (!client || !IsClientInGame(client) || StrEqual(queuedTankSteamId, "")) return Plugin_Handled; int tankClientId = getInfectedPlayerBySteamId(queuedTankSteamId); @@ -450,7 +450,10 @@ Action TankShuffle_Cmd(int client, int args) * Give the tank to a specific player. */ Action GiveTank_Cmd(int client, int args) -{ +{ + if (client && !IsClientInGame(client)) + return Plugin_Handled; + // Who are we targetting? char arg1[32]; GetCmdArg(1, arg1, sizeof(arg1)); @@ -460,14 +463,14 @@ Action GiveTank_Cmd(int client, int args) if (target == -1 || !IsClientInGame(target) || IsFakeClient(target)) { - CPrintToChat(client, "%t %t", "TagControl", "InvalidTarget"); + CReplyToCommand(client, "%t %t", "TagControl", "InvalidTarget"); return Plugin_Handled; } // Checking if on our desired team if (!IS_INFECTED(target)) { - CPrintToChat(client, "%t %t", "TagControl", "NoInfected", target); + CReplyToCommand(client, "%t %t", "TagControl", "NoInfected", target); return Plugin_Handled; } @@ -738,7 +741,7 @@ stock void LoadTranslation(const char[] translation) sPath[PLATFORM_MAX_PATH], sName[64]; - Format(sName, sizeof(sName), "translations/%s.txt", translation); + FormatEx(sName, sizeof(sName), "translations/%s.txt", translation); BuildPath(Path_SM, sPath, sizeof(sPath), sName); if (!FileExists(sPath)) SetFailState("Missing translation file %s.txt", translation); diff --git a/addons/sourcemod/scripting/l4d_weapon_limits.sp b/addons/sourcemod/scripting/l4d_weapon_limits.sp index 41a9707e6..33d05da5e 100644 --- a/addons/sourcemod/scripting/l4d_weapon_limits.sp +++ b/addons/sourcemod/scripting/l4d_weapon_limits.sp @@ -58,7 +58,7 @@ public Plugin myinfo = name = "L4D Weapon Limits", author = "CanadaRox, Stabby, Forgetest, A1m`, robex", description = "Restrict weapons individually or together", - version = "2.2.3", + version = "2.2.4", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -573,7 +573,7 @@ stock void LoadTranslation(const char[] translation) sPath[PLATFORM_MAX_PATH], sName[64]; - Format(sName, sizeof(sName), "translations/%s.txt", translation); + FormatEx(sName, sizeof(sName), "translations/%s.txt", translation); BuildPath(Path_SM, sPath, sizeof(sPath), sName); if (!FileExists(sPath)) SetFailState("Missing translation file %s.txt", translation); diff --git a/addons/sourcemod/scripting/l4dd/l4dd_natives.sp b/addons/sourcemod/scripting/l4dd/l4dd_natives.sp index f515ba15d..761412cff 100644 --- a/addons/sourcemod/scripting/l4dd/l4dd_natives.sp +++ b/addons/sourcemod/scripting/l4dd/l4dd_natives.sp @@ -476,7 +476,7 @@ int Native_VS_GetMapNumber(Handle plugin, int numParams) // Native "L4D2_VScript char buffer[8]; // Code - FormatEx(code, sizeof(code), "ret <- Director.GetMapNumber(); ret"); + strcopy(code, sizeof(code), "ret <- Director.GetMapNumber(); ret"); // Exec if( GetVScriptOutput(code, buffer, sizeof(buffer)) ) diff --git a/addons/sourcemod/scripting/match_vote.sp b/addons/sourcemod/scripting/match_vote.sp index 28cf56063..43dd0e92f 100644 --- a/addons/sourcemod/scripting/match_vote.sp +++ b/addons/sourcemod/scripting/match_vote.sp @@ -36,7 +36,7 @@ public Plugin myinfo = name = "Match Vote", author = "vintik, Sir, StarterX4", description = "!match !rmatch !chmatch - Change Hostname and Slots while you're at it!", - version = "1.5", + version = "1.5.1", url = "https://github.com/L4D-Community/L4D2-Competitive-Framework" }; @@ -126,15 +126,20 @@ public void OnCedapugEnded() Action MatchRequest(int iClient, int iArgs) { - if (!g_hEnabled.BoolValue) + if (!iClient) { - CPrintToChat(iClient, "%t %t", "Tag", "Disabled"); + CReplyToCommand(iClient, "%t %t", "Tag", "NoConsole"); return Plugin_Handled; } - if (!iClient) + if (!IsClientInGame(iClient)) { - CReplyToCommand(iClient, "%t %t", "Tag", "NoConsole"); + return Plugin_Handled; + } + + if (!g_hEnabled.BoolValue) + { + CPrintToChat(iClient, "%t %t", "Tag", "Disabled"); return Plugin_Handled; } @@ -366,15 +371,20 @@ void MatchVoteResultHandler(Handle vote, int num_votes, int num_clients, const i Action MatchReset(int iClient, int iArgs) { - if (!g_hEnabled.BoolValue) + if (!iClient) { - CPrintToChat(iClient, "%t %t", "Tag", "Disabled"); + CReplyToCommand(iClient, "%t %t", "Tag", "NoConsole"); return Plugin_Handled; } - if (!iClient) + if (!IsClientInGame(iClient)) { - CReplyToCommand(iClient, "%t %t", "Tag", "NoConsole"); + return Plugin_Handled; + } + + if (!g_hEnabled.BoolValue) + { + CPrintToChat(iClient, "%t %t", "Tag", "Disabled"); return Plugin_Handled; } @@ -461,15 +471,20 @@ void ResetMatchVoteResultHandler(Handle vote, int num_votes, int num_clients, co Action ChangeMatchRequest(int iClient, int iArgs) { - if (!g_hEnabled.BoolValue) + if (!iClient) { - CPrintToChat(iClient, "%t %t", "Tag", "Disabled"); + CReplyToCommand(iClient, "%t %t", "Tag", "NoConsole"); return Plugin_Handled; } - if (!iClient) + if (!IsClientInGame(iClient)) { - CReplyToCommand(iClient, "%t %t", "Tag", "NoConsole"); + return Plugin_Handled; + } + + if (!g_hEnabled.BoolValue) + { + CPrintToChat(iClient, "%t %t", "Tag", "Disabled"); return Plugin_Handled; } diff --git a/addons/sourcemod/scripting/pause.sp b/addons/sourcemod/scripting/pause.sp index 493ed6e50..fb29b0776 100644 --- a/addons/sourcemod/scripting/pause.sp +++ b/addons/sourcemod/scripting/pause.sp @@ -35,7 +35,7 @@ public Plugin myinfo = name = "Pause plugin", author = "CanadaRox, Sir, Forgetest, A1m`", description = "Adds pause functionality without breaking pauses, also prevents SI from spawning because of the Pause.", - version = "6.8", + version = "6.8.2", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -623,13 +623,13 @@ void UpdatePanel() menuPanel.DrawText(" "); char Titlebuffer[32]; - Format(Titlebuffer, sizeof(Titlebuffer), "%T", "PanelTitle", LANG_SERVER); + FormatEx(Titlebuffer, sizeof(Titlebuffer), "%T", "PanelTitle", LANG_SERVER); menuPanel.DrawText(Titlebuffer); if (adminPause && initiatorId > 0) { char buffer[32]; - Format(buffer, sizeof(buffer), "%T", "RequireAdmin", LANG_SERVER); + FormatEx(buffer, sizeof(buffer), "%T", "RequireAdmin", LANG_SERVER); menuPanel.DrawText(buffer); menuPanel.DrawText(teamReady[L4D2Team_Survivor] ? SurvivorUnPaused() : SurvivorPaused() ); menuPanel.DrawText(teamReady[L4D2Team_Infected] ? InfectedUnPaused() : InfectedPaused() ); @@ -658,12 +658,12 @@ void UpdatePanel() if (adminPause) { - if (!initiatorId) Format(info, sizeof(info), "%T", "AutoPauseCrash", LANG_SERVER); - else Format(info, sizeof(info), "%T", "ForcePauseAdmin", LANG_SERVER, strlen(name) ? name : initiatorName); + if (!initiatorId) FormatEx(info, sizeof(info), "%T", "AutoPauseCrash", LANG_SERVER); + else FormatEx(info, sizeof(info), "%T", "ForcePauseAdmin", LANG_SERVER, strlen(name) ? name : initiatorName); } else { - Format(info, sizeof(info), "%T", "InitiatorPause", LANG_SERVER, strlen(name) ? name : initiatorName, L4D2_TeamName[pauseTeam]); + FormatEx(info, sizeof(info), "%T", "InitiatorPause", LANG_SERVER, strlen(name) ? name : initiatorName, L4D2_TeamName[pauseTeam]); } menuPanel.DrawText(info); @@ -784,6 +784,11 @@ void ToggleCommandListeners(bool enable) Action Callvote_Callback(int client, char[] command, int argc) { + if (!client || !IsClientInGame(client)) + { + return Plugin_Continue; + } + if (GetClientTeam(client) == L4D2Team_Spectator) { CPrintToChat(client, "%t %t", "Tag", "CallvoteNoSpec"); @@ -958,48 +963,48 @@ stock void SetClientButtons(int client, int buttons) stock char[] AsInitiator() { char buffer[64]; - Format(buffer, sizeof(buffer), "%T", "AsInitiator", LANG_SERVER); + FormatEx(buffer, sizeof(buffer), "%T", "AsInitiator", LANG_SERVER); return buffer; } stock char[] SurvivorUnPaused() { char buffer[64]; - Format(buffer, sizeof(buffer), "%T", "SurvivorUnPaused", LANG_SERVER); + FormatEx(buffer, sizeof(buffer), "%T", "SurvivorUnPaused", LANG_SERVER); return buffer; } stock char[] SurvivorPaused() { char buffer[64]; - Format(buffer, sizeof(buffer), "%T", "SurvivorPaused", LANG_SERVER); + FormatEx(buffer, sizeof(buffer), "%T", "SurvivorPaused", LANG_SERVER); return buffer; } stock char[] InfectedUnPaused() { char buffer[64]; - Format(buffer, sizeof(buffer), "%T", "InfectedUnPaused", LANG_SERVER); + FormatEx(buffer, sizeof(buffer), "%T", "InfectedUnPaused", LANG_SERVER); return buffer; } stock char[] InfectedPaused() { char buffer[64]; - Format(buffer, sizeof(buffer), "%T", "InfectedPaused", LANG_SERVER); + FormatEx(buffer, sizeof(buffer), "%T", "InfectedPaused", LANG_SERVER); return buffer; } stock char[] InitiatorUnPaused() { char buffer[64]; - Format(buffer, sizeof(buffer), "%T", "InitiatorUnPaused", LANG_SERVER); + FormatEx(buffer, sizeof(buffer), "%T", "InitiatorUnPaused", LANG_SERVER); return buffer; } stock char[] InitiatorPaused() { char buffer[64]; - Format(buffer, sizeof(buffer), "%T", "InitiatorPaused", LANG_SERVER); + FormatEx(buffer, sizeof(buffer), "%T", "InitiatorPaused", LANG_SERVER); return buffer; } \ No newline at end of file diff --git a/addons/sourcemod/scripting/playermanagement.sp b/addons/sourcemod/scripting/playermanagement.sp index c2b147996..c05a5a5a4 100644 --- a/addons/sourcemod/scripting/playermanagement.sp +++ b/addons/sourcemod/scripting/playermanagement.sp @@ -15,7 +15,7 @@ public Plugin myinfo = name = "Player Management Plugin", author = "CanadaRox", description = "Player management! Swap players/teams and spectate!", - version = "7.1", + version = "7.1.3", url = "" }; @@ -161,6 +161,11 @@ Action Spectate_Cmd(int client, int args) return Plugin_Handled; } + if (!client || !IsClientInGame(client)) + { + return Plugin_Handled; + } + L4D2Team team = GetClientTeamEx(client); if (team == L4D2Team_Survivor) { @@ -574,7 +579,7 @@ stock void LoadTranslation(const char[] translation) sPath[PLATFORM_MAX_PATH], sName[64]; - Format(sName, sizeof(sName), "translations/%s.txt", translation); + FormatEx(sName, sizeof(sName), "translations/%s.txt", translation); BuildPath(Path_SM, sPath, sizeof(sPath), sName); if (!FileExists(sPath)) { diff --git a/addons/sourcemod/scripting/ratemonitor.sp b/addons/sourcemod/scripting/ratemonitor.sp index e87f2ed4e..926674078 100644 --- a/addons/sourcemod/scripting/ratemonitor.sp +++ b/addons/sourcemod/scripting/ratemonitor.sp @@ -48,7 +48,7 @@ public Plugin myinfo = name = "RateMonitor", author = "Visor, Sir, A1m`", description = "Keep track of players' netsettings", - version = "2.6.1", + version = "2.6.2", url = "https://github.com/A1mDev/L4D2-Competitive-Plugins" }; @@ -213,7 +213,7 @@ void RegisterSettings(int client) sCounter = "[bad cmd/upd]"; Format(sCmdRate, sizeof(sCmdRate), "%s", sCmdRate); Format(sUpdateRate, sizeof(sUpdateRate), "%s", sUpdateRate); - Format(sRate, sizeof(sRate), "%d", iRate); + FormatEx(sRate, sizeof(sRate), "%d", iRate); PunishPlayer(client, sCmdRate, sUpdateRate, sRate, sCounter, iIndex); return; @@ -223,9 +223,9 @@ void RegisterSettings(int client) // Punish for low rate settings(if we're good on previous check) if ((iCmdRate < iMinCmd && iMinCmd > -1) || (iRate < iMinRate && iMinRate > -1) || (iUpdateRate < iMinUpd && iMinUpd > -1)) { sCounter = "[low cmd/update/rate]"; - Format(sCmdRate, sizeof(sCmdRate), "%s%d%s", iCmdRate < iMinCmd ? ">" : "", iCmdRate, iCmdRate < iMinCmd ? "<" : ""); - Format(sUpdateRate, sizeof(sCmdRate), "%s%d%s", iUpdateRate < iMinUpd ? ">" : "", iUpdateRate, iUpdateRate < iMinUpd ? "<" : ""); - Format(sRate, sizeof(sRate), "%s%d%s", iRate < iMinRate ? ">" : "", iRate, iRate < iMinRate ? "<" : ""); + FormatEx(sCmdRate, sizeof(sCmdRate), "%s%d%s", iCmdRate < iMinCmd ? ">" : "", iCmdRate, iCmdRate < iMinCmd ? "<" : ""); + FormatEx(sUpdateRate, sizeof(sCmdRate), "%s%d%s", iUpdateRate < iMinUpd ? ">" : "", iUpdateRate, iUpdateRate < iMinUpd ? "<" : ""); + FormatEx(sRate, sizeof(sRate), "%s%d%s", iRate < iMinRate ? ">" : "", iRate, iRate < iMinRate ? "<" : ""); PunishPlayer(client, sCmdRate, sUpdateRate, sRate, sCounter, iIndex); return; @@ -241,13 +241,13 @@ void RegisterSettings(int client) if (bIsMatchLive && iAllowedRateChanges > -1) { player.Client_Changes += 1; - Format(sCounter, sizeof(sCounter), "[%d/%d]", player.Client_Changes, iAllowedRateChanges); + FormatEx(sCounter, sizeof(sCounter), "[%d/%d]", player.Client_Changes, iAllowedRateChanges); // If not punished for bad rate settings yet, punish for overlimit rate change(if any) if (player.Client_Changes > iAllowedRateChanges) { - Format(sCmdRate, sizeof(sCmdRate), "%s%d", iCmdRate != player.Client_Cmdrate ? "*" : "", iCmdRate); - Format(sUpdateRate, sizeof(sUpdateRate), "%s%d\x01", iUpdateRate != player.Client_Updaterate ? "*" : "", iUpdateRate); - Format(sRate, sizeof(sRate), "%s%d\x01", iRate != player.Client_Rate ? "*" : "", iRate); + FormatEx(sCmdRate, sizeof(sCmdRate), "%s%d", iCmdRate != player.Client_Cmdrate ? "*" : "", iCmdRate); + FormatEx(sUpdateRate, sizeof(sUpdateRate), "%s%d\x01", iUpdateRate != player.Client_Updaterate ? "*" : "", iUpdateRate); + FormatEx(sRate, sizeof(sRate), "%s%d\x01", iRate != player.Client_Rate ? "*" : "", iRate); PunishPlayer(client, sCmdRate, sUpdateRate, sRate, sCounter, iIndex); return; diff --git a/addons/sourcemod/scripting/readyup.sp b/addons/sourcemod/scripting/readyup.sp index 186c02646..3b258d709 100644 --- a/addons/sourcemod/scripting/readyup.sp +++ b/addons/sourcemod/scripting/readyup.sp @@ -9,7 +9,7 @@ #undef REQUIRE_PLUGIN #include -#define PLUGIN_VERSION "10.2.6" +#define PLUGIN_VERSION "10.2.8" public Plugin myinfo = { diff --git a/addons/sourcemod/scripting/readyup/panel.inc b/addons/sourcemod/scripting/readyup/panel.inc index 4e9c4fa0f..3d9ce4c51 100644 --- a/addons/sourcemod/scripting/readyup/panel.inc +++ b/addons/sourcemod/scripting/readyup/panel.inc @@ -85,7 +85,7 @@ void UpdatePanel() g_cvServerNamer.GetString(ServerName, sizeof(ServerName)); l4d_ready_cfg_name.GetString(cfgName, sizeof(cfgName)); - Format(ServerBuffer, sizeof(ServerBuffer), "▸ Server: %s \n▸ Slots: %d/%d\n▸ Config: %s", ServerName, GetSeriousClientCount(), FindConVar("sv_maxplayers").IntValue, cfgName); + FormatEx(ServerBuffer, sizeof(ServerBuffer), "▸ Server: %s \n▸ Slots: %d/%d\n▸ Config: %s", ServerName, GetSeriousClientCount(), FindConVar("sv_maxplayers").IntValue, cfgName); menuPanel.DrawText(ServerBuffer); FormatTime(ServerBuffer, sizeof(ServerBuffer), "%m/%d/%Y - %I:%M%p"); @@ -157,7 +157,7 @@ void UpdatePanel() { survivorBuffer[bufLen] = '\0'; ReplaceString(survivorBuffer, sizeof(survivorBuffer), "#", "_"); - Format(nameBuf, sizeof(nameBuf), "->%d. Survivors%s", ++textCount, isTeamReadyMode ? teamReadySymbol[survivorReady] : ""); + FormatEx(nameBuf, sizeof(nameBuf), "->%d. Survivors%s", ++textCount, isTeamReadyMode ? teamReadySymbol[survivorReady] : ""); menuPanel.DrawText(nameBuf); menuPanel.DrawText(survivorBuffer); } @@ -167,7 +167,7 @@ void UpdatePanel() { infectedBuffer[bufLen] = '\0'; ReplaceString(infectedBuffer, sizeof(infectedBuffer), "#", "_"); - Format(nameBuf, sizeof(nameBuf), "->%d. Infected%s", ++textCount, isTeamReadyMode ? teamReadySymbol[infectedReady] : ""); + FormatEx(nameBuf, sizeof(nameBuf), "->%d. Infected%s", ++textCount, isTeamReadyMode ? teamReadySymbol[infectedReady] : ""); menuPanel.DrawText(nameBuf); menuPanel.DrawText(infectedBuffer); } @@ -180,7 +180,7 @@ void UpdatePanel() if (bufLen != 0) { casterBuffer[bufLen] = '\0'; - Format(nameBuf, sizeof(nameBuf), "->%d. Caster%s", ++textCount, casterCount > 1 ? "s" : ""); + FormatEx(nameBuf, sizeof(nameBuf), "->%d. Caster%s", ++textCount, casterCount > 1 ? "s" : ""); menuPanel.DrawText(nameBuf); ReplaceString(casterBuffer, sizeof(casterBuffer), "#", "_", true); menuPanel.DrawText(casterBuffer); @@ -191,7 +191,7 @@ void UpdatePanel() if (bufLen != 0) { specBuffer[bufLen] = '\0'; - Format(nameBuf, sizeof(nameBuf), "->%d. Spectator%s", ++textCount, specCount > 1 ? "s" : ""); + FormatEx(nameBuf, sizeof(nameBuf), "->%d. Spectator%s", ++textCount, specCount > 1 ? "s" : ""); menuPanel.DrawText(nameBuf); ReplaceString(specBuffer, sizeof(specBuffer), "#", "_"); if (playerCount > l4d_ready_max_players.IntValue && specCount - casterCount > 1) diff --git a/addons/sourcemod/scripting/readyup/player.inc b/addons/sourcemod/scripting/readyup/player.inc index 1af0de784..5940d06d8 100644 --- a/addons/sourcemod/scripting/readyup/player.inc +++ b/addons/sourcemod/scripting/readyup/player.inc @@ -98,6 +98,9 @@ void SetClientFrozen(int client, bool freeze) bool IsPlayer(int client) { + if (!IsClientInGame(client)) + return false; + int team = GetClientTeam(client); return (team == L4D2Team_Survivor || team == L4D2Team_Infected); } diff --git a/addons/sourcemod/scripting/si_class_announce.sp b/addons/sourcemod/scripting/si_class_announce.sp index 5418d9ac1..f79cc9bd7 100644 --- a/addons/sourcemod/scripting/si_class_announce.sp +++ b/addons/sourcemod/scripting/si_class_announce.sp @@ -7,7 +7,7 @@ #pragma semicolon 1 #pragma newdecls required -#define PLUGIN_VERSION "1.0.5" +#define PLUGIN_VERSION "1.0.6" public Plugin myinfo = { @@ -199,12 +199,12 @@ bool ProcessSIString(char[] msg, int maxlength, bool footer = false) if(footer) { - Format(translate, sizeof(translate), "%T", "SI", LANG_SERVER); + FormatEx(translate, sizeof(translate), "%T", "SI", LANG_SERVER); strcopy(msg, maxlength, translate); } else { - Format(translate, sizeof(translate), "%T", "SpecialInfected", LANG_SERVER); + FormatEx(translate, sizeof(translate), "%T", "SpecialInfected", LANG_SERVER); strcopy(msg, maxlength, translate); } @@ -269,7 +269,7 @@ stock void LoadTranslation(const char[] translation) sPath[PLATFORM_MAX_PATH], sName[64]; - Format(sName, sizeof(sName), "translations/%s.txt", translation); + FormatEx(sName, sizeof(sName), "translations/%s.txt", translation); BuildPath(Path_SM, sPath, sizeof(sPath), sName); if (!FileExists(sPath)) SetFailState("Missing translation file %s.txt", translation); diff --git a/addons/sourcemod/scripting/slots_vote.sp b/addons/sourcemod/scripting/slots_vote.sp index c33372e66..b9966949a 100644 --- a/addons/sourcemod/scripting/slots_vote.sp +++ b/addons/sourcemod/scripting/slots_vote.sp @@ -17,7 +17,7 @@ public Plugin myinfo = name = "Slots?! Voter", description = "Slots Voter", author = "Sir", - version = "", + version = "1.0", url = "https://github.com/SirPlease/L4D2-Competitive-Rework/" }; @@ -99,7 +99,7 @@ bool StartSlotVote(int client, char[] Slots) } char sBuffer[64]; - Format(sBuffer, sizeof(sBuffer), "%T", "LimitSlots", LANG_SERVER, Slots); + FormatEx(sBuffer, sizeof(sBuffer), "%T", "LimitSlots", LANG_SERVER, Slots); g_hVote = CreateBuiltinVote(VoteActionHandler, BuiltinVoteType_Custom_YesNo, BuiltinVoteAction_Cancel | BuiltinVoteAction_VoteEnd | BuiltinVoteAction_End); SetBuiltinVoteArgument(g_hVote, sBuffer); @@ -140,7 +140,7 @@ void SlotVoteResultHandler(Handle vote, int num_votes, int num_clients, const in int Slots = StringToInt(g_sSlots, 10); char Buffer[32]; - Format(Buffer, sizeof(Buffer), "%T", "LimitingSlots", LANG_SERVER); + FormatEx(Buffer, sizeof(Buffer), "%T", "LimitingSlots", LANG_SERVER); DisplayBuiltinVotePass(vote, Buffer); SetConVarInt(FindConVar("sv_maxplayers"), Slots); return; diff --git a/addons/sourcemod/scripting/spechud.sp b/addons/sourcemod/scripting/spechud.sp index 6477c2591..18f94d7bd 100644 --- a/addons/sourcemod/scripting/spechud.sp +++ b/addons/sourcemod/scripting/spechud.sp @@ -19,7 +19,7 @@ #include #include -#define PLUGIN_VERSION "3.8.6" +#define PLUGIN_VERSION "3.9.1" public Plugin myinfo = { @@ -33,7 +33,7 @@ public Plugin myinfo = // ====================================================================== // Macros // ====================================================================== -#define SPECHUD_DRAW_INTERVAL 0.5 +#define SPECHUD_DRAW_INTERVAL 1.0 #define TRANSLATION_FILE "spechud.phrases" // ====================================================================== @@ -317,6 +317,19 @@ public void OnClientDisconnect(int client) bTankHudHintShown[client] = false; } +Action Timer_RespectateSpecs(Handle hTimer) +{ + for (int i = 1; i <= MaxClients; i++) + { + if (IsClientInGame(i) && !IsFakeClient(i) && GetClientTeam(i) == L4D2Team_Spectator) + { + FakeClientCommand(i, "sm_spectate"); + } + } + + return Plugin_Stop; +} + public void OnMapStart() { bRoundLive = false; } public void OnRoundIsLive() { @@ -326,11 +339,7 @@ public void OnRoundIsLive() GetCurrentGameMode(); - for (int i = 1; i <= MaxClients; i++) - { - if (IsClientInGame(i) && GetClientTeam(i) == L4D2Team_Spectator && !IsClientSourceTV(i)) - FakeClientCommand(i, "sm_spectate"); - } + CreateTimer(0.2, Timer_RespectateSpecs); if (g_Gamemode == GAMEMODE_VERSUS) { @@ -583,7 +592,7 @@ void FillHeaderInfo(Panel hSpecHud) iTickrate = RoundToNearest(1.0 / GetTickInterval()); static char buf[64]; - Format(buf, sizeof(buf), "Server: %s [Slots %i/%i | %iT]", sHostname, GetRealClientCount(), iMaxPlayers, iTickrate); + FormatEx(buf, sizeof(buf), "%s [%i/%i | %iT]", sHostname, GetRealClientCount(), iMaxPlayers, iTickrate); DrawPanelText(hSpecHud, buf); } @@ -625,7 +634,7 @@ void GetWeaponInfo(int client, char[] info, int length) { // Dual Pistols Scenario // Straight use the prefix since full name is a bit long. - Format(buffer, sizeof(buffer), "DP"); + strcopy(buffer, sizeof(buffer), "DP"); } else GetLongWeaponName(activeWepId, buffer, sizeof(buffer)); @@ -680,10 +689,24 @@ int SortSurvByCharacter(int elem1, int elem2, const int[] array, Handle hndl) else { return 0; } } +void GetClientPing(int client, char[] buffer, int bufferSize) +{ + if (IsFakeClient(client)) + { + strcopy(buffer, bufferSize, "BOT"); + } + else + { + int latency = RoundToNearest(GetClientAvgLatency(client, NetFlow_Both) * 1000.0); + FormatEx(buffer, bufferSize, "%ims", latency); + } +} + void FillSurvivorInfo(Panel hSpecHud) { static char info[100]; static char name[MAX_NAME_LENGTH]; + static char latency[8]; int SurvivorTeamIndex = GameRules_GetProp("m_bAreTeamsFlipped"); @@ -692,18 +715,18 @@ void FillSurvivorInfo(Panel hSpecHud) case GAMEMODE_SCAVENGE: { int score = GetScavengeMatchScore(SurvivorTeamIndex); - FormatEx(info, sizeof(info), "->1. Survivors [%d of %d]", score, GetScavengeRoundLimit()); + FormatEx(info, sizeof(info), "->1. Sur [%d of %d]", score, GetScavengeRoundLimit()); } case GAMEMODE_VERSUS: { if (bRoundLive) { - FormatEx(info, sizeof(info), "->1. Survivors [%d]", + FormatEx(info, sizeof(info), "->1. Sur [%d]", L4D2Direct_GetVSCampaignScore(SurvivorTeamIndex) + GetVersusProgressDistance(SurvivorTeamIndex)); } else { - FormatEx(info, sizeof(info), "->1. Survivors [%d]", + FormatEx(info, sizeof(info), "->1. Sur [%d]", L4D2Direct_GetVSCampaignScore(SurvivorTeamIndex)); } } @@ -729,23 +752,24 @@ void FillSurvivorInfo(Panel hSpecHud) int client = clients[i]; GetClientFixedName(client, name, sizeof(name)); + GetClientPing(client, latency, sizeof(latency)); if (!IsPlayerAlive(client)) { - FormatEx(info, sizeof(info), "%s: Dead", name); + FormatEx(info, sizeof(info), "%s | %s: Dead", latency, name); } else { if (IsHangingFromLedge(client)) { // Nick: <300HP@Hanging> - FormatEx(info, sizeof(info), "%s: <%iHP@Hanging>", name, GetClientHealth(client)); + FormatEx(info, sizeof(info), "%s | %s: <%iHP@Hang>", latency, name, GetClientHealth(client)); } else if (IsIncapacitated(client)) { int activeWep = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"); GetLongWeaponName(IdentifyWeapon(activeWep), info, sizeof(info)); // Nick: <300HP@1st> [Deagle 8] - Format(info, sizeof(info), "%s: <%iHP@%s> [%s %i]", name, GetClientHealth(client), (GetSurvivorIncapCount(client) == 1 ? "2nd" : "1st"), info, GetWeaponClipAmmo(activeWep)); + Format(info, sizeof(info), "%s | %s: <%iHP@%s> [%s %i]", latency, name, GetClientHealth(client), (GetSurvivorIncapCount(client) == 1 ? "2nd" : "1st"), info, GetWeaponClipAmmo(activeWep)); } else { @@ -758,13 +782,13 @@ void FillSurvivorInfo(Panel hSpecHud) { // "#" indicates that player is bleeding. // Nick: 99HP# [Chrome 8/72] - Format(info, sizeof(info), "%s: %iHP%s [%s]", name, health, (tempHealth > 0 ? "#" : ""), info); + Format(info, sizeof(info), "%s | %s: %iHP%s [%s]", latency, name, health, (tempHealth > 0 ? "#" : ""), info); } else { // Player ever incapped should always be bleeding. // Nick: 99HP (#1st) [Chrome 8/72] - Format(info, sizeof(info), "%s: %iHP (#%s) [%s]", name, health, (incapCount == 2 ? "2nd" : "1st"), info); + Format(info, sizeof(info), "%s | %s: %iHP (#%s) [%s]", latency, name, health, (incapCount == 2 ? "2nd" : "1st"), info); } } } @@ -815,22 +839,22 @@ void FillScoreInfo(Panel hSpecHud) DrawPanelText(hSpecHud, " "); - // > HB: 100% | DB: 100% | Pills: 60 / 100% - // > Bonus: 860 <100.0%> - // > Distance: 400 + // > HB: 860 <86%> | DB: 420 <84%> | Pills: 60 <60%> + // > Bonus: 1340 <83.8%> + // > Dist: 400 FormatEx( info, sizeof(info), - "> HB: %.0f%% | DB: %.0f%% | Pills: %i / %.0f%%", - L4D2Util_IntToPercentFloat(healthBonus, maxHealthBonus), - L4D2Util_IntToPercentFloat(damageBonus, maxDamageBonus), + "> HB: %i <%.0f%%> | DB: %i <%.0f%%> | Pills: %i <%.0f%%>", + healthBonus, L4D2Util_IntToPercentFloat(healthBonus, maxHealthBonus), + damageBonus, L4D2Util_IntToPercentFloat(damageBonus, maxDamageBonus), pillsBonus, L4D2Util_IntToPercentFloat(pillsBonus, maxPillsBonus)); DrawPanelText(hSpecHud, info); FormatEx(info, sizeof(info), "> Bonus: %i <%.1f%%>", totalBonus, L4D2Util_IntToPercentFloat(totalBonus, maxTotalBonus)); DrawPanelText(hSpecHud, info); - FormatEx(info, sizeof(info), "> Distance: %i", iMaxDistance); + FormatEx(info, sizeof(info), "> Dist: %i", iMaxDistance); //if (InSecondHalfOfRound()) //{ // Format(info, sizeof(info), "%s | R#1: %i <%.1f%%>", info, iFirstHalfScore, L4D2Util_IntToPercentFloat(iFirstHalfScore, L4D_GetVersusMaxCompletionScore() + maxTotalBonus)); @@ -844,13 +868,13 @@ void FillScoreInfo(Panel hSpecHud) DrawPanelText(hSpecHud, " "); - // > Health Bonus: 860 - // > Distance: 400 + // > HB: 860 + // > Dist: 400 - FormatEx(info, sizeof(info), "> Health Bonus: %i", healthBonus); + FormatEx(info, sizeof(info), "> HB: %i", healthBonus); DrawPanelText(hSpecHud, info); - FormatEx(info, sizeof(info), "> Distance: %i", iMaxDistance); + FormatEx(info, sizeof(info), "> Dist: %i", iMaxDistance); //if (InSecondHalfOfRound()) //{ // Format(info, sizeof(info), "%s | R#1: %i", info, iFirstHalfScore); @@ -871,7 +895,7 @@ void FillScoreInfo(Panel hSpecHud) // > Perm: 114 | Temp: 514 | Pills: 810 // > Bonus: 114514 <100.0%> - // > Distance: 191 + // > Dist: 191 // never ever played on Next so take it easy. FormatEx( info, @@ -883,7 +907,7 @@ void FillScoreInfo(Panel hSpecHud) FormatEx(info, sizeof(info), "> Bonus: %i <%.1f%%>", totalBonus, L4D2Util_IntToPercentFloat(totalBonus, maxTotalBonus)); DrawPanelText(hSpecHud, info); - FormatEx(info, sizeof(info), "> Distance: %i", iMaxDistance); + FormatEx(info, sizeof(info), "> Dist: %i", iMaxDistance); //if (InSecondHalfOfRound()) //{ // Format(info, sizeof(info), "%s | R#1: %i <%.1f%%>", info, iFirstHalfScore, ToPercent(iFirstHalfScore, L4D_GetVersusMaxCompletionScore() + maxTotalBonus)); @@ -899,6 +923,7 @@ void FillInfectedInfo(Panel hSpecHud) static char info[80]; static char buffer[16]; static char name[MAX_NAME_LENGTH]; + static char latency[8]; int InfectedTeamIndex = !GameRules_GetProp("m_bAreTeamsFlipped"); @@ -907,11 +932,11 @@ void FillInfectedInfo(Panel hSpecHud) case GAMEMODE_SCAVENGE: { int score = GetScavengeMatchScore(InfectedTeamIndex); - FormatEx(info, sizeof(info), "->2. Infected [%d of %d]", score, GetScavengeRoundLimit()); + FormatEx(info, sizeof(info), "->2. Inf [%d of %d]", score, GetScavengeRoundLimit()); } case GAMEMODE_VERSUS: { - FormatEx(info, sizeof(info), "->2. Infected [%d]", + FormatEx(info, sizeof(info), "->2. Inf [%d]", L4D2Direct_GetVSCampaignScore(InfectedTeamIndex)); } } @@ -926,19 +951,20 @@ void FillInfectedInfo(Panel hSpecHud) continue; GetClientFixedName(client, name, sizeof(name)); + GetClientPing(client, latency, sizeof(latency)); if (!IsPlayerAlive(client)) { int timeLeft = RoundToFloor(L4D_GetPlayerSpawnTime(client)); if (timeLeft < 0) // Deathcam { // verygood: Dead - FormatEx(info, sizeof(info), "%s: Dead", name); + FormatEx(info, sizeof(info), "%s | %s: Dead", latency, name); } else // Ghost Countdown { FormatEx(buffer, sizeof(buffer), "%is", timeLeft); // verygood: Dead (15s) - FormatEx(info, sizeof(info), "%s: Dead (%s)", name, (timeLeft ? buffer : "Spawning...")); + FormatEx(info, sizeof(info), "%s | %s: Dead (%s)", latency, name, (timeLeft ? buffer : "S")); //char zClassName[10]; //GetInfectedClassName(storedClass[client], zClassName, sizeof zClassName); @@ -965,13 +991,13 @@ void FillInfectedInfo(Panel hSpecHud) // DONE: Handle a case of respawning chipped SI, show the ghost's health if (iHP < iMaxHP) { - // verygood: Charger (Ghost@1HP) - FormatEx(info, sizeof(info), "%s: %s (Ghost@%iHP)", name, zClassName, iHP); + // verygood: Charger (G@1HP) + FormatEx(info, sizeof(info), "%s | %s: %s (G@%iHP)", latency, name, zClassName, iHP); } else { - // verygood: Charger (Ghost) - FormatEx(info, sizeof(info), "%s: %s (Ghost)", name, zClassName); + // verygood: Charger (G) + FormatEx(info, sizeof(info), "%s | %s: %s (G)", latency, name, zClassName); } } else @@ -995,12 +1021,12 @@ void FillInfectedInfo(Panel hSpecHud) if (GetEntityFlags(client) & FL_ONFIRE) { // verygood: Charger (1HP) [On Fire] [6s] - FormatEx(info, sizeof(info), "%s: %s (%iHP) [On Fire]%s", name, zClassName, iHP, buffer); + FormatEx(info, sizeof(info), "%s | %s: %s (%iHP) [Fire]%s", latency, name, zClassName, iHP, buffer); } else { // verygood: Charger (1HP) [6s] - FormatEx(info, sizeof(info), "%s: %s (%iHP)%s", name, zClassName, iHP, buffer); + FormatEx(info, sizeof(info), "%s | %s: %s (%iHP)%s", latency, name, zClassName, iHP, buffer); } } } @@ -1011,7 +1037,7 @@ void FillInfectedInfo(Panel hSpecHud) if (!infectedCount) { - DrawPanelText(hSpecHud, "There is no SI at this moment."); + DrawPanelText(hSpecHud, "No SI."); } } @@ -1044,7 +1070,7 @@ bool FillTankInfo(Panel hSpecHud, bool bTankHUD = false) int passCount = L4D2Direct_GetTankPassedCount(); switch (passCount) { - case 0: FormatEx(info, sizeof(info), "native"); + case 0: strcopy(info, sizeof(info), "native"); case 1: FormatEx(info, sizeof(info), "%ist", passCount); case 2: FormatEx(info, sizeof(info), "%ind", passCount); case 3: FormatEx(info, sizeof(info), "%ird", passCount); @@ -1054,11 +1080,11 @@ bool FillTankInfo(Panel hSpecHud, bool bTankHUD = false) if (!IsFakeClient(tank)) { GetClientFixedName(tank, name, sizeof(name)); - Format(info, sizeof(info), "Control : %s (%s)", name, info); + Format(info, sizeof(info), "Ctrl: %s (%s)", name, info); } else { - Format(info, sizeof(info), "Control : AI (%s)", info); + Format(info, sizeof(info), "Ctrl: AI (%s)", info); } DrawPanelText(hSpecHud, info); @@ -1070,33 +1096,33 @@ bool FillTankInfo(Panel hSpecHud, bool bTankHUD = false) if (health <= 0 || isIncapacitated) { - info = "Health : Dead"; + info = "HP: Dead"; } else { - FormatEx(info, sizeof(info), "Health : %i / %i%%", health, L4D2Util_GetMax(1, RoundFloat(healthPercent))); + FormatEx(info, sizeof(info), "HP: %i / %i%%", health, L4D2Util_GetMax(1, RoundFloat(healthPercent))); } DrawPanelText(hSpecHud, info); // Draw frustration if (!IsFakeClient(tank)) { - FormatEx(info, sizeof(info), "Frustr. : %d%%", GetTankFrustration(tank)); + FormatEx(info, sizeof(info), "Frust: %d%%", GetTankFrustration(tank)); } else { - info = "Frustr. : AI"; + info = "Frust: AI"; } DrawPanelText(hSpecHud, info); // Draw network if (!IsFakeClient(tank)) { - FormatEx(info, sizeof(info), "Network: %ims / %.1f", RoundToNearest(GetClientAvgLatency(tank, NetFlow_Both) * 1000.0), LM_GetLerpTime(tank) * 1000.0); + FormatEx(info, sizeof(info), "Net: %ims / %.1f", RoundToNearest(GetClientAvgLatency(tank, NetFlow_Both) * 1000.0), LM_GetLerpTime(tank) * 1000.0); } else { - info = "Network: AI"; + info = "Net: AI"; } DrawPanelText(hSpecHud, info); @@ -1104,7 +1130,7 @@ bool FillTankInfo(Panel hSpecHud, bool bTankHUD = false) if (!isIncapacitated && GetEntityFlags(tank) & FL_ONFIRE) { int timeleft = RoundToCeil(healthPercent / 100.0 * fTankBurnDuration); - FormatEx(info, sizeof(info), "On Fire : %is", timeleft); + FormatEx(info, sizeof(info), "Fire: %is", timeleft); DrawPanelText(hSpecHud, info); } @@ -1189,7 +1215,7 @@ void FillGameInfo(Panel hSpecHud) int tankClient = GetTankSelection(); if (tankClient > 0 && IsClientInGame(tankClient)) { - FormatEx(info, sizeof(info), "Tank -> %N", tankClient); + FormatEx(info, sizeof(info), "Tank: %N", tankClient); DrawPanelText(hSpecHud, info); } } @@ -1260,10 +1286,10 @@ stock void GetClientFixedName(int client, char[] name, int length) ValvePanel_ShiftInvalidString(name, length); - if (strlen(name) > 18) + if (strlen(name) > 12) { - name[15] = name[16] = name[17] = '.'; - name[18] = 0; + name[9] = name[10] = name[11] = '.'; + name[12] = '\0'; } } @@ -1332,8 +1358,8 @@ stock int FormatScavengeRoundTime(char[] buffer, int maxlen, int teamIndex, bool seconds -= 60 * minutes; return nodecimalpoint ? - Format(buffer, maxlen, "%d:%02.0f", minutes, seconds) : - Format(buffer, maxlen, "%d:%05.2f", minutes, seconds); + FormatEx(buffer, maxlen, "%d:%02.0f", minutes, seconds) : + FormatEx(buffer, maxlen, "%d:%05.2f", minutes, seconds); } /* diff --git a/addons/sourcemod/scripting/survivor_mvp.sp b/addons/sourcemod/scripting/survivor_mvp.sp index 3d6dd5945..eccee0a86 100644 --- a/addons/sourcemod/scripting/survivor_mvp.sp +++ b/addons/sourcemod/scripting/survivor_mvp.sp @@ -85,7 +85,7 @@ public Plugin:myinfo = name = "Survivor MVP notification", author = "Tabun, Artifacial", description = "Shows MVP for survivor team at end of round", - version = "0.3.3", + version = "0.3.4", url = "https://github.com/alexberriman/l4d2_survivor_mvp" }; @@ -604,13 +604,13 @@ void PrintLoserz(bool:bSolo, client) { if (mvp_SI_losers[i] == client) { - Format(tmpBuffer, sizeof(tmpBuffer), "{blue}Your Rank {green}SI: {olive}#%d - {blue}({default}%d {green}dmg {blue}[{default}%.0f%%{blue}]{olive}, {default}%d {green}kills {blue}[{default}%.0f%%{blue}])", (i + 2), iDidDamageAll[mvp_SI_losers[i]], (float(iDidDamageAll[mvp_SI_losers[i]]) / float(iTotalDamageAll)) * 100, iGotKills[mvp_SI_losers[i]], (float(iGotKills[mvp_SI_losers[i]]) / float(iTotalKills)) * 100); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "{blue}Your Rank {green}SI: {olive}#%d - {blue}({default}%d {green}dmg {blue}[{default}%.0f%%{blue}]{olive}, {default}%d {green}kills {blue}[{default}%.0f%%{blue}])", (i + 2), iDidDamageAll[mvp_SI_losers[i]], (float(iDidDamageAll[mvp_SI_losers[i]]) / float(iTotalDamageAll)) * 100, iGotKills[mvp_SI_losers[i]], (float(iGotKills[mvp_SI_losers[i]]) / float(iTotalKills)) * 100); CPrintToChat(mvp_SI_losers[i], "%s", tmpBuffer); } } else { - Format(tmpBuffer, sizeof(tmpBuffer), "{blue}Your Rank {green}SI: {olive}#%d - {blue}({default}%d {green}dmg {blue}[{default}%.0f%%{blue}]{olive}, {default}%d {green}kills {blue}[{default}%.0f%%{blue}])", (i + 2), iDidDamageAll[mvp_SI_losers[i]], (float(iDidDamageAll[mvp_SI_losers[i]]) / float(iTotalDamageAll)) * 100, iGotKills[mvp_SI_losers[i]], (float(iGotKills[mvp_SI_losers[i]]) / float(iTotalKills)) * 100); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "{blue}Your Rank {green}SI: {olive}#%d - {blue}({default}%d {green}dmg {blue}[{default}%.0f%%{blue}]{olive}, {default}%d {green}kills {blue}[{default}%.0f%%{blue}])", (i + 2), iDidDamageAll[mvp_SI_losers[i]], (float(iDidDamageAll[mvp_SI_losers[i]]) / float(iTotalDamageAll)) * 100, iGotKills[mvp_SI_losers[i]], (float(iGotKills[mvp_SI_losers[i]]) / float(iTotalKills)) * 100); CPrintToChat(mvp_SI_losers[i], "%s", tmpBuffer); } } @@ -634,13 +634,13 @@ void PrintLoserz(bool:bSolo, client) { if (mvp_CI_losers[i] == client) { - Format(tmpBuffer, sizeof(tmpBuffer), "{blue}Your Rank {green}CI{default}: {olive}#%d {blue}({default}%d {green}common {blue}[{default}%.0f%%{blue}])", (i + 2), iGotCommon[mvp_CI_losers[i]], (float(iGotCommon[mvp_CI_losers[i]]) / float(iTotalCommon)) * 100); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "{blue}Your Rank {green}CI{default}: {olive}#%d {blue}({default}%d {green}common {blue}[{default}%.0f%%{blue}])", (i + 2), iGotCommon[mvp_CI_losers[i]], (float(iGotCommon[mvp_CI_losers[i]]) / float(iTotalCommon)) * 100); CPrintToChat(mvp_CI_losers[i], "%s", tmpBuffer); } } else { - Format(tmpBuffer, sizeof(tmpBuffer), "{blue}Your Rank {green}CI{default}: {olive}#%d {blue}({default}%d {green}common {blue}[{default}%.0f%%{blue}])", (i + 2), iGotCommon[mvp_CI_losers[i]], (float(iGotCommon[mvp_CI_losers[i]]) / float(iTotalCommon)) * 100); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "{blue}Your Rank {green}CI{default}: {olive}#%d {blue}({default}%d {green}common {blue}[{default}%.0f%%{blue}])", (i + 2), iGotCommon[mvp_CI_losers[i]], (float(iGotCommon[mvp_CI_losers[i]]) / float(iTotalCommon)) * 100); CPrintToChat(mvp_CI_losers[i], "%s", tmpBuffer); } } @@ -664,13 +664,13 @@ void PrintLoserz(bool:bSolo, client) { if (mvp_FF_losers[i] == client) { - Format(tmpBuffer, sizeof(tmpBuffer), "{blue}Your Rank {green}FF{default}: {olive}#%d {blue}({default}%d {green}friendly fire {blue}[{default}%.0f%%{blue}])", (i + 2), iDidFF[mvp_FF_losers[i]], (float(iDidFF[mvp_FF_losers[i]]) / float(iTotalFF)) * 100); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "{blue}Your Rank {green}FF{default}: {olive}#%d {blue}({default}%d {green}friendly fire {blue}[{default}%.0f%%{blue}])", (i + 2), iDidFF[mvp_FF_losers[i]], (float(iDidFF[mvp_FF_losers[i]]) / float(iTotalFF)) * 100); CPrintToChat(mvp_FF_losers[i], "%s", tmpBuffer); } } else { - Format(tmpBuffer, sizeof(tmpBuffer), "{blue}Your Rank {green}FF{default}: {olive}#%d {blue}({default}%d {green}friendly fire {blue}[{default}%.0f%%{blue}])", (i + 2), iDidFF[mvp_FF_losers[i]], (float(iDidFF[mvp_FF_losers[i]]) / float(iTotalFF)) * 100); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "{blue}Your Rank {green}FF{default}: {olive}#%d {blue}({default}%d {green}friendly fire {blue}[{default}%.0f%%{blue}])", (i + 2), iDidFF[mvp_FF_losers[i]], (float(iDidFF[mvp_FF_losers[i]]) / float(iTotalFF)) * 100); CPrintToChat(mvp_FF_losers[i], "%s", tmpBuffer); } } @@ -1110,7 +1110,7 @@ void GetMVPString(char[] printBuffer, const int iSize) if (mvp_SI == 0 && mvp_Common == 0 && !(iBrevityFlags & BREV_SI && iBrevityFlags & BREV_CI)) { - Format(tmpBuffer, sizeof(tmpBuffer), "{blue}[{default}MVP{blue}]{default} {blue}({default}not enough action yet{blue}){default}\n"); + strcopy(tmpBuffer, sizeof(tmpBuffer), "{blue}[{default}MVP{blue}]{default} {blue}({default}not enough action yet{blue}){default}\n"); StrCat(printBuffer, iSize, tmpBuffer); } else @@ -1120,11 +1120,11 @@ void GetMVPString(char[] printBuffer, const int iSize) if (mvp_SI > 0) { if (iBrevityFlags & BREV_PERCENT) { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP] SI:\x03 %s \x01(\x05%d \x01dmg,\x05 %d \x01kills)\n", mvp_SI_name, iDidDamageAll[mvp_SI], iGotKills[mvp_SI]); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP] SI:\x03 %s \x01(\x05%d \x01dmg,\x05 %d \x01kills)\n", mvp_SI_name, iDidDamageAll[mvp_SI], iGotKills[mvp_SI]); } else if (iBrevityFlags & BREV_ABSOLUTE) { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP] SI:\x03 %s \x01(dmg \x04%2.0f%%\x01, kills \x04%.0f%%\x01)\n", mvp_SI_name, (float(iDidDamageAll[mvp_SI]) / float(iTotalDamageAll)) * 100, (float(iGotKills[mvp_SI]) / float(iTotalKills)) * 100); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP] SI:\x03 %s \x01(dmg \x04%2.0f%%\x01, kills \x04%.0f%%\x01)\n", mvp_SI_name, (float(iDidDamageAll[mvp_SI]) / float(iTotalDamageAll)) * 100, (float(iGotKills[mvp_SI]) / float(iTotalKills)) * 100); } else { - Format(tmpBuffer, sizeof(tmpBuffer), "{blue}[{default}MVP{blue}] SI: {olive}%s {blue}({default}%d {green}dmg {blue}[{default}%.0f%%{blue}]{olive}, {default}%d {green}kills {blue}[{default}%.0f%%{blue}])\n", mvp_SI_name, iDidDamageAll[mvp_SI], (float(iDidDamageAll[mvp_SI]) / float(iTotalDamageAll)) * 100, iGotKills[mvp_SI], (float(iGotKills[mvp_SI]) / float(iTotalKills)) * 100); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "{blue}[{default}MVP{blue}] SI: {olive}%s {blue}({default}%d {green}dmg {blue}[{default}%.0f%%{blue}]{olive}, {default}%d {green}kills {blue}[{default}%.0f%%{blue}])\n", mvp_SI_name, iDidDamageAll[mvp_SI], (float(iDidDamageAll[mvp_SI]) / float(iTotalDamageAll)) * 100, iGotKills[mvp_SI], (float(iGotKills[mvp_SI]) / float(iTotalKills)) * 100); } StrCat(printBuffer, iSize, tmpBuffer); } @@ -1139,11 +1139,11 @@ void GetMVPString(char[] printBuffer, const int iSize) if (mvp_Common > 0) { if (iBrevityFlags & BREV_PERCENT) { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP] CI:\x03 %s \x01(\x05%d \x01common)\n", mvp_Common_name, iGotCommon[mvp_Common]); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP] CI:\x03 %s \x01(\x05%d \x01common)\n", mvp_Common_name, iGotCommon[mvp_Common]); } else if (iBrevityFlags & BREV_ABSOLUTE) { - Format(tmpBuffer, sizeof(tmpBuffer), "[MVP] CI:\x03 %s \x01(\x04%.0f%%\x01)\n", mvp_Common_name, (float(iGotCommon[mvp_Common]) / float(iTotalCommon)) * 100); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[MVP] CI:\x03 %s \x01(\x04%.0f%%\x01)\n", mvp_Common_name, (float(iGotCommon[mvp_Common]) / float(iTotalCommon)) * 100); } else { - Format(tmpBuffer, sizeof(tmpBuffer), "{blue}[{default}MVP{blue}] CI: {olive}%s {blue}({default}%d {green}common {blue}[{default}%.0f%%{blue}])\n", mvp_Common_name, iGotCommon[mvp_Common], (float(iGotCommon[mvp_Common]) / float(iTotalCommon)) * 100); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "{blue}[{default}MVP{blue}] CI: {olive}%s {blue}({default}%d {green}common {blue}[{default}%.0f%%{blue}])\n", mvp_Common_name, iGotCommon[mvp_Common], (float(iGotCommon[mvp_Common]) / float(iTotalCommon)) * 100); } StrCat(printBuffer, iSize, tmpBuffer); } @@ -1155,17 +1155,17 @@ void GetMVPString(char[] printBuffer, const int iSize) { if (mvp_FF == 0) { - Format(tmpBuffer, sizeof(tmpBuffer), "{blue}[{default}LVP{blue}] FF{default}: {green}no friendly fire at all!{default}\n"); + strcopy(tmpBuffer, sizeof(tmpBuffer), "{blue}[{default}LVP{blue}] FF{default}: {green}no friendly fire at all!{default}\n"); StrCat(printBuffer, iSize, tmpBuffer); } else { if (iBrevityFlags & BREV_PERCENT) { - Format(tmpBuffer, sizeof(tmpBuffer), "[LVP] FF:\x03 %s \x01(\x05%d \x01dmg)\n", mvp_FF_name, iDidFF[mvp_FF]); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[LVP] FF:\x03 %s \x01(\x05%d \x01dmg)\n", mvp_FF_name, iDidFF[mvp_FF]); } else if (iBrevityFlags & BREV_ABSOLUTE) { - Format(tmpBuffer, sizeof(tmpBuffer), "[LVP] FF:\x03 %s \x01(\x04%.0f%%\x01)\n", mvp_FF_name, (float(iDidFF[mvp_FF]) / float(iTotalFF)) * 100); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "[LVP] FF:\x03 %s \x01(\x04%.0f%%\x01)\n", mvp_FF_name, (float(iDidFF[mvp_FF]) / float(iTotalFF)) * 100); } else { - Format(tmpBuffer, sizeof(tmpBuffer), "{blue}[{default}LVP{blue}] FF{default}: {olive}%s {blue}({default}%d {green}friendly fire {blue}[{default}%.0f%%{blue}]){default}\n", mvp_FF_name, iDidFF[mvp_FF], (float(iDidFF[mvp_FF]) / float(iTotalFF)) * 100); + FormatEx(tmpBuffer, sizeof(tmpBuffer), "{blue}[{default}LVP{blue}] FF{default}: {olive}%s {blue}({default}%d {green}friendly fire {blue}[{default}%.0f%%{blue}]){default}\n", mvp_FF_name, iDidFF[mvp_FF], (float(iDidFF[mvp_FF]) / float(iTotalFF)) * 100); } StrCat(printBuffer, iSize, tmpBuffer); } diff --git a/addons/sourcemod/scripting/weapon_loadout_vote.sp b/addons/sourcemod/scripting/weapon_loadout_vote.sp index a647a1a55..7cfd4f117 100644 --- a/addons/sourcemod/scripting/weapon_loadout_vote.sp +++ b/addons/sourcemod/scripting/weapon_loadout_vote.sp @@ -70,7 +70,7 @@ public Plugin myinfo = name = "Weapon Loadout", author = "Sir, A1m`", description = "Allows the Players to choose which weapons to play the mode in.", - version = "2.3.1", + version = "2.3.2", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -222,7 +222,7 @@ int Menu_VoteMenuHandler(Menu hMenu, MenuAction iAction, int iClient, int iIndex char sInfo[32], sVoteTitle[64]; if (hMenu.GetItem(iIndex, sInfo, sizeof(sInfo))) { - Format(sVoteTitle, sizeof(sVoteTitle), "Survivors get %s?", sInfo); + FormatEx(sVoteTitle, sizeof(sVoteTitle), "Survivors get %s?", sInfo); g_iVotingMode = iIndex + 1; // Get all non-spectating players diff --git a/cfg/cfgogl/acemodrv/mapinfo.txt b/cfg/cfgogl/acemodrv/mapinfo.txt index 938514762..2c94d87cd 100644 --- a/cfg/cfgogl/acemodrv/mapinfo.txt +++ b/cfg/cfgogl/acemodrv/mapinfo.txt @@ -2204,7 +2204,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/amrv1v1/mapinfo.txt b/cfg/cfgogl/amrv1v1/mapinfo.txt index d74b7065f..082c50803 100644 --- a/cfg/cfgogl/amrv1v1/mapinfo.txt +++ b/cfg/cfgogl/amrv1v1/mapinfo.txt @@ -2204,7 +2204,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/amrv2v2/mapinfo.txt b/cfg/cfgogl/amrv2v2/mapinfo.txt index 10ddfebd0..d02110b44 100644 --- a/cfg/cfgogl/amrv2v2/mapinfo.txt +++ b/cfg/cfgogl/amrv2v2/mapinfo.txt @@ -2204,7 +2204,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/amrv3v3/mapinfo.txt b/cfg/cfgogl/amrv3v3/mapinfo.txt index 5b4641754..4fb30abed 100644 --- a/cfg/cfgogl/amrv3v3/mapinfo.txt +++ b/cfg/cfgogl/amrv3v3/mapinfo.txt @@ -2204,7 +2204,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/apex/mapinfo.txt b/cfg/cfgogl/apex/mapinfo.txt index d6e396295..5154de880 100644 --- a/cfg/cfgogl/apex/mapinfo.txt +++ b/cfg/cfgogl/apex/mapinfo.txt @@ -1885,7 +1885,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/deadman/confogl_plugins.cfg b/cfg/cfgogl/deadman/confogl_plugins.cfg index 4c8561646..a66d52163 100644 --- a/cfg/cfgogl/deadman/confogl_plugins.cfg +++ b/cfg/cfgogl/deadman/confogl_plugins.cfg @@ -52,7 +52,6 @@ sm plugins load optional/l4d2_getup_fixes.smx sm plugins load optional/l4d2_godframes_control_merge.smx sm plugins load optional/l4d2_hittable_control.smx sm plugins load optional/l4d2_ladder_rambos.smx -sm plugins load optional/l4d2_lagcomp_manager.smx sm plugins load optional/l4d2_m2_control_eq.smx sm plugins load optional/l4d2_melee_spawn_control.smx sm plugins load optional/l4d2_nobackjumps.smx diff --git a/cfg/cfgogl/eq/mapinfo.txt b/cfg/cfgogl/eq/mapinfo.txt index 3b0fdce2e..3e4d23c4e 100644 --- a/cfg/cfgogl/eq/mapinfo.txt +++ b/cfg/cfgogl/eq/mapinfo.txt @@ -1872,7 +1872,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/eq1v1/mapinfo.txt b/cfg/cfgogl/eq1v1/mapinfo.txt index f61dbe2c8..61dee6ad3 100644 --- a/cfg/cfgogl/eq1v1/mapinfo.txt +++ b/cfg/cfgogl/eq1v1/mapinfo.txt @@ -1872,7 +1872,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/eq2v2/mapinfo.txt b/cfg/cfgogl/eq2v2/mapinfo.txt index b8e5b4644..d698633a6 100644 --- a/cfg/cfgogl/eq2v2/mapinfo.txt +++ b/cfg/cfgogl/eq2v2/mapinfo.txt @@ -1872,7 +1872,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/eq3v3/mapinfo.txt b/cfg/cfgogl/eq3v3/mapinfo.txt index 5c27a5031..aa07bcebc 100644 --- a/cfg/cfgogl/eq3v3/mapinfo.txt +++ b/cfg/cfgogl/eq3v3/mapinfo.txt @@ -1872,7 +1872,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/neomod/mapinfo.txt b/cfg/cfgogl/neomod/mapinfo.txt index 3b45ebb66..21f25118e 100644 --- a/cfg/cfgogl/neomod/mapinfo.txt +++ b/cfg/cfgogl/neomod/mapinfo.txt @@ -2092,7 +2092,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/nextmod/mapinfo.txt b/cfg/cfgogl/nextmod/mapinfo.txt index 75f7b0d7e..239a6eef9 100644 --- a/cfg/cfgogl/nextmod/mapinfo.txt +++ b/cfg/cfgogl/nextmod/mapinfo.txt @@ -1879,7 +1879,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/nextmod1v1/mapinfo.txt b/cfg/cfgogl/nextmod1v1/mapinfo.txt index b0ba8e94a..118aa7bb1 100644 --- a/cfg/cfgogl/nextmod1v1/mapinfo.txt +++ b/cfg/cfgogl/nextmod1v1/mapinfo.txt @@ -1879,7 +1879,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/nextmod2v2/mapinfo.txt b/cfg/cfgogl/nextmod2v2/mapinfo.txt index 65cfc53f7..18804183e 100644 --- a/cfg/cfgogl/nextmod2v2/mapinfo.txt +++ b/cfg/cfgogl/nextmod2v2/mapinfo.txt @@ -1879,7 +1879,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/nextmod3v3/mapinfo.txt b/cfg/cfgogl/nextmod3v3/mapinfo.txt index c175a3c71..5b8d27887 100644 --- a/cfg/cfgogl/nextmod3v3/mapinfo.txt +++ b/cfg/cfgogl/nextmod3v3/mapinfo.txt @@ -1879,7 +1879,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/zh1v1/mapinfo.txt b/cfg/cfgogl/zh1v1/mapinfo.txt index 9e90051e3..35e018e43 100644 --- a/cfg/cfgogl/zh1v1/mapinfo.txt +++ b/cfg/cfgogl/zh1v1/mapinfo.txt @@ -2348,7 +2348,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/zh2v2/mapinfo.txt b/cfg/cfgogl/zh2v2/mapinfo.txt index 9e90051e3..35e018e43 100644 --- a/cfg/cfgogl/zh2v2/mapinfo.txt +++ b/cfg/cfgogl/zh2v2/mapinfo.txt @@ -2348,7 +2348,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/zh3v3/mapinfo.txt b/cfg/cfgogl/zh3v3/mapinfo.txt index 9e90051e3..35e018e43 100644 --- a/cfg/cfgogl/zh3v3/mapinfo.txt +++ b/cfg/cfgogl/zh3v3/mapinfo.txt @@ -2348,7 +2348,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/zm1v1/mapinfo.txt b/cfg/cfgogl/zm1v1/mapinfo.txt index 9e90051e3..102fc22e8 100644 --- a/cfg/cfgogl/zm1v1/mapinfo.txt +++ b/cfg/cfgogl/zm1v1/mapinfo.txt @@ -2348,7 +2348,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { @@ -3080,6 +3079,21 @@ { "pain_pills" "4" } + "witch_ban_flow" + { + "Early" + { + "min" "0" + "max" "30" + } + } + } + "dc2025_5" + { + "ItemLimits" + { + "pain_pills" "6" + } } //-------- ↓↓↓ you can add custom info here ↓↓↓ diff --git a/cfg/cfgogl/zm2v2/mapinfo.txt b/cfg/cfgogl/zm2v2/mapinfo.txt index 9e90051e3..102fc22e8 100644 --- a/cfg/cfgogl/zm2v2/mapinfo.txt +++ b/cfg/cfgogl/zm2v2/mapinfo.txt @@ -2348,7 +2348,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { @@ -3080,6 +3079,21 @@ { "pain_pills" "4" } + "witch_ban_flow" + { + "Early" + { + "min" "0" + "max" "30" + } + } + } + "dc2025_5" + { + "ItemLimits" + { + "pain_pills" "6" + } } //-------- ↓↓↓ you can add custom info here ↓↓↓ diff --git a/cfg/cfgogl/zm3v3/mapinfo.txt b/cfg/cfgogl/zm3v3/mapinfo.txt index 9e90051e3..102fc22e8 100644 --- a/cfg/cfgogl/zm3v3/mapinfo.txt +++ b/cfg/cfgogl/zm3v3/mapinfo.txt @@ -2348,7 +2348,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { @@ -3080,6 +3079,21 @@ { "pain_pills" "4" } + "witch_ban_flow" + { + "Early" + { + "min" "0" + "max" "30" + } + } + } + "dc2025_5" + { + "ItemLimits" + { + "pain_pills" "6" + } } //-------- ↓↓↓ you can add custom info here ↓↓↓ diff --git a/cfg/cfgogl/zonehunters/mapinfo.txt b/cfg/cfgogl/zonehunters/mapinfo.txt index cc09a5651..268548b61 100644 --- a/cfg/cfgogl/zonehunters/mapinfo.txt +++ b/cfg/cfgogl/zonehunters/mapinfo.txt @@ -2348,7 +2348,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/cfgogl/zonemod/mapinfo.txt b/cfg/cfgogl/zonemod/mapinfo.txt index e62766c0e..364c3fa99 100644 --- a/cfg/cfgogl/zonemod/mapinfo.txt +++ b/cfg/cfgogl/zonemod/mapinfo.txt @@ -2366,7 +2366,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { @@ -2987,9 +2986,12 @@ //=============== Outline 跨越边境 "outline_m4" { + // "max_distance" "800" + // 900 now, consider reduce score because its too long stages? not sure how to do + // 现版本自带是900分,考虑降低路程分?不确定如何做 "ItemLimits" { - "pain_pills" "4" + "pain_pills" "6" } } @@ -3098,6 +3100,21 @@ { "pain_pills" "4" } + "witch_ban_flow" + { + "Early" + { + "min" "0" + "max" "30" + } + } + } + "dc2025_5" + { + "ItemLimits" + { + "pain_pills" "6" + } } //======================================================================= diff --git a/cfg/cfgogl/zoneretro/mapinfo.txt b/cfg/cfgogl/zoneretro/mapinfo.txt index 2f0963f1e..0365216b3 100644 --- a/cfg/cfgogl/zoneretro/mapinfo.txt +++ b/cfg/cfgogl/zoneretro/mapinfo.txt @@ -2348,7 +2348,6 @@ "start_extra_dist" "150.000000" "end_dist" "100.000000" "max_distance" "500" - "max_distance" "500" } "l4d2_fallindeath02" { diff --git a/cfg/generalfixes.cfg b/cfg/generalfixes.cfg index 332b3907a..222e28b35 100644 --- a/cfg/generalfixes.cfg +++ b/cfg/generalfixes.cfg @@ -72,6 +72,7 @@ sm plugins load optional/l4d_return_thrown_items.smx sm plugins load fixes/l4d_prop_touching_rules.smx sm plugins load fixes/l4d2_fix_tank_rock_handoff.smx sm plugins load fixes/l4d_fix_prop_los.smx +sm plugins load fixes/l4d2_incap_fire_fix.smx // Anti-Cheat. sm plugins load optional/l4d2_block_autoaim.smx // Sort of a cheat..? diff --git a/cfg/server.cfg b/cfg/server.cfg index 89ad9ddae..a0626761b 100644 --- a/cfg/server.cfg +++ b/cfg/server.cfg @@ -46,45 +46,48 @@ sv_logsdir logs //Folder in the game directory where se /////////////////////////////////////////////////////////////////////// sm_cvar l4d2_addons_eclipse 0 -// [Wait Commands] +// Tickrate Fixes +sm_cvar tick_door_speed 1.3 + +// Slots (This prevents constant resetting of sv_maxplayers on map change) +sm_cvar mv_maxplayers 30 + +// Disable Wait Commands sm_cvar sv_allow_wait_command 0 // [Networking, Rates] // - Rates forced to 100 on Clients, for 100 Tick. // - When using a different Tickrate, modify settings accordingly: -// 1. Change 100000 to (Tickrate * 1000) for Rate and Splitpacket. +// 1. Change 100000 to (Tickrate * 1000) for Rates // 2. Change 100 to (Tickrate) for Cmd and Update Rates. -// ----------------------------------------------------------------------- -sm_cvar sv_minrate 100000 // Minimum value of rate. -sm_cvar sv_maxrate 100000 // Maximum Value of rate. -sm_cvar sv_minupdaterate 100 // Minimum Value of cl_updaterate. -sm_cvar sv_maxupdaterate 100 // Maximum Value of cl_updaterate. -sm_cvar sv_mincmdrate 100 // Minimum value of cl_cmdrate. -sm_cvar sv_maxcmdrate 100 // Maximum value of cl_cmdrate. -sm_cvar sv_client_min_interp_ratio -1 // Minimum value of cl_interp_ratio. -sm_cvar sv_client_max_interp_ratio 0 // Maximum value of cl_interp_ratio. -sm_cvar nb_update_frequency 0.014 // The lower the value, the more often common infected and witches get updated (Pathing, and state), very CPU Intensive. (0.100 is default) -sm_cvar net_splitpacket_maxrate 50000 // Networking Tweaks. -sm_cvar net_maxcleartime 0.0001 // Max ? of seconds we can wait for next packets to be sent based on rate setting. Lower values positively affects hit registration and also reduces choke. -sm_cvar fps_max 0 // Forces the maximum amount of FPS the CPU has available for the Server. - -// Tickrate Fixes -sm_cvar tick_door_speed 1.3 - -// Slots (This prevents constant resetting of sv_maxplayers on map change) -sm_cvar mv_maxplayers 30 +// ----------------------------------------------------------------------- +sm_cvar sv_maxunlag 0.35 // Maximum amount of seconds to backtrack clients (Client latency + interpolation). +sm_cvar sv_minupdaterate 100 // Minimum Value of cl_updaterate on clients. +sm_cvar sv_maxupdaterate 100 // Maximum Value of cl_updaterate on clients. +sm_cvar sv_mincmdrate 100 // Minimum value of cl_cmdrate on clients. +sm_cvar sv_maxcmdrate 100 // Maximum value of cl_cmdrate on clients. +sm_cvar sv_client_min_interp_ratio 0 // Minimum value of cl_interp_ratio on clients. +sm_cvar sv_client_max_interp_ratio 0 // Maximum value of cl_interp_ratio on clients. +sm_cvar sv_minrate 100000 // Minimum value of rate on clients. (Hardcapped at 30000) +sm_cvar sv_maxrate 100000 // Maximum Value of rate on clients. (Hardcapped at 30000) +sm_cvar net_splitpacket_maxrate 100000 // When packets are split the server sends them out at the lowest value between "rate" (on client) and the server's "net_splitpacket_maxrate", match rate to prevent throttling. +sm_cvar net_maxcleartime 0.0001 // Max seconds we can wait for next packets to be sent based on rate setting, reduces self introduced choke. +sm_cvar sv_clockcorrection_msecs 20 // Force correct clients commands to snap back if they take place beyond accepted range. (100 Tick this is 2 ticks ~ 40ms window (~20ms drift) // Some tweaking -sm_cvar mp_autoteambalance 0 // Prevents some shuffling. sm_cvar sv_unlag_fixstuck 1 // Prevent getting stuck when attempting to "unlag" a player. -sm_cvar z_brawl_chance 0 // Common Infected won't randomly fight eachother. -sm_cvar sv_maxunlag 1 // Maximum amount of seconds to "unlag", go back in time. -sm_cvar sv_forcepreload 1 // Pre-loading is always a good thing, force pre-loading on all clients. -sm_cvar sv_client_predict 1 // This is already set on clients, but force them to predict. -sm_cvar sv_client_cmdrate_difference 0 // Remove the clamp. -sm_cvar sv_max_queries_sec_global 10 +sm_cvar sv_forcepreload 1 // Pre-loading is always a good thing, trading in a bit of RAM. +sm_cvar fps_max 0 // Forces the maximum amount of FPS the CPU has available for the Server. + +// Ideal settings for 100 Tick and a strong CPU. +// With these settings we sacrifice NextBot smoothness under heavy load (which can be mitigated by having cl_interp 0.010~0.020) rather than other important bits such as hitreg. +// To get the most tailored values for your setup you might want to monitor server fps during Tank + Hordes, etc. +// NextBots are Common Infected and Witches. +sm_cvar nb_update_frequency 0.01 // The lower the value, the more often NextBots get updated (Pathing and state), very CPU Intensive. (Default: 0.100) +sm_cvar nb_update_maxslide 1 // Maximum number of ticks a NextBot may be deferred past its scheduled update before it's force updated (Default: 2) +sm_cvar nb_update_framelimit 5 // Per frame CPU Budget for NextBots (Default: 15) + +// Queries +sm_cvar sv_max_queries_sec_global 20 sm_cvar sv_max_queries_sec 3 -sm_cvar sv_max_queries_window 10 -sm_cvar sv_player_stuck_tolerance 5 -sm_cvar sv_stats 0 // Don't need these. -sm_cvar sv_clockcorrection_msecs 25 // This one makes laggy players have less of an advantage regarding hitbox (as the server normally compensates for 60msec, lowering it below 15 will make some players appear stuttery) +sm_cvar sv_max_queries_window 10 \ No newline at end of file diff --git a/cfg/stripper/apex/maps/c10m1_caves.cfg b/cfg/stripper/apex/maps/c10m1_caves.cfg index d4be45472..2a23ea8be 100644 --- a/cfg/stripper/apex/maps/c10m1_caves.cfg +++ b/cfg/stripper/apex/maps/c10m1_caves.cfg @@ -205,7 +205,7 @@ add: "classname" "env_physics_blocker" } { - "origin" "-15137.5 -11236 -279.76 + "origin" "-15137.5 -11236 -279.76" "mins" "657 133 262.5" "maxs" "-657 -133 -262.5" "initialstate" "1" diff --git a/cfg/stripper/apex/maps/c2m1_highway.cfg b/cfg/stripper/apex/maps/c2m1_highway.cfg index 300169680..6c39aad69 100644 --- a/cfg/stripper/apex/maps/c2m1_highway.cfg +++ b/cfg/stripper/apex/maps/c2m1_highway.cfg @@ -1115,7 +1115,7 @@ add: "classname" "prop_dynamic" "origin" "1929 3387 -562.418" "angles" "0 90 0" - "solid" "0 + "solid" "0" "disableshadows" "1" "rendercolor" "255 255 255" "model" "models/props_misc/wrongway_sign01.mdl" diff --git a/cfg/stripper/apex/maps/c5m5_bridge.cfg b/cfg/stripper/apex/maps/c5m5_bridge.cfg index 6e41cef10..2b8036c4e 100644 --- a/cfg/stripper/apex/maps/c5m5_bridge.cfg +++ b/cfg/stripper/apex/maps/c5m5_bridge.cfg @@ -1717,17 +1717,6 @@ modify: add: -; --- block survivors from getting out of map behind wall at start of bridge -{ - ; invisible block above truck - "origin" " - "mins" " - "maxs" " - "initialstate" "1" - "BlockType" "1" - "classname" "env_physics_blocker" -} - ; --- block survivor bhop across top of bridge and off map { ; invisible block above horizontal metal beam diff --git a/cfg/stripper/deadman/maps/c2m1_highway.cfg b/cfg/stripper/deadman/maps/c2m1_highway.cfg index d3fb9e908..fd7b31bf5 100644 --- a/cfg/stripper/deadman/maps/c2m1_highway.cfg +++ b/cfg/stripper/deadman/maps/c2m1_highway.cfg @@ -1115,7 +1115,7 @@ add: "classname" "prop_dynamic" "origin" "1929 3387 -562.418" "angles" "0 90 0" - "solid" "0 + "solid" "0" "disableshadows" "1" "rendercolor" "255 255 255" "model" "models/props_misc/wrongway_sign01.mdl" diff --git a/cfg/stripper/deadman/maps/c5m5_bridge.cfg b/cfg/stripper/deadman/maps/c5m5_bridge.cfg index 6516b6900..2a14ab9ba 100644 --- a/cfg/stripper/deadman/maps/c5m5_bridge.cfg +++ b/cfg/stripper/deadman/maps/c5m5_bridge.cfg @@ -1717,17 +1717,6 @@ modify: add: -; --- block survivors from getting out of map behind wall at start of bridge -{ - ; invisible block above truck - "origin" " - "mins" " - "maxs" " - "initialstate" "1" - "BlockType" "1" - "classname" "env_physics_blocker" -} - ; --- block survivor bhop across top of bridge and off map { ; invisible block above horizontal metal beam diff --git a/cfg/stripper/deadman/maps/damitdc1.cfg b/cfg/stripper/deadman/maps/damitdc1.cfg index 4e43d9a39..f827cfe58 100644 --- a/cfg/stripper/deadman/maps/damitdc1.cfg +++ b/cfg/stripper/deadman/maps/damitdc1.cfg @@ -1,5 +1,3 @@ - - ; ======================================================== ; =================== Dam It 1 ======================= ; ======================================================== diff --git a/cfg/stripper/deadman/maps/damitdc2.cfg b/cfg/stripper/deadman/maps/damitdc2.cfg index cfe741b3e..1b8ce655c 100644 --- a/cfg/stripper/deadman/maps/damitdc2.cfg +++ b/cfg/stripper/deadman/maps/damitdc2.cfg @@ -1,5 +1,3 @@ - - ; ======================================================== ; =================== Dam It 2 ======================= ; ======================================================== diff --git a/cfg/stripper/deadman/maps/damitdc3.cfg b/cfg/stripper/deadman/maps/damitdc3.cfg index 96ca1196e..5dd0a8f85 100644 --- a/cfg/stripper/deadman/maps/damitdc3.cfg +++ b/cfg/stripper/deadman/maps/damitdc3.cfg @@ -1,5 +1,3 @@ - - ; ======================================================== ; =================== Dam It 3 ======================= ; ======================================================== diff --git a/cfg/stripper/deadman/maps/damitdc4.cfg b/cfg/stripper/deadman/maps/damitdc4.cfg index cd357f347..fcd66325a 100644 --- a/cfg/stripper/deadman/maps/damitdc4.cfg +++ b/cfg/stripper/deadman/maps/damitdc4.cfg @@ -1,5 +1,3 @@ - - ; ======================================================== ; =================== Dam It 4 ======================= ; ======================================================== diff --git a/cfg/stripper/deadman/maps/l4d_tbm_1.cfg b/cfg/stripper/deadman/maps/l4d_tbm_1.cfg index 99868e411..b2fcb30d0 100644 --- a/cfg/stripper/deadman/maps/l4d_tbm_1.cfg +++ b/cfg/stripper/deadman/maps/l4d_tbm_1.cfg @@ -1,5 +1,3 @@ - - ; ======================================================== ; =================== The bloody moors 1 ============= ; ======================================================== diff --git a/cfg/stripper/deadman/maps/l4d_tbm_3.cfg b/cfg/stripper/deadman/maps/l4d_tbm_3.cfg index a850d8a40..1f440adeb 100644 --- a/cfg/stripper/deadman/maps/l4d_tbm_3.cfg +++ b/cfg/stripper/deadman/maps/l4d_tbm_3.cfg @@ -1,5 +1,3 @@ - - ; ======================================================== ; =================== The bloody moors 3 ============= ; ======================================================== diff --git a/cfg/stripper/deadman/maps/l4d_tbm_5.cfg b/cfg/stripper/deadman/maps/l4d_tbm_5.cfg index bef73b3e6..06b04a5a7 100644 --- a/cfg/stripper/deadman/maps/l4d_tbm_5.cfg +++ b/cfg/stripper/deadman/maps/l4d_tbm_5.cfg @@ -1,5 +1,3 @@ - - ; ======================================================== ; =================== The bloody moors 5 ============= ; ======================================================== diff --git a/cfg/stripper/eq/maps/c2m1_highway.cfg b/cfg/stripper/eq/maps/c2m1_highway.cfg index fcd2325f5..a5ce474f1 100644 --- a/cfg/stripper/eq/maps/c2m1_highway.cfg +++ b/cfg/stripper/eq/maps/c2m1_highway.cfg @@ -1094,7 +1094,7 @@ add: "classname" "prop_dynamic" "origin" "1929 3387 -562.418" "angles" "0 90 0" - "solid" "0 + "solid" "0" "disableshadows" "1" "rendercolor" "255 255 255" "model" "models/props_misc/wrongway_sign01.mdl" diff --git a/cfg/stripper/eq/maps/c5m5_bridge.cfg b/cfg/stripper/eq/maps/c5m5_bridge.cfg index 383fd9c3d..cf92524cd 100644 --- a/cfg/stripper/eq/maps/c5m5_bridge.cfg +++ b/cfg/stripper/eq/maps/c5m5_bridge.cfg @@ -1670,17 +1670,6 @@ modify: add: -; --- block survivors from getting out of map behind wall at start of bridge -{ - ; invisible block above truck - "origin" " - "mins" " - "maxs" " - "initialstate" "1" - "BlockType" "1" - "classname" "env_physics_blocker" -} - ; --- block survivor bhop across top of bridge and off map { ; invisible block above horizontal metal beam diff --git a/cfg/stripper/nextmod/maps/c10m1_caves.cfg b/cfg/stripper/nextmod/maps/c10m1_caves.cfg index b2f95190f..fbc5e1c9c 100644 --- a/cfg/stripper/nextmod/maps/c10m1_caves.cfg +++ b/cfg/stripper/nextmod/maps/c10m1_caves.cfg @@ -235,7 +235,7 @@ add: "classname" "env_physics_blocker" } { - "origin" "-15137.5 -11236 -279.76 + "origin" "-15137.5 -11236 -279.76" "mins" "-657 -133 -262.5" "maxs" "657 133 262.5" "initialstate" "1" diff --git a/cfg/stripper/nextmod/maps/c2m1_highway.cfg b/cfg/stripper/nextmod/maps/c2m1_highway.cfg index 8a057382d..c2a1006f5 100644 --- a/cfg/stripper/nextmod/maps/c2m1_highway.cfg +++ b/cfg/stripper/nextmod/maps/c2m1_highway.cfg @@ -1161,7 +1161,7 @@ add: "classname" "prop_dynamic" "origin" "1929 3387 -562.418" "angles" "0 90 0" - "solid" "0 + "solid" "0" "disableshadows" "1" "rendercolor" "255 255 255" "model" "models/props_misc/wrongway_sign01.mdl" diff --git a/cfg/stripper/nextmod/maps/c5m5_bridge.cfg b/cfg/stripper/nextmod/maps/c5m5_bridge.cfg index 6516b6900..2a14ab9ba 100644 --- a/cfg/stripper/nextmod/maps/c5m5_bridge.cfg +++ b/cfg/stripper/nextmod/maps/c5m5_bridge.cfg @@ -1717,17 +1717,6 @@ modify: add: -; --- block survivors from getting out of map behind wall at start of bridge -{ - ; invisible block above truck - "origin" " - "mins" " - "maxs" " - "initialstate" "1" - "BlockType" "1" - "classname" "env_physics_blocker" -} - ; --- block survivor bhop across top of bridge and off map { ; invisible block above horizontal metal beam diff --git a/cfg/stripper/nextmod/maps/damitdc1.cfg b/cfg/stripper/nextmod/maps/damitdc1.cfg index 4e43d9a39..f827cfe58 100644 --- a/cfg/stripper/nextmod/maps/damitdc1.cfg +++ b/cfg/stripper/nextmod/maps/damitdc1.cfg @@ -1,5 +1,3 @@ - - ; ======================================================== ; =================== Dam It 1 ======================= ; ======================================================== diff --git a/cfg/stripper/nextmod/maps/damitdc2.cfg b/cfg/stripper/nextmod/maps/damitdc2.cfg index cfe741b3e..1b8ce655c 100644 --- a/cfg/stripper/nextmod/maps/damitdc2.cfg +++ b/cfg/stripper/nextmod/maps/damitdc2.cfg @@ -1,5 +1,3 @@ - - ; ======================================================== ; =================== Dam It 2 ======================= ; ======================================================== diff --git a/cfg/stripper/nextmod/maps/damitdc3.cfg b/cfg/stripper/nextmod/maps/damitdc3.cfg index 96ca1196e..5dd0a8f85 100644 --- a/cfg/stripper/nextmod/maps/damitdc3.cfg +++ b/cfg/stripper/nextmod/maps/damitdc3.cfg @@ -1,5 +1,3 @@ - - ; ======================================================== ; =================== Dam It 3 ======================= ; ======================================================== diff --git a/cfg/stripper/nextmod/maps/damitdc4.cfg b/cfg/stripper/nextmod/maps/damitdc4.cfg index cd357f347..fcd66325a 100644 --- a/cfg/stripper/nextmod/maps/damitdc4.cfg +++ b/cfg/stripper/nextmod/maps/damitdc4.cfg @@ -1,5 +1,3 @@ - - ; ======================================================== ; =================== Dam It 4 ======================= ; ======================================================== diff --git a/cfg/stripper/nextmod/maps/l4d_tbm_1.cfg b/cfg/stripper/nextmod/maps/l4d_tbm_1.cfg index 99868e411..b2fcb30d0 100644 --- a/cfg/stripper/nextmod/maps/l4d_tbm_1.cfg +++ b/cfg/stripper/nextmod/maps/l4d_tbm_1.cfg @@ -1,5 +1,3 @@ - - ; ======================================================== ; =================== The bloody moors 1 ============= ; ======================================================== diff --git a/cfg/stripper/nextmod/maps/l4d_tbm_3.cfg b/cfg/stripper/nextmod/maps/l4d_tbm_3.cfg index a850d8a40..1f440adeb 100644 --- a/cfg/stripper/nextmod/maps/l4d_tbm_3.cfg +++ b/cfg/stripper/nextmod/maps/l4d_tbm_3.cfg @@ -1,5 +1,3 @@ - - ; ======================================================== ; =================== The bloody moors 3 ============= ; ======================================================== diff --git a/cfg/stripper/nextmod/maps/l4d_tbm_5.cfg b/cfg/stripper/nextmod/maps/l4d_tbm_5.cfg index bef73b3e6..06b04a5a7 100644 --- a/cfg/stripper/nextmod/maps/l4d_tbm_5.cfg +++ b/cfg/stripper/nextmod/maps/l4d_tbm_5.cfg @@ -1,5 +1,3 @@ - - ; ======================================================== ; =================== The bloody moors 5 ============= ; ======================================================== diff --git a/cfg/stripper/pmelite/maps/c10m1_caves.cfg b/cfg/stripper/pmelite/maps/c10m1_caves.cfg index d4be45472..2a23ea8be 100644 --- a/cfg/stripper/pmelite/maps/c10m1_caves.cfg +++ b/cfg/stripper/pmelite/maps/c10m1_caves.cfg @@ -205,7 +205,7 @@ add: "classname" "env_physics_blocker" } { - "origin" "-15137.5 -11236 -279.76 + "origin" "-15137.5 -11236 -279.76" "mins" "657 133 262.5" "maxs" "-657 -133 -262.5" "initialstate" "1" diff --git a/cfg/stripper/pmelite/maps/c2m1_highway.cfg b/cfg/stripper/pmelite/maps/c2m1_highway.cfg index 300169680..6c39aad69 100644 --- a/cfg/stripper/pmelite/maps/c2m1_highway.cfg +++ b/cfg/stripper/pmelite/maps/c2m1_highway.cfg @@ -1115,7 +1115,7 @@ add: "classname" "prop_dynamic" "origin" "1929 3387 -562.418" "angles" "0 90 0" - "solid" "0 + "solid" "0" "disableshadows" "1" "rendercolor" "255 255 255" "model" "models/props_misc/wrongway_sign01.mdl" diff --git a/cfg/stripper/pmelite/maps/c5m5_bridge.cfg b/cfg/stripper/pmelite/maps/c5m5_bridge.cfg index 6e41cef10..2b8036c4e 100644 --- a/cfg/stripper/pmelite/maps/c5m5_bridge.cfg +++ b/cfg/stripper/pmelite/maps/c5m5_bridge.cfg @@ -1717,17 +1717,6 @@ modify: add: -; --- block survivors from getting out of map behind wall at start of bridge -{ - ; invisible block above truck - "origin" " - "mins" " - "maxs" " - "initialstate" "1" - "BlockType" "1" - "classname" "env_physics_blocker" -} - ; --- block survivor bhop across top of bridge and off map { ; invisible block above horizontal metal beam diff --git a/cfg/stripper/zonemod/maps/cwm1_intro.cfg b/cfg/stripper/zonemod/maps/cwm1_intro.cfg index 90eda7872..aa553c444 100644 --- a/cfg/stripper/zonemod/maps/cwm1_intro.cfg +++ b/cfg/stripper/zonemod/maps/cwm1_intro.cfg @@ -68,17 +68,28 @@ add: } add: -; --- Block a hole -; --- 添加入地空气墙 -{ - "classname" "env_physics_blocker" - "angles" "0 0 0" - "BlockType" "0" - "maxs" "100 100 272" - "mins" "-8 -8 -8" - "initialstate" "1" - "targetname" "eb_fix1" - "origin" "3144 3856 152" +; --- Block a hole at the back of the building near the fence gate +{ + "classname" "env_physics_blocker" + "angles" "0 0 0" + "BlockType" "4" + "boxmaxs" "56 240 8" + "boxmins" "-8 -8 -180" + "initialstate" "1" + "targetname" "eb_fix01" + "origin" "3144 3848 120" +} +; --- Add a clipwall beneath the grass in the tent area +; --- Prevent hittables from being swallowed +{ + "classname" "env_physics_blocker" + "angles" "0 0 0" + "BlockType" "4" + "boxmaxs" "1024 1600 -8.2" + "boxmins" "-2400 -600 -128" + "initialstate" "1" + "targetname" "eb_fix_large_displacement" + "origin" "3072 2008 120" } ; ############ DIRECTOR AND EVENT CHANGES ########### @@ -633,6 +644,29 @@ add: "initialstate" "1" "BlockType" "1" } +; --- Block infected out of bounds / under the map spots by the ending saferoom +{ + "classname" "env_physics_blocker" + "origin" "-3001 9620 324" + "angles" "0 17 0" + "mins" "-500 -405 -50" + "maxs" "500 405 50" + "boxmins" "-500 -405 -50" + "boxmaxs" "500 405 50" + "initialstate" "1" + "BlockType" "0" +} +{ + "classname" "env_physics_blocker" + "origin" "-2925 9197 324" + "angles" "0 10 0" + "mins" "-500 -405 -50" + "maxs" "500 405 50" + "boxmins" "-500 -405 -50" + "boxmaxs" "500 405 50" + "initialstate" "1" + "BlockType" "0" +} ; ===================================================== ; == STUCK SPOTS == @@ -849,4 +883,4 @@ add: "normal.y" "-1" "normal.z" "0" "team" "2" -} \ No newline at end of file +} diff --git a/cfg/stripper/zonemod/maps/dc2025_2.cfg b/cfg/stripper/zonemod/maps/dc2025_2.cfg new file mode 100644 index 000000000..55a9bc20b --- /dev/null +++ b/cfg/stripper/zonemod/maps/dc2025_2.cfg @@ -0,0 +1,47 @@ +; ################ ITEM SPAWN CHANGES ############### +; ===================================================== +; == PILL / ITEM / WEAPON SPAWNS == +; == Remove or change pill, item & weapon spawns == +; ===================================================== +; Replace medkit spawns in the gun store with pill spawns +modify: +{ + match: + { + "hammerid" "5263118" + } + replace: + { + "classname" "weapon_pain_pills_spawn" + } +} +{ + match: + { + "hammerid" "5263137" + } + replace: + { + "classname" "weapon_pain_pills_spawn" + } +} +{ + match: + { + "hammerid" "5263124" + } + replace: + { + "classname" "weapon_pain_pills_spawn" + } +} +{ + match: + { + "hammerid" "5263115" + } + replace: + { + "classname" "weapon_pain_pills_spawn" + } +} \ No newline at end of file diff --git a/cfg/stripper/zonemod/maps/dc2025_3.cfg b/cfg/stripper/zonemod/maps/dc2025_3.cfg new file mode 100644 index 000000000..319f72e7c --- /dev/null +++ b/cfg/stripper/zonemod/maps/dc2025_3.cfg @@ -0,0 +1,88 @@ +; ################ ITEM SPAWN CHANGES ############### +; ===================================================== +; == PILL / ITEM / WEAPON SPAWNS == +; == Remove or change pill, item & weapon spawns == +; ===================================================== +; Replace medkit spawns by the activation button for the forklift with pill spawns +modify: +{ + match: + { + "hammerid" "17435086" + } + replace: + { + "classname" "weapon_pain_pills_spawn" + } +} +{ + match: + { + "hammerid" "17435084" + } + replace: + { + "classname" "weapon_pain_pills_spawn" + } +} +{ + match: + { + "hammerid" "17435082" + } + replace: + { + "classname" "weapon_pain_pills_spawn" + } +} +{ + match: + { + "hammerid" "17435080" + } + replace: + { + "classname" "weapon_pain_pills_spawn" + } +} +; Ensure weapons outside of saferoom are T1s +{ + match: + { + "hammerid" "17416396" + } + replace: + { + "weapon_selection" "any_smg" + } +} +{ + match: + { + "hammerid" "17416392" + } + replace: + { + "weapon_selection" "tier1_shotgun" + } +} +; Add pistols into starting saferoom so survivors have a better chance for the first hit as they run to the guns +add: +{ + "solid" "6" + "classname" "weapon_pistol_magnum_spawn" + "origin" "5477.84 -2499.21 316.25" + "angles" "0.00 101.77 270.00" + "spawnflags" "2" + "disableshadows" "1" + "count" "1" +} +{ + "solid" "6" + "classname" "weapon_pistol_spawn" + "origin" "5473.46 -2477.06 316.25" + "angles" "0.00 83.32 270.00" + "spawnflags" "2" + "disableshadows" "1" + "count" "2" +} \ No newline at end of file diff --git a/cfg/stripper/zonemod/maps/dc2025_4.cfg b/cfg/stripper/zonemod/maps/dc2025_4.cfg new file mode 100644 index 000000000..af94d214b --- /dev/null +++ b/cfg/stripper/zonemod/maps/dc2025_4.cfg @@ -0,0 +1,95 @@ +; ################ ITEM SPAWN CHANGES ############### +; ===================================================== +; == PILL / ITEM / WEAPON SPAWNS == +; == Remove or change pill, item & weapon spawns == +; ===================================================== +; Remove medkit spawns at the ambulance by the starting saferoom, just in case +; It's too close to the start anyways to justify replacing it with pills +filter: +{ + "hammerid" "3357715" +} +{ + "hammerid" "3357758" +} +{ + "hammerid" "3357762" +} +{ + "hammerid" "3357767" +} +; Replace medkit spawns at the ambulance before subway tunnel with pill spawns +modify: +{ + match: + { + "hammerid" "2977000" + } + replace: + { + "classname" "weapon_pain_pills_spawn" + } +} +{ + match: + { + "hammerid" "2977005" + } + replace: + { + "classname" "weapon_pain_pills_spawn" + } +} +{ + match: + { + "hammerid" "2977010" + } + replace: + { + "classname" "weapon_pain_pills_spawn" + } +} + +; Ensure weapons outside of saferoom are T1s +modify: +{ + match: + { + "hammerid" "3357953" + } + replace: + { + "weapon_selection" "any_smg" + } +} +{ + match: + { + "hammerid" "3357949" + } + replace: + { + "weapon_selection" "tier1_shotgun" + } +} +; Add pistols into starting saferoom so survivors have a better chance for the first hit as they run to the guns +add: +{ + "solid" "6" + "classname" "weapon_pistol_magnum_spawn" + "origin" "-4106.78 -2633.25 64.03" + "angles" "0.00 202.14 270.00" + "spawnflags" "2" + "disableshadows" "1" + "count" "1" +} +{ + "solid" "6" + "classname" "weapon_pistol_spawn" + "origin" "-4123.59 -2636.25 64.03" + "angles" "0.00 178.63 270.00" + "spawnflags" "2" + "disableshadows" "1" + "count" "2" +} \ No newline at end of file diff --git a/cfg/stripper/zonemod/maps/dc2025_5.cfg b/cfg/stripper/zonemod/maps/dc2025_5.cfg new file mode 100644 index 000000000..7cc4235e8 --- /dev/null +++ b/cfg/stripper/zonemod/maps/dc2025_5.cfg @@ -0,0 +1,27 @@ +; ################ ITEM SPAWN CHANGES ############### +; ===================================================== +; == PILL / ITEM / WEAPON SPAWNS == +; == Remove or change pill, item & weapon spawns == +; ===================================================== +; Ensure weapons inside starting saferoom are T1s +modify: +{ + match: + { + "hammerid" "2865103" + } + replace: + { + "weapon_selection" "any_smg" + } +} +{ + match: + { + "hammerid" "2865107" + } + replace: + { + "weapon_selection" "tier1_shotgun" + } +} \ No newline at end of file diff --git a/cfg/stripper/zonemod/maps/l4d2_city17_01.cfg b/cfg/stripper/zonemod/maps/l4d2_city17_01.cfg index 62e57fd94..188062cfd 100644 --- a/cfg/stripper/zonemod/maps/l4d2_city17_01.cfg +++ b/cfg/stripper/zonemod/maps/l4d2_city17_01.cfg @@ -1,6 +1,5 @@ ; ===================================================== -; ================= (v3) stripper by 锋锋(Aiden) ; ============ [l4d2_city17_01] [m1/5] [city 17] ; ===================================================== @@ -10,30 +9,13 @@ ; == Modify director behaviour and events == ; ===================================================== -; --- block the nav under new van car 阻挡面包车下的导航流 -;add: -;{ -; "classname" "logic_auto" -; "OnMapSpawn" "nb_van01,Blocknav,,5,-1" -;} -;{ -; "classname" "script_nav_blocker" -; "angles" "0 0 0" -; "maxs" "-400 -40 -64" -; "mins" "0 0 0" -; "extent" "160 20 64" -; "targetname" "nb_van01" -; "teamToBlock" "-1" -; "origin" "4128 -5044 -116" -;} - ; ################ ITEM SPAWN CHANGES ############### ; ===================================================== ; == PILL / ITEM / WEAPON SPAWNS == ; == Remove or change pill, item & weapon spawns == ; ===================================================== -; ---- remove too random pills 删除太随机的药 +; ---- remove overly remote pills spawn 剔除位置偏僻的药 filter: { "classname" "weapon_item_spawn" @@ -44,9 +26,9 @@ filter: "hammerid" "54540" } -; ---- add obvious pills 加固定的药 +; ---- add useful pills spawn 添加位置合理的药 add: -; -- alarmcar 警报车附近 +; -- near alarm-car 警报车附近 { "classname" "weapon_pain_pills_spawn" "angles" "0 0 0" @@ -64,7 +46,7 @@ add: ; == Add/remove/modify hittables == ; ===================================================== -; --- remove the white car near alarmcar 移除警报车旁边的白色车铁 +; --- remove the hittable white car near alarm-car 移除警报车旁边的白色车铁 filter: { "targetname" "car4" @@ -91,14 +73,14 @@ filter: ; == Prevent players from getting stuck in the map == ; ===================================================== -; --- remove a bad door cause stuck 移除一个会导致卡住的门 +; --- remove the door after alarm-car can cause Si get stuck 移除一个在警报车后的门,会导致特感卡住 filter: { ;"classname" "prop_door_rotating" "origin" "3613 1540 192.306" } -; --- block the leak of subway 用木板阻挡地铁的间隙 +; --- block the gap between metro models 封锁地铁模型之间的缝隙 add: { "classname" "prop_dynamic" @@ -141,7 +123,7 @@ add: ; == New props for balance and SI spawns == ; ===================================================== -; --- add van car/fence/barricade at saferoom 在安全屋添加面包车/围栏 +; --- add van-car & fence & barricade in start saferoom area 在安全屋添加面包车&围栏等模型 add: { "classname" "prop_dynamic" @@ -192,7 +174,7 @@ add: } -; --- Block LOS of van car/army car 适配面包车和军车的视线遮挡 +; --- Block LOS of van-car & army-car 适配面包车和军车的模型视线遮挡 add: { "classname" "logic_auto" @@ -224,7 +206,7 @@ add: "targetname" "losfix_armycar01" } -; --- add tips for static model 静态模型卡头提示 +; --- add warning signs for static models can snag Si 添加提示牌以提示特感有会卡头的静态模型 add: { "classname" "prop_dynamic" @@ -263,8 +245,7 @@ add: "disableshadows" "1" } - -; --- add box/rocks after saferoom help Si 出门后添加箱子和石块特感复活位 +; --- add crate & rock models after start saferoom 在安全屋外添加箱子和石块特感复活位 add: { "classname" "prop_dynamic" @@ -286,19 +267,7 @@ add: } -; --- add barrel round 1st door help SVv 在第一个门附近添加一个路障帮助处理室内克 -{ - "classname" "prop_dynamic" - "origin" "4428 -2440 -120" - "angles" "0 0 0" - "solid" "6" - "rendercolor" "255 255 255" - "model" "models/props_fairgrounds/traffic_barrel.mdl" - "disableshadows" "1" -} - -; --- add 3 barrier round alarmcar help Svv do tank fight -; --- 在警报车附近添加3个路障栏杆 +; --- add 3 barricades near alarm-car 在警报车附近添加三处路障 add: { "classname" "prop_dynamic" @@ -349,8 +318,8 @@ add: ; == Remove visual effects from the map == ; ===================================================== -; --- reduce the damge of a fire round saferoom 降低一个出门火的伤害 - +; --- lower damage of fire after start saferoom (can kill incap-Svv quickly) +; --- 降低出门处一个火焰的伤害(原伤害会快速烧死倒地生还) modify: { match: @@ -374,8 +343,8 @@ modify: ; == Fix triggers that interfere with gameplay == ; ===================================================== -; --- remove a ragdoll 移除一个布娃娃 - +; --- remove the ragdoll may causes clutter or physics issues +; --- 移除可能会导致干扰和物理碰撞问题的布娃娃实体 filter: { ;prop_ragdoll @@ -388,7 +357,7 @@ filter: ; == Add or change ladders == ; ===================================================== -;subway top 地铁顶部 +;metro top 地铁顶部 add: { "model" "*27" @@ -400,7 +369,7 @@ add: "origin" "2356.00 2554.00 -52.00" "angles" "0.00 270.00 0.00" } -;van car 开局面包车 +;starting van car 开局面包车 add: { "model" "*23" diff --git a/cfg/stripper/zonemod/maps/l4d2_city17_02.cfg b/cfg/stripper/zonemod/maps/l4d2_city17_02.cfg index 05412b2f6..ac71174ff 100644 --- a/cfg/stripper/zonemod/maps/l4d2_city17_02.cfg +++ b/cfg/stripper/zonemod/maps/l4d2_city17_02.cfg @@ -1,6 +1,5 @@ ; ===================================================== -; ================= (v3) stripper by 锋锋(Aiden) ; ============ [l4d2_city17_02] [m2/5] [city 17] ; ===================================================== @@ -10,23 +9,6 @@ ; == Modify director behaviour and events == ; ===================================================== -; ---- glow the new-human-ladder , when they press event button -; ---- 当生还到达机关点关上机关后,启用新人类爬梯 -modify: -{ - match: - { - "targetname" "finale_alarm_stop_button" - } - insert: - { - "OnPressed" "EB_lad1,Disable,,1,-1" - "OnPressed" "zmod_ladder1,Enable,,1,-1" - "OnPressed" "zmod_ladder1,StartGlowing,,1.1,-1" - "OnPressed" "zmod_ladder1,StopGlowing,,7,-1" - } -} - ; ################ ITEM SPAWN CHANGES ############### ; ===================================================== @@ -34,7 +16,7 @@ modify: ; == Remove or change pill, item & weapon spawns == ; ===================================================== -; ---- remove too random pills 删除太随机的药 +; ---- remove overly remote pills spawn 剔除位置偏僻的药 filter: { "classname" "weapon_item_spawn" @@ -47,23 +29,37 @@ filter: "hammerid" "35789" } -; ---- add obvious pills 加固定的药 +; ---- add useful pills spawn 添加位置合理的药 add: -; -- event button 机关按钮 +; -- alarm event end button room 警报机关按钮房间 { "classname" "weapon_pain_pills_spawn" "angles" "0 0 0" "spawnflags" "2" "origin" "1256 3708 628" } -; -- long ladder up wellhead 上井口 +; -- top of long ladder by wellhead 长爬梯上井口长处 { "classname" "weapon_pain_pills_spawn" "angles" "0 0 0" "spawnflags" "2" "origin" "2044 4188 740" } -; -- elevator 电梯口 +; -- stairs bottom after alarm event 警报机关后楼梯底部 +{ + "classname" "weapon_pain_pills_spawn" + "angles" "0 0 0" + "spawnflags" "2" + "origin" "1404 4240 436" +} +; -- white table before elevator 电梯前的白色桌子 +{ + "classname" "weapon_pain_pills_spawn" + "angles" "0 0 0" + "spawnflags" "2" + "origin" "2688 4244 408" +} +; -- elevator button 电梯口按钮处 { "classname" "weapon_pain_pills_spawn" "angles" "0 0 0" @@ -94,8 +90,8 @@ add: ; == Block players getting outside / under the map == ; ===================================================== -; --- block some spots cant get out or stuck tank spawn -; --- 阻挡一些出不来的点位/或是有可能卡住坦克刷新的点位 +; --- block some spots around elevator cause Si get stuck +; --- 封锁电梯周围一些可能导致特感卡住的区域 add: { "classname" "env_player_blocker" @@ -151,7 +147,7 @@ add: ; == Prevent players from getting stuck in the map == ; ===================================================== -; --- cancel the alarm sign collsion 取消警报门的碰撞 +; --- cancel the alarm-door sign model collsion 取消警报门的碰撞 modify: { match: @@ -164,8 +160,7 @@ modify: } } -; --- move func_orator to another side to unblock new ladder -; --- 将对讲机实体移走防止挡路 +; --- move func_orator(a model with collision) to clear new Si ladder 将对讲机移开以疏通新特感爬梯(此实体具有碰撞) modify: { match: @@ -190,17 +185,8 @@ modify: ; == New props for balance and SI spawns == ; ===================================================== -; --- add handrails round event button 在机关终点附近添加围栏 +; --- add handrail models round alarm event room 在机关终点附近添加围栏 add: -{ - "angles" "0 180 0" - "disableshadows" "1" - "model" "models/props_C17/Handrail04_Medium.mdl" - "rendercolor" "255 128 0" - "origin" "652 4108 648" - "solid" "6" - "classname" "prop_dynamic" -} { "angles" "0 180 0" "disableshadows" "1" @@ -220,16 +206,7 @@ add: "classname" "prop_dynamic" } -; --- add handrails/pipeset round long ladder 在长爬梯添加扶手/管道/箱子 -{ - "angles" "0 90 0" - "disableshadows" "1" - "model" "models/props_c17/handrail04_short.mdl" - "rendercolor" "255 128 0" - "origin" "1656 4240 760" - "solid" "6" - "classname" "prop_dynamic" -} +; --- add models near long ladder 在长爬梯处添加模型 { "angles" "0 180 -90" "disableshadows" "1" @@ -249,7 +226,7 @@ add: "classname" "prop_dynamic" } -; --- block the top leak of a room 封锁电梯附近双扇门房间顶部的缝隙 +; --- block ceiling leak of the room near elevator 封锁电梯附近双扇门房间顶部的缝隙 { "angles" "0 180 0" "disableshadows" "1" @@ -260,7 +237,7 @@ add: "classname" "prop_dynamic" } -; --- add a table help svv round elevt 在电梯附近添加一个桌子模型 +; --- add a table near elevator 在电梯附近添加一个桌子模型 { "angles" "-75 330 0" "disableshadows" "1" @@ -271,7 +248,7 @@ add: "classname" "prop_dynamic" } -; --- add a box left elevt exit 出电梯添加一个纸箱模型 +; --- add a carton box by left elevator exit 在左侧电梯出口添加纸箱 { "angles" "0 10 0" "disableshadows" "1" @@ -308,7 +285,6 @@ add: ; ===================================================== ; ---- remove 2 brush doors round elevt 删除电梯附近的两扇门 - filter: { "targetname" "swinging_door_1" @@ -329,45 +305,20 @@ filter: ; == Add or change ladders == ; ===================================================== -; ---- add big ladder1 加一个轮回点后置爬梯 - -add: -; -- ladder1 model 爬梯模型,关机关后显示 -{ - "classname" "prop_dynamic" - "targetname" "zmod_ladder1" - "angles" "0 0 0" - "disableshadows" "1" - "model" "models/props_highway/billboard_ladder.mdl" - "rendercolor" "255 255 255" - "origin" "284 3832 184" - "solid" "0" - "StartDisabled" "1" -} -; -- ladder1 EB 人类空气墙,关机关后移除 -{ - "classname" "env_physics_blocker" - "targetname" "EB_lad1" - "BlockType" "1" - "maxs" "4 20 0" - "mins" "-2 -16 -264" - "initialstate" "1" - "origin" "256 3832 624" -} -; -- ladder1 ladder 机关点爬梯,1楼上3楼,关机关后人类可用 +;big concrete pole alarm event ground 机关点空地的大水泥柱 add: { "model" "*67" "normal.z" "0.00" "normal.y" "0.00" "normal.x" "-1.00" - "team" "0" + "team" "2" "classname" "func_simpleladder" "origin" "0.00 0.00 0.00" "angles" "0.00 0.00 0.00" } -;elevator 电梯附近 +;around elevator 电梯附近 add: { "model" "*68" @@ -408,7 +359,7 @@ add: ; == Add light or remove == ; ===================================================== -; -- add 2 lights round elevt 在电梯附近添加2处光源 +; -- add 2 lights near elevator improve sight 在电梯附近添加2处光源改善视野 add: { "classname" "light_dynamic" diff --git a/cfg/stripper/zonemod/maps/l4d2_city17_03.cfg b/cfg/stripper/zonemod/maps/l4d2_city17_03.cfg index 965d6f45e..c2b4e9a68 100644 --- a/cfg/stripper/zonemod/maps/l4d2_city17_03.cfg +++ b/cfg/stripper/zonemod/maps/l4d2_city17_03.cfg @@ -1,6 +1,5 @@ ; ===================================================== -; ================= (v3) stripper by 锋锋(Aiden) ; ============ [l4d2_city17_03] [m3/5] [city 17] ; ===================================================== @@ -17,7 +16,7 @@ ; == Remove or change pill, item & weapon spawns == ; ===================================================== -; ---- remove too random pills 删除太随机的药 +; ---- remove overly remote pills spawn 剔除位置偏僻的药 filter: { "classname" "weapon_item_spawn" @@ -33,17 +32,23 @@ filter: "hammerid" "175785" } -; ---- add obvious pills 加固定的药 - +; ---- add useful pills spawn 添加位置合理的药 add: -; -- the ruin building 废墟2楼 +; -- 2nd floor of the ruined building 废墟建筑的2楼 { "classname" "weapon_pain_pills_spawn" "angles" "0 0 0" "spawnflags" "2" "origin" "992 1776 192" } -; -- broken stairs 坏楼梯 +; -- down the yellow ladder 下黄色爬梯处 +{ + "classname" "weapon_pain_pills_spawn" + "angles" "0 0 0" + "spawnflags" "2" + "origin" "-520 208 0" +} +; -- broken stairs before event 机关前的坏楼梯处 { "classname" "weapon_pain_pills_spawn" "angles" "0 0 0" @@ -58,7 +63,7 @@ add: "origin" "-4272 464 32.816" } -; --- remove kits 删包 +; --- remove first-aid kit spawns 删除医疗包 filter: { "classname" "weapon_first_aid_kit_spawn" @@ -93,13 +98,8 @@ add: ; == Block intentionally performed exploits == ; ===================================================== -; ===================================================== -; == OUT OF BOUNDS == -; == Block players getting outside / under the map == -; ===================================================== - -; --- prevent incap svv on the platform down the ladder -; --- 避免倒地生还倒在下梯子附近的平台上导致救不到 +; --- add Svv clipwall for the building left the yellow ladder platform +; --- 为黄色爬梯平台后左侧建筑添加空气墙 add: { "classname" "env_player_blocker" @@ -107,17 +107,53 @@ add: "initialstate" "1" "maxs" "8 8 800" "mins" "-480 -600 -80" - "targetname" "eb2" + "targetname" "eb_fx03" "origin" "-40 184 208" } +; --- add Svv clipwall for the building after start saferoom +; --- 为出门后的废墟添加空气墙 +{ + "classname" "env_physics_blocker" + "angles" "0 0 0" + "BlockType" "1" + "boxmaxs" "16 96 400" + "boxmins" "-36 -96 -200" + "initialstate" "1" + "targetname" "eb_fx04a" + "origin" "2940 -728 216" +} +{ + "classname" "env_physics_blocker" + "angles" "0 -23 0" + "BlockType" "1" + "boxmaxs" "16 56 400" + "boxmins" "-16 -64 -200" + "initialstate" "1" + "targetname" "eb_fx04b" + "origin" "2944 -576 216" +} +{ + "classname" "env_physics_blocker" + "angles" "0 0 0" + "BlockType" "1" + "boxmaxs" "240 360 400" + "boxmins" "-100 -100 -200" + "initialstate" "1" + "targetname" "eb_fx05" + "origin" "2996 -1206 328" +} + +; ===================================================== +; == OUT OF BOUNDS == +; == Block players getting outside / under the map == +; ===================================================== ; ===================================================== ; == STUCK SPOTS == ; == Prevent players from getting stuck in the map == ; ===================================================== - -; --- block the leak of building right alarmcar +; --- block the building gap right of the alarm-car with planks ; --- 用木板阻挡警报车右边楼房的间隙 add: { @@ -148,8 +184,8 @@ add: "disableshadows" "1" } -; --- smooth the sand between ruin house -; --- 垫平废墟楼的中间沙地 +; --- level the sand patch between ruined building +; --- 垫平废墟建筑过渡地段的沙地 { "classname" "env_player_blocker" "BlockType" "0" @@ -160,8 +196,8 @@ add: "origin" "1120 1528 120" } -; --- block the final tunnel front of safedoor -; --- 阻挡门前的桥洞 +; --- block the final tunnel before end saferoom +; --- 为终点门前的桥洞添加空气墙 { "classname" "env_player_blocker" "BlockType" "0" @@ -185,8 +221,8 @@ add: ; == New props for balance and SI spawns == ; ===================================================== -; ---- add boxes, trees, container round the alarmcar -; ---- 在警报车(克局点)附近添加模型帮助特感复活/进攻 +; ---- add obstacle models near the small grass patch (crate & tree & container ...) +; ---- 在小草地附近添加障碍物模型(箱子&树&集装箱等...) add: { "classname" "prop_dynamic" @@ -247,7 +283,7 @@ add: "angles" "0 207 0" "disableshadows" "1" "model" "models/props_equipment/cargo_container02.mdl" - "rendercolor" "18 190 62" + "rendercolor" "99 103 100" "origin" "1944 776 0" "solid" "6" } @@ -257,7 +293,7 @@ add: "disableshadows" "1" "model" "models/props_fairgrounds/foodcart.mdl" "rendercolor" "255 255 255" - "origin" "2536 400 -8" + "origin" "2536 400 -4" "solid" "6" } @@ -281,7 +317,7 @@ add: } -; ---- add box round ruin house 废墟楼附近添加一个大箱子 +; ---- add crate near ruined building 废墟楼附近添加一个大箱子 add: { "classname" "prop_dynamic" @@ -293,30 +329,56 @@ add: "solid" "6" } -; ---- add barrels down the ladder 下梯子处添加障碍物 +; ---- add obstacle models down the yellow ladder 下黄色梯子处添加障碍物 add: { "classname" "prop_dynamic" - "angles" "0 0 0" + "angles" "0 270 0" "disableshadows" "1" - "model" "models/props_industrial/pallet_barrels_water01_docks.mdl" + "model" "models/props_vehicles/van.mdl" "rendercolor" "255 255 255" - "origin" "-96 352 0" + "origin" "-312 704 0" + "solid" "6" +} +{ + "classname" "prop_dynamic" + "angles" "0 270 0" + "disableshadows" "1" + "model" "models/props_vehicles/van_glass.mdl" + "rendercolor" "255 255 255" + "origin" "-312 704 0" + "solid" "6" +} +{ + "classname" "prop_dynamic" + "angles" "0 90 0" + "disableshadows" "1" + "model" "models/props_vehicles/hmmwv_supply.mdl" + "rendercolor" "255 255 255" + "origin" "-176 416 -5" "solid" "6" } { "classname" "prop_dynamic" "angles" "0 135 0" "disableshadows" "1" - "model" "models/props_fortifications/concrete_barrier001_96_reference.mdl" - "rendercolor" "150 127 18" - "origin" "-352 520 -8" + "model" "models/props_industrial/pallet_barrels_water01_docks.mdl" + "rendercolor" "255 255 255" + "origin" "-32 352 -4" "solid" "6" } +{ + "classname" "prop_dynamic" + "angles" "0 270 0" + "disableshadows" "1" + "model" "models/props_rooftop/gutter_pipe_256.mdl" + "rendercolor" "255 255 255" + "origin" "-300 194 256" + "solid" "0" +} -; ---- add poles, boxes, round the barricade event -; ---- 在机关点附近添加模型帮助人类绕铁 - +; ---- add models front of the barricade event (poles & crate) +; ---- 在机关点前侧添加模型(铁杆和箱子) add: { "classname" "prop_dynamic" @@ -376,53 +438,16 @@ add: -; ---- add tents, truck, container before the saferoom -; ---- 在安全屋前添加模型帮助特感复活/进攻 - +; ---- add models before end saferoom +; ---- 在安全屋前添加一些模型 add: -{ - "classname" "prop_dynamic" - "angles" "0 15 0" - "disableshadows" "1" - "model" "models/props_vehicles/semi_trailer_freestanding.mdl" - "rendercolor" "255 255 255" - "origin" "-6400 1704 -14.9321" - "solid" "6" -} -{ - "classname" "prop_dynamic" - "angles" "0 270 0" - "disableshadows" "1" - "model" "models/props_equipment/cargo_container04.mdl" - "rendercolor" "255 128 64" - "origin" "-6672 1336 -16" - "solid" "6" -} { "classname" "prop_dynamic" "angles" "0 90 0" "disableshadows" "1" - "model" "models/props_equipment/cargo_container02_doors_open_right.mdl" - "rendercolor" "255 128 64" - "origin" "-6688 1336 -16" - "solid" "6" -} -{ - "classname" "prop_dynamic" - "angles" "0 0 0" - "disableshadows" "1" - "model" "models/props_misc/fairground_tent_closed.mdl" - "rendercolor" "255 0 0" - "origin" "-6224 1096 -16" - "solid" "6" -} -{ - "classname" "prop_dynamic" - "angles" "0 0 0" - "disableshadows" "1" - "model" "models/props_misc/fairground_tent_closed.mdl" - "rendercolor" "27 57 167" - "origin" "-6656 576 -24" + "model" "models/props_vehicles/bus01.mdl" + "rendercolor" "255 255 255" + "origin" "-6364 1488 -16" "solid" "6" } { @@ -444,6 +469,14 @@ add: "solid" "6" } +; ---- remove oil barrel models before end saferoom +; ---- 移除终点安全门前的卡脚大油桶模型 +filter: +{ + "classname" "prop_physics" + "model" "models/props_c17/oildrum001.mdl" +} + ; ===================================================== ; == LADDER / ELEVATOR NERF == ; == Nerf ladder & elevator attacks for infected == @@ -461,8 +494,8 @@ add: ; == Remove visual effects from the map == ; ===================================================== -; --- Remove the storm start relay and storm start effects relay -; --- 移除暴雨触发效果和相关事件 +; --- remove the storm trigger logics and effects +; --- 移除暴雨天气的触发效果和相关事件 filter: { "targetname" "relay_storm_start" @@ -499,7 +532,7 @@ filter: ; == Add or change ladders == ; ===================================================== -;before ruin house 废墟楼之前 +;before ruined building 废墟楼之前 ;lad01 add: { @@ -526,7 +559,7 @@ add: } -;round ruin house 废墟楼附近 +;near ruined building 废墟楼附近 add: { "model" "*6" @@ -550,7 +583,7 @@ add: "angles" "0.00 270.00 0.00" } -;after ruin house 废墟楼之后 +;after ruined building 废墟楼之后 ;lad03 add: { @@ -612,22 +645,6 @@ add: "angles" "0.00 0.00 0.00" } - -;lad08 -;broken stairs (Si can get back) 坏楼梯处,特感可以返回 -;might be too powerful 也许太超模了,暂不启用 -;add: -;{ -; "model" "*124" -; "normal.z" "0.00" -; "normal.y" "-0.25" -; "normal.x" "-0.96" -; "team" "2" -; "classname" "func_simpleladder" -; "origin" "-687.45 -632.96 83.04" -; "angles" "0.00 360.00 0.00" -;} - ; ####### MISCELLANEOUS / MAP SPECIFIC CHANGES ###### ; ===================================================== ; == BLANK HEADER == diff --git a/cfg/stripper/zonemod/maps/l4d2_city17_04.cfg b/cfg/stripper/zonemod/maps/l4d2_city17_04.cfg index e5c087e9e..db54b03a4 100644 --- a/cfg/stripper/zonemod/maps/l4d2_city17_04.cfg +++ b/cfg/stripper/zonemod/maps/l4d2_city17_04.cfg @@ -1,6 +1,5 @@ ; ===================================================== -; ================= (v3) stripper by 锋锋(Aiden) ; ============ [l4d2_city17_04] [m4/5] [city 17] ; ===================================================== @@ -10,12 +9,14 @@ ; == Modify director behaviour and events == ; ===================================================== -; ---- add a human ladder ,when they press the 2nd bridge button -; ---- the new ladder can climb to 1st bridge -; ---- 当生还按下大轮回按钮后,开启新增的人梯 -; ---- 新梯子可以爬上小轮回 +; ---- add a Svv-ladder mechanism with bridge event +; ---- 1,enable this ladder when event button pressed +; ---- 2,this ladder can climb to 1st bridge +; ---- 在桥机关点添加一个生还爬梯机制 +; ---- 1.当生还按下大轮回机关按钮后,激活新增的人梯 +; ---- 2.新梯子可以爬上小轮回 -; --- modify the IO in button 给按钮新增触发 +; --- add trigger outputs into event button 为机关按钮添加触发输出 modify: { match: @@ -27,39 +28,40 @@ modify: { "OnPressed" "zmod_ladder1,Enable,,6,-1" "OnPressed" "zmod_ladder1,StartGlowing,,7,1" - "OnPressed" "zmod_ladder1,StopGlowing,,15,1" - "OnPressed" "EB_lad01,Disable,,6.5,1" - "OnPressed" "zmod_ladder2,Enable,,6,-1" - "OnPressed" "zmod_ladder2,StartGlowing,,7,1" - "OnPressed" "zmod_ladder2,StopGlowing,,15,1" - "OnPressed" "EB_lad02,Disable,,6.5,1" + "OnPressed" "eb_lad01,Disable,,6.5,1" } } add: -; -- ladder1 model 爬梯1的模型 +; -- visible ladder1 model 爬梯1的模型 { "classname" "prop_dynamic" "targetname" "zmod_ladder1" "angles" "0 90 0" "disableshadows" "1" "model" "models/props_highway/billboard_ladder.mdl" - "rendercolor" "255 255 255" + "rendercolor" "33 33 33" "origin" "1112 2708 -340" "solid" "0" "StartDisabled" "1" + "glowrange" "256" + "glowrangemin" "64" + "glowstate" "2" } -; -- ladder1 EB 爬梯1的空气墙 +; -- ladder1 clipwall 爬梯1的空气墙 { "classname" "env_physics_blocker" - "targetname" "EB_lad01" + "angles" "0 0 0" + "targetname" "eb_lad01" "BlockType" "1" "maxs" "18 4 0" "mins" "-18 0 -264" + "boxmaxs" "18 4 0" + "boxmins" "-18 0 -264" "initialstate" "1" "origin" "1112 2680 92" } -; -- ladder1 ladder 爬梯1 +; -- ladder1 ladder 爬梯1本体 add: { "model" "*279" @@ -72,60 +74,13 @@ add: "angles" "0.00 0.00 0.00" } - -add: -; -- ladder1 model 爬梯2的模型 -{ - "classname" "prop_dynamic" - "targetname" "zmod_ladder2" - "angles" "0 180 0" - "disableshadows" "1" - "model" "models/props_highway/billboard_ladder.mdl" - "rendercolor" "255 255 255" - "origin" "684 2867 -448" - "solid" "0" - "StartDisabled" "1" -} -; -- ladder1 EB 爬梯2的空气墙 -{ - "classname" "env_player_blocker" - "BlockType" "1" - "initialstate" "1" - "maxs" "4 16 80" - "mins" "-4 -16 -160" - "targetname" "EB_lad02" - "origin" "704 2864 48" -} -{ - "classname" "env_player_blocker" - "BlockType" "0" - "initialstate" "1" - "maxs" "80 8 40" - "mins" "-8 0 -80" - "targetname" "EB_lad02a" - "origin" "712 2848 -60" -} -; -- ladder1 ladder 爬梯2 -add: -{ - "model" "*269" - "normal.z" "0.00" - "normal.y" "0.00" - "normal.x" "1.00" - "team" "0" - "classname" "func_simpleladder" - "origin" "-2184.00 2590.00 -244.00" - "angles" "0.00 270.00 0.00" -} - - ; ################ ITEM SPAWN CHANGES ############### ; ===================================================== ; == PILL / ITEM / WEAPON SPAWNS == ; == Remove or change pill, item & weapon spawns == ; ===================================================== -; ---- remove too random pills 删除太随机的药 +; ---- remove overly remote pills spawn 剔除位置偏僻的药 filter: { "classname" "weapon_item_spawn" @@ -156,30 +111,30 @@ filter: "hammerid" "330557" } -; ---- add obvious pills 加固定的药 +; ---- add useful pills spawn 添加位置合理的药 add: -; -- the bridge button 放桥机关点 +; -- the event button area 大轮回放桥机关点 { "classname" "weapon_pain_pills_spawn" "angles" "0 0 0" "spawnflags" "2" "origin" "-20 2640 256" } -; -- after the bridge 过桥后 +; -- after the event 大轮回放桥机关点后 { "classname" "weapon_pain_pills_spawn" "angles" "0 0 0" "spawnflags" "2" "origin" "-36 4052 320" } -; -- after plane crash 坠机点后 +; -- after plane crash house 坠机房后不远处 { "classname" "weapon_pain_pills_spawn" "angles" "0 0 0" "spawnflags" "2" "origin" "-4676 6292 308" } -; -- the minigun 重机枪附近 +; -- the middle section of the hospital 医院的中段路程处 { "classname" "weapon_pain_pills_spawn" "angles" "0 0 0" @@ -187,13 +142,13 @@ add: "origin" "-6588 5080 348" } -; --- remove cabinet 删药箱 +; --- remove health cabinet spawn 移除药箱 filter: { "classname" "prop_health_cabinet" } -; --- remove kit 删包 +; --- remove first-aid kit spawns 删除医疗包 filter: { "classname" "weapon_first_aid_kit_spawn" @@ -257,7 +212,7 @@ add: ; == Prevent players from getting stuck in the map == ; ===================================================== -; --- block the spots cant get out 封闭卡点 +; --- block the spots cant get out 封闭无法出去的点位 add: { "classname" "env_player_blocker" @@ -279,22 +234,28 @@ add: "origin" "-1072 2484 176" } -; --- down the 1st hole 第1个下洞口 +; --- down the 1st hole in hospital 医院内的第1个下洞口 { - "classname" "env_player_blocker" + "classname" "env_physics_blocker" + "angles" "0 0 0" "BlockType" "0" - "initialstate" "1" "maxs" "300 80 0" "mins" "-8 -128 -8" + "boxmaxs" "300 80 0" + "boxmins" "-8 -128 -8" + "initialstate" "1" "targetname" "eb_fix04a" "origin" "-6000 6296 164" } { - "classname" "env_player_blocker" + "classname" "env_physics_blocker" + "angles" "0 0 0" "BlockType" "0" - "initialstate" "1" "maxs" "200 64 8" "mins" "-8 -120 -8" + "boxmaxs" "200 64 8" + "boxmins" "-8 -120 -8" + "initialstate" "1" "targetname" "eb_fix04b" "origin" "-5984 6296 164" } @@ -311,7 +272,7 @@ add: ; == New props for balance and SI spawns == ; ===================================================== -; ---- add box help Si spawn after saferoom 出门的围栏后加木箱复活点 +; --- add middle crate behind starting fence 出门的围栏后加木箱模型 add: { "classname" "prop_dynamic" @@ -323,7 +284,7 @@ add: "disableshadows" "1" } -; ---- add poles/box help Svv dodge cars 加栏杆和木箱帮助生还躲铁 +; --- add pole & crate models on starting road 在出门的大路上加栏杆和木箱模型 add: { "classname" "prop_dynamic" @@ -373,53 +334,45 @@ add: } -; -- hole after 1st bridge 小桥后的小2楼 +; --- add a orange handrail model at the building gap before the event +; --- 机关点前的建筑缺口处添加一个橙色栏杆模型 add: { "classname" "prop_dynamic" "origin" "660 2868 160" "angles" "0 90 0" "solid" "6" - "rendercolor" "255 1 1" - "model" "models/props_c17/handrail04_short.mdl" - "disableshadows" "1" -} -{ - "classname" "prop_dynamic" - "origin" "548 2868 160" - "angles" "0 90 0" - "solid" "6" "rendercolor" "255 100 26" "model" "models/props_C17/handrail04_short.mdl" "disableshadows" "1" } -; -- add pipes make Svv could jump down bottom fast -; -- 添加管道,使生还可以快速下到地面 +; --- add models below the opposite side of the event bridge, make Svv could jump down fastly +; --- 在机关桥的另一端下方添加模型,使生还可以快速下到地面 add: { "classname" "prop_dynamic" - "origin" "200 3516 184" - "angles" "0 0 0" + "origin" "192 3488 156" + "angles" "0 270 0" "solid" "6" "rendercolor" "255 255 255" - "model" "models/props_pipes/pipeset32d_corner128r_001a.mdl" + "model" "models/props_rooftop/acunit01.mdl" "disableshadows" "1" } { "classname" "prop_dynamic" - "origin" "104 3488 4" - "angles" "90 0 0" + "origin" "132 3500 -76" + "angles" "0 0 0" "solid" "6" "rendercolor" "255 255 255" - "model" "models/props_pipes/pipeset32d_corner128r_001a.mdl" + "model" "models/props_foliage/urban_hedge_256_128_high.mdl" "disableshadows" "1" } -; ---- add barricades, playwoods, round the plane event -; ---- 在坠机房屋附近添加模型帮助特感复活和人类绕克 +; ---- add barricades & playwoods models in the plane crash house +; ---- 在坠机房周围添加路障、木板等模型 add: { "classname" "prop_dynamic" @@ -482,7 +435,7 @@ add: ; == Remove or adjust sounds played by the map == ; ===================================================== -; --- reduce the crash sounds 降低坠机音量 +; --- lower the volume of the plane crash 降低坠机音量 modify: { match: @@ -506,127 +459,22 @@ modify: ; ===================================================== ; --- remove smogs to improve FPS 删烟提升帧数 - -; --- remove smog 删烟 filter: { "classname" "func_precipitation" } -; --- remove smoke 删烟 -filter: { "classname" "func_smokevolume" } - -; --- add tips for clip wall around plane event house -; --- 给追机房的空气墙加一些特感提示 -; --- cancled 暂不启用 - -; add: -; { -; "classname" "prop_dynamic" -; "origin" "-3396 6372 604" -; "angles" "0 90 0" -; "solid" "0" -; "rendercolor" "255 255 255" -; "model" "models/props_misc/wrongway_sign01.mdl" -; "disableshadows" "1" -; } -; { -; "classname" "prop_dynamic" -; "origin" "-3008 6372 604" -; "angles" "0 90 0" -; "solid" "0" -; "rendercolor" "255 255 255" -; "model" "models/props_misc/wrongway_sign01.mdl" -; "disableshadows" "1" -; } -; { -; "classname" "prop_dynamic" -; "origin" "-3396 6352 604" -; "angles" "0 270 0" -; "solid" "0" -; "rendercolor" "255 255 255" -; "model" "models/props_misc/wrongway_sign01.mdl" -; "disableshadows" "1" -; } -; { -; "classname" "prop_dynamic" -; "origin" "-3008 6352 604" -; "angles" "0 270 0" -; "solid" "0" -; "rendercolor" "255 255 255" -; "model" "models/props_misc/wrongway_sign01.mdl" -; "disableshadows" "1" -; } - - -; { -; "classname" "prop_dynamic" -; "origin" "-3880 6148 544" -; "angles" "0 0 0" -; "solid" "0" -; "rendercolor" "255 255 255" -; "model" "models/props_misc/wrongway_sign01.mdl" -; "disableshadows" "1" -; } -; { -; "classname" "prop_dynamic" -; "origin" "-3896 6152 544" -; "angles" "0 180 0" -; "solid" "0" -; "rendercolor" "255 255 255" -; "model" "models/props_misc/wrongway_sign01.mdl" -; "disableshadows" "1" -; } -; { -; "classname" "prop_dynamic" -; "origin" "-3892 5892 544" -; "angles" "0 180 0" -; "solid" "0" -; "rendercolor" "255 255 255" -; "model" "models/props_misc/wrongway_sign01.mdl" -; "disableshadows" "1" -; } -; { -; "classname" "prop_dynamic" -; "origin" "-3876 5888 544" -; "angles" "0 0 0" -; "solid" "0" -; "rendercolor" "255 255 255" -; "model" "models/props_misc/wrongway_sign01.mdl" -; "disableshadows" "1" -; } - -; { -; "classname" "prop_dynamic" -; "origin" "-3892 5636 544" -; "angles" "0 180 0" -; "solid" "0" -; "rendercolor" "255 255 255" -; "model" "models/props_misc/wrongway_sign01.mdl" -; "disableshadows" "1" -; } -; { -; "classname" "prop_dynamic" -; "origin" "-3876 5632 544" -; "angles" "0 0 0" -; "solid" "0" -; "rendercolor" "255 255 255" -; "model" "models/props_misc/wrongway_sign01.mdl" -; "disableshadows" "1" -; } - - ; ############### TRIGGERS AND BRUSHES ############## ; ===================================================== ; == CLIP REMOVAL == ; == Remove miscellaneous clips and brushes == ; ===================================================== -; -- remove Si clip wall in plane event house -; -- 移除追机房的特感空气墙 +; -- remove Si clipwalls in plane crash house +; -- 移除坠机房的特感空气墙 filter: { "classname" "func_playerinfected_clip" @@ -644,7 +492,7 @@ filter: ; == Add or change ladders == ; ===================================================== -; -- bus after saferoom 出门公交车 +; -- starting area bus 出门公交车 add: { "model" "*273" @@ -657,7 +505,7 @@ add: "angles" "0.00 0.00 0.00" } -; -- hole after 1st bridge 小桥后的小2楼 +; -- up the building gap before the event 机关前的建筑缺口 add: { "model" "*269" @@ -670,7 +518,32 @@ add: "angles" "0.00 0.00 0.00" } -; -- plane event 坠机房间 +; -- below 1st bridge 小轮回下方的栏杆 +add: +{ + "model" "*269" + "normal.z" "0.00" + "normal.y" "-1.00" + "normal.x" "0.00" + "team" "2" + "classname" "func_simpleladder" + "origin" "464.98 5736.00 -272.00" + "angles" "0.00 180.00 0.00" +} +{ + "model" "*269" + "normal.z" "0.00" + "normal.y" "1.00" + "normal.x" "0.00" + "team" "2" + "classname" "func_simpleladder" + "origin" "1008.00 -32.00 -276.00" + "angles" "0.00 0.00 0.00" +} + +; ---- plane crash event 坠机房间爬梯 + +; -- visible model 可见模型 add: { "classname" "prop_dynamic" @@ -681,6 +554,7 @@ add: "model" "models/props_urban/telephone_pole001.mdl" "disableshadows" "1" } +; -- ladder clipwall 小型空气墙 { "classname" "env_player_blocker" "BlockType" "0" @@ -690,7 +564,7 @@ add: "targetname" "eb03" "origin" "-3328 5628 388" } -add: +; -- Si ladder 爬梯本体 { "model" "*269" "normal.z" "0.00" @@ -698,11 +572,29 @@ add: "normal.x" "0.00" "team" "2" "classname" "func_simpleladder" - "origin" "-3050.00 2763.00 250.50" + "origin" "-3054.00 2763.00 250.50" "angles" "0.00 0.00 0.00" } +; -- remove the breakable plank at ladder top 移除爬梯顶部木板 +filter: +{ + "classname" "func_breakable" + "origin" "-3394.5 5723.09 474" +} +; -- usability optimization 爬梯的使用优化 +modify: +{ + match: + { + "targetname" "brush_broken_boards_gunshipshowdown_01" + } + replace: + { + "StartDisabled" "0" + } +} -; -- down the 1st hole 第1个下洞口 +; -- down the 1st hole in hospital 医院内的第1个下洞口 add: { "classname" "prop_dynamic" diff --git a/cfg/stripper/zonemod/maps/l4d2_city17_05.cfg b/cfg/stripper/zonemod/maps/l4d2_city17_05.cfg index 72331267d..4a9b1a5c9 100644 --- a/cfg/stripper/zonemod/maps/l4d2_city17_05.cfg +++ b/cfg/stripper/zonemod/maps/l4d2_city17_05.cfg @@ -1,6 +1,5 @@ ; ===================================================== -; ================= (v3) stripper by 锋锋(Aiden) ; ============ [l4d2_city17_05] [m5/5] [city 17] ; ===================================================== @@ -29,7 +28,7 @@ modify: ; == Remove or change pill, item & weapon spawns == ; ===================================================== -; ---- remove some pills 删除路上的药 +; ---- remove pills spawn before finale area 删除救援场地之前路上的药 filter: { "hammerid" "120505" @@ -43,13 +42,13 @@ filter: "targetname" "forcoop" } -; ---- remove kits 删除医疗包 +; --- remove first-aid kit spawns 删除医疗包 filter: { "classname" "weapon_first_aid_kit_spawn" } -; ---- add fixed pills on train area 在轨道区域添加1个药 +; ---- add 1 static pill on track area 在轨道区域添加1个药 add: { "classname" "weapon_pain_pills_spawn" @@ -64,7 +63,7 @@ add: ; "origin" "10842 9264 -798" ;} -; ---- add fixed pills on platform area 在平台区域添加2个药 +; ---- add 2 static pills on radio platform area 在无线电高台区域添加2个药 { "classname" "weapon_pain_pills_spawn" "angles" "0 0 0" @@ -78,7 +77,7 @@ add: "origin" "12210 8782 -548" } -; ---- add 1 melee on finale area 在救援区域添加1个近战 +; ---- add 1 machete melee in finale area 在救援区域添加1个开山刀近战 { "classname" "weapon_melee_spawn" "angles" "0 300 90" @@ -103,7 +102,7 @@ add: ; == Add/remove/modify hittables == ; ===================================================== -; --- add a car on square 在广场上放置一个车铁 +; --- add a red hittable car on starting square 在开局广场上放置一个红色车铁 add: ;"id" "1377153" { @@ -132,8 +131,8 @@ add: ; == Prevent players from getting stuck in the map == ; ===================================================== -; --- use some clips connect the iron plate -; --- 使用小片空气墙连接铁板和地面 +; --- use some clipwalls connect the ground and the dynamic iron plate, prevent AI tank getting stuck +; --- 使用小片空气墙连接铁板和地面,防止AI坦克卡住 add: { "classname" "env_player_blocker" @@ -163,8 +162,8 @@ add: "origin" "8508 10892 -760" } -; --- add some clips round deadbodies -; --- 尸体堆旁添加一些垫脚防卡 +; --- add some clipwalls for deadbodies under train, to prevent snagging +; --- 为火车房的尸体堆加一些垫脚防卡空气墙 add: { "classname" "env_player_blocker" @@ -199,7 +198,7 @@ add: ; == New props for balance and SI spawns == ; ===================================================== -; --- add a door for container 给集装箱加门 +; --- add a door model for container on starting square 给开局广场上的一个集装箱增加门模型 add: { "classname" "prop_dynamic" @@ -212,7 +211,7 @@ add: } -; --- add a table at train area 在火车轨道区域放置一个桌子 +; --- add a table in tracks area 在火车轨道区域放置一个桌子 add: { "classname" "prop_dynamic" @@ -224,7 +223,7 @@ add: "disableshadows" "1" } -; --- fix the final barrel collsion 修复围栏的无碰撞问题 +; --- fix the non-collision issue of the fence model in track area 修复轨道区域围栏模型的无碰撞问题 add: { "classname" "prop_dynamic" @@ -236,7 +235,7 @@ add: "model" "models/props_street/police_barricade3.mdl" "disableshadows" "1" } -; --- delete this barrel while train coming 当火车到来,移除这个围栏 +; --- delete this fence model when train coming 当火车到来时移除这个围栏模型 modify: { match: @@ -286,7 +285,7 @@ modify: ; == Add or change ladders == ; ===================================================== -;container door 集装箱入口 +;container entrance door 集装箱入口 add: { "model" "*99" @@ -299,7 +298,7 @@ add: "angles" "0.00 0.00 0.00" } -;stair into train room 火车房入口 +;stair into big train room 大火车房的楼梯入口 add: { "model" "*92" diff --git a/cfg/stripper/zonemod/maps/noecho_m3.cfg b/cfg/stripper/zonemod/maps/noecho_m3.cfg new file mode 100644 index 000000000..c1e5e8cfc --- /dev/null +++ b/cfg/stripper/zonemod/maps/noecho_m3.cfg @@ -0,0 +1,25 @@ +; ===================================================== +; ============ [noecho_m3] [m3/5] [no echo match] +; ===================================================== + +; ############# MAP CLIPPING AND ISSUES ############# +; ===================================================== +; == EXPLOITS BLOCKED == +; == Block intentionally performed exploits == +; ===================================================== + +; add clipwall for the truck model near the alarm event door +; prevent Svv from skipping the event +add: +{ + "classname" "env_physics_blocker" + "angles" "0 20 0" + "BlockType" "1" + "maxs" "64 56 1000" + "mins" "-64 -56 -128" + "boxmaxs" "64 56 1000" + "boxmins" "-64 -56 -128" + "initialstate" "1" + "targetname" "eb_fix01" + "origin" "1328 4760 152" +}