Originally two Extensions [L4D1] Left 4 Downtown created by "Downtown1" and [L4D2] Left 4 Downtown 2 by "ProdigySim" and maintained by various others, this is an all-in-one port to DHooks with many additions.
This also merges natives from L4D2_Direct by "ProdigySim" and L4D_Direct port by "raziEiL".
Also created natives from the "l4d2addresses.txt" gamedata by "AtomicStryker" and who?
I done this to learn some stuff, add missing natives and forwards to L4D1 and add more features. Also because the extensions are often broken with SourceMod updates and confusing to find the latest gamedata or working version.
Thanks to Lux and a conversation we had: using the plugin iterator and GetFunctionByName to detect which forwards are being used by plugins. This will only detour functions being used by other plugins. Plugins are rescanned on map change.
Features:
Many new forwards and natives in L4D1 and L4D2.
Many stock functions added to the include files.
Additional features not present in the Extension versions.
Test plugin demonstrating animation hooks + all forwards and natives capabilities.
Addons Disabler included (L4D2 only).
The native L4D_LobbyUnreserve is NOW finally supported from version 1.16 and newer!
Dynamic detouring - only detours forwards required by other plugins. Rescans on map change.
Animation hooks to modify player animations.
View the left4dhooks.*.cfg files in the \addons\sourcemod\data\ folder for activity names and sequence numbers.
View the left4dhooks_anim.inc file in the \addons\sourcemod\scripting\include\ folder for activity constants for usage in plugin source code.
Natives to execute VScripts (L4D2 only) and retrieve return data.
Some natives as wrappers to VScript functions (L4D2 only).
Various target filters (used in commands for example "sm_slay @survivors"):
"@randomincappedsurvivor" // Random Incapped Survivors
"@ris" // Random Incapped Survivors
"@randomsurvivor" // Random Survivors
"@rs" // Random Survivors
"@randominfected" // Random Infected
"@ri" // Random Infected
"@randomtank" // Random Tank
"@rt" // Random Tank
"@rincappedsurvivorbot" // Random Incapped Survivor Bot
"@risb" // Random Incapped Survivor Bot
"@rsurvivorbot" // Random Survivor Bot
"@rsb" // Random Survivor Bot
"@rinfectedbot" // Random Infected Bot
"@rib" // Random Infected Bot
"@rtankbot" // Random Tank Bot
"@rtb" // Random Tank Bot
"@blackwhite" // Black and White survivors on third strike
"@bw" // Black and White survivors on third strike
"@deads" // Dead Survivors (all, bots)
"@deadsi" // Dead Special Infected (all, bots)
"@deadsp" // Dead Survivors players (no bots)
"@deadsip" // Dead Special Infected players (no bots)-
"@deadsb" // Dead Survivors bots (no players)
"@deadsib" // Dead Special Infected bots (no players)-
"@sp" // Survivors players (no bots)
"@isp" // Special Infected players (no bots)
"@isb" // Incapped Survivor Only Bots
"@isp" // Incapped Survivor Only Players
"@survivorbots" // Survivors players (bots only)
"@sb" // Survivors players (bots only)
"@infectedbots" // Infected players (bots only)
"@ib" // Infected players (bots only)
"@nick" // Nick
"@rochelle" // Rochelle
"@coach" // Coach
"@ellis" // Ellis
"@bill" // Bill
"@zoey" // Zoey
"@francis" // Francis
"@louis" // Louis
Player slots is unsupported. Use the L4DToolZ Metamod plugin to increase player slots and unreserve your server.
Forwards L4D2_OnSendInRescueVehicle and L4D2_OnUseHealingItems are blocked in Linux L4D1/L4D2 to prevent crashes. Waiting for DHooks update to support object returns.
Developers are tasked with ensuring they provide valid client and entity indexes when using Natives.
This is to prevent duplicating checks and additional overhead inside left4dhooks.
Reporting Bugs: State which game. Explain how to replicate the issue. Show the plugin or code or PM me if code is private.
Test Plugin: Shows usage of all forwards and natives. See the examples provided to understand what is possible.
Thanks:
Dr!fter and Peace-Maker - For the DHooks Dynamic Detour extension and various help.
Lux - Lots of technical support and ideas + figuring out why some detours were broken.
Lux - For the "lux_library.inc" include file.
Mr. Zero - For the "l4d_stocks.inc" include files.
Dragokas - Server and support testing in Linux for both games, and various stocks.
Spirit_12 - Various ideas and support. Suggesting to incorporate "l4d2_direct.inc".
xZk - Support testing and helping find a crash.
Nuki - Suggesting to incorporate "l4d2_addresses.txt".
Forgetest - Various fixes, requests and suggestions.
Psyk0tik - Various signatures, requests and suggestions.
BHaType - Various offsets, requests and suggestions.
Marttt - Various plugins and testing.
Various people posting in this thread with reports.
Thanks to the following individuals for their contribution to the Extensions.
This plugin was made using source code from the following plugins:
Spoiler
Code:
* Original Left4Downtown extension: https://forums.alliedmods.net/showthread.php?t=91132
"Downtown1" and "XBetaAlpha" - authors of the original Left4Downtown.
"pRED*" for his TF2 tools code, I looked at it a lot . and for answering questions on IRC
"Fyren" for being so awesome and inspiring me from his sdktools patch to do custom |this| calls.
"ivailosp" for providing the Windows addresses that needed to be patched to get player slot unlocking to work.
"dvander" for making sourcemod and teaching me about the mod r/m bytes.
"DDRKhat" for letting me use his Linux server to test this
"Frustian" for being a champ and poking around random Linux sigs so I could the one native I actually needed.
"XBetaAlpha" for making this a team effort rather than one guy writing all the code.
* Original Left4Downtown2 extension: https://forums.alliedmods.net/showthread.php?t=134032
"Downtown1" and "XBetaAlpha" - authors of the original Left4Downtown.
"ProdigySim" - Confogl developer interested in expanding and updating Left4Downtown.
"AtomicStryker" - Sourcemod plugin developer, and part of the original Left4Downtown team.
"psychonic" - Resident Sourcemod insider, started Left4Downtown2.
"asherkin" - Hosting the autobuild server.
"CanadaRox", "vintik", "rochellecrab", and anyone else who has submitted code in any way.
* Left 4 Downtown 2 Extension updates: https://forums.alliedmods.net/showpost.php?p=1970730&postcount=397?p=1970730&postcount=397
"Visor" for "l4d2_addons_eclipse" cvar and new forwards.
* Left 4 Downtown 2 Extension updates
"Attano" for various github commits.
* Left 4 Downtown 2 Extension updates:
"Accelerator74" for various github commits.
* "ProdigySim" and the "ConfoglTeam" for "L4D2Direct" plugin:
https://forums.alliedmods.net/showthread.php?t=180028
* "raziEiL" for "L4D_Direct Port" offsets and addresses:
https://github.com/raziEiL/l4d_direct-port
* "AtomicStryker" and whoever else contributed to "l4d2addresses.txt" gamedata file.
Admin Commands: (requires "z" flag)
PHP Code:
// Lists the currently active forwards and the plugins using them.
sm_l4dd_detours or sm_l4dhooks_detours
// Reloads the detour hooks, enabling or disabling depending if they're required by other plugins.
// When adding or removing plugins that use any detours during gameplay. To optimize forwards by disabling unused or enabling required functions that were previously unused.
sm_l4dd_reload or sm_l4dhooks_reload
// Removes lobby reservation.
sm_l4dd_unreserve
CVars:
Saved to left4dhooks.cfg in your servers \cfg\sourcemod\ folder.
PHP Code:
l4d2_addons_eclipse "-1" // L4D2 only. Addons Manager (-1: use addonconfig; 0: disable addons; 1: enable addons.
left4dhooks_version // Left 4 DHooks Direct plugin version.
All Forwards, Natives and Stocks:
Assume everything is L4D1 and L4D2 compatible unless otherwise stated.
View the include files for detailed descriptions.
View the test plugin for usage demonstrations.
Forwards: (L4D1 = 109 & L4D2 = 142)
Spoiler
PHP Code:
// ====================
// Various Forwards
// ====================
// Called whenever ZombieManager::SpawnSpecial(ZombieClassType,Vector&,QAngle&) is invoked
forward Action L4D_OnSpawnSpecial(int &zombieClass, const float vecPos[3], const float vecAng[3]);
// Called whenever ZombieManager::SpawnSpecial(ZombieClassType,Vector&,QAngle&) is invoked
forward void L4D_OnSpawnSpecial_Post(int client, int zombieClass, const float vecPos[3], const float vecAng[3]);
// Called whenever ZombieManager::SpawnSpecial(ZombieClassType,Vector&,QAngle&) is invoked
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnSpawnSpecial_PostHandled(int client, int zombieClass, const float vecPos[3], const float vecAng[3]);
// Not invoked if z_spawn tank is used and it gives a ghosted/dead player tank
forward Action L4D_OnSpawnTank(const float vecPos[3], const float vecAng[3]);
// Not invoked if z_spawn tank is used and it gives a ghosted/dead player tank
forward void L4D_OnSpawnTank_Post(int client, const float vecPos[3], const float vecAng[3]);
// Not invoked if z_spawn tank is used and it gives a ghosted/dead player tank
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnSpawnTank_PostHandled(int client, const float vecPos[3], const float vecAng[3]);
// Called when a Witch spawns
forward Action L4D_OnSpawnWitch(const float vecPos[3], const float vecAng[3]);
// Called when a Witch spawns
forward void L4D_OnSpawnWitch_Post(int entity, const float vecPos[3], const float vecAng[3]);
// Called when a Witch spawns
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnSpawnWitch_PostHandled(int entity, const float vecPos[3], const float vecAng[3]);
// L4D2 only. Called when a Witch Bride spawns
forward Action L4D2_OnSpawnWitchBride(const float vecPos[3], const float vecAng[3]);
// L4D2 only. Called when a Witch Bride spawns
forward void L4D2_OnSpawnWitchBride_Post(int entity, const float vecPos[3], const float vecAng[3]);
// Called on random hordes, mini and finale hordes, and boomer hordes
forward Action L4D_OnMobRushStart();
// Called on random hordes, mini and finale hordes, and boomer hordes
forward void L4D_OnMobRushStart_Post();
// Called on random hordes, mini and finale hordes, and boomer hordes
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnMobRushStart_PostHandled();
// Called on boomer hordes, increases Zombie Spawn Queue
forward Action L4D_OnSpawnITMob(int &amount);
// Called on boomer hordes, increases Zombie Spawn Queue
forward void L4D_OnSpawnITMob_Post(int amount);
// Called on boomer hordes, increases Zombie Spawn Queue
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnSpawnITMob_PostHandled(int amount);
// Called on natural hordes & z_spawn mob
forward Action L4D_OnSpawnMob(int &amount);
// Called on natural hordes & z_spawn mob
forward void L4D_OnSpawnMob_Post(int amount);
// Called on natural hordes & z_spawn mob
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnSpawnMob_PostHandled(int amount);
// Called when a witch has been startled by someone
forward void L4D_OnWitchSetHarasser(int witch, int victim);
// Called when a Tank enters stasis mode in Versus mode.
forward void L4D_OnEnterStasis(int tank);
// Called when a Tank leaves stasis mode in Versus mode.
forward void L4D_OnLeaveStasis(int tank);
// This happens when a player enters ghost mode (or in finales auto-materialized)
// This forward triggers before the player enters ghost state allowing it to be blocked
forward Action L4D_OnEnterGhostStatePre(int client);
// This happens when a player enters ghost mode (or in finales auto-materialized)
forward void L4D_OnEnterGhostState(int client);
// This happens when a player enters ghost mode (or in finales auto-materialized)
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnEnterGhostState_PostHandled(int client);
// Called when a Special Infected spawns out of ghost mode.
forward Action L4D_OnMaterializeFromGhostPre(int client);
// Called when a Special Infected spawns out of ghost mode.
forward Action L4D_OnMaterializeFromGhost(int client);
// Called when a Special Infected spawns out of ghost mode.
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward Action L4D_OnMaterializeFromGhost_PostHandled(int client);
// Called when bots or players are joining a team
forward Action L4D_OnIsTeamFull(int team, bool &full);
// This resets the map score at the beginning of a map, and by checking
forward Action L4D_OnClearTeamScores(bool newCampaign);
// The campaign scores are updated after the 2nd round is completed
forward Action L4D_OnSetCampaignScores(int &scoreA, int &scoreB);
// The campaign scores are updated after the 2nd round is completed
forward void L4D_OnSetCampaignScores_Post(int scoreA, int scoreB);
// L4D1 only. The campaign scores are updated after the 2nd round is completed
forward Action L4D_OnRecalculateVersusScore(int client);
// L4D1 only. The campaign scores are updated after the 2nd round is completed
forward void L4D_OnRecalculateVersusScore_Post(int client);
// A versus round is started when survivors leave the safe room, or force started after 90 seconds regardless
forward Action L4D_OnFirstSurvivorLeftSafeArea(int client);
// A versus round is started when survivors leave the safe room, or force started after 90 seconds regardless
forward void L4D_OnFirstSurvivorLeftSafeArea_Post(int client);
// A versus round is started when survivors leave the safe room, or force started after 90 seconds regardless
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnFirstSurvivorLeftSafeArea_PostHandled(int client);
// Constantly called to get players max Crouch speed
forward Action L4D_OnGetCrouchTopSpeed(int target, float &retVal);
// Constantly called to get players max Run speed
forward Action L4D_OnGetRunTopSpeed(int target, float &retVal);
// Constantly called to get players max Walk speed
forward Action L4D_OnGetWalkTopSpeed(int target, float &retVal);
// L4D2 only. A script value is map specific
forward Action L4D_OnGetScriptValueInt(const char[] key, int &retVal);
// L4D2 only. A script value is map specific
forward Action L4D_OnGetScriptValueFloat(const char[] key, float &retVal);
// L4D2 only. A script value is map specific
forward Action L4D_OnGetScriptValueString(const char[] key, const char[] defaultVal, char retVal[128]);
// L4D2 only. Used to deny/allow difficulty changes in different game modes
forward Action L4D_OnHasConfigurableDifficulty(int &retVal);
// L4D2 only. Used to deny/allow difficulty changes in different game modes
forward void L4D_OnHasConfigurableDifficulty_Post(int retVal);
// L4D2 only. Constantly called to get the survivor character set
forward Action L4D_OnGetSurvivorSet(int &retVal);
// L4D2 only. Constantly called to get the survivor character set
forward Action L4D_OnFastGetSurvivorSet(int &retVal);
// Passed values are from the map's Mission Keyvalues. If those keyvalues don't exist, they are from cvar and other globals
forward Action L4D_OnGetMissionVSBossSpawning(float &spawn_pos_min, float &spawn_pos_max, float &tank_chance, float &witch_chance);
// Passed values are from the map's Mission Keyvalues. If those keyvalues don't exist, they are from cvar and other globals
forward void L4D_OnGetMissionVSBossSpawning_Post(float spawn_pos_min, float spawn_pos_max, float tank_chance, float witch_chance);
// Passed values are from the map's Mission Keyvalues. If those keyvalues don't exist, they are from cvar and other globals
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnGetMissionVSBossSpawning_PostHandled(float spawn_pos_min, float spawn_pos_max, float tank_chance, float witch_chance);
// Not invoked if tank is bot
forward void L4D_OnReplaceTank(int tank, int newtank);
// When a tank is swinging to punch.
forward void L4D_TankClaw_DoSwing_Pre(int tank, int claw);
// When a tank is swinging to punch.
forward void L4D_TankClaw_DoSwing_Post(int tank, int claw);
// When hitting the ground (maybe only when hitting an incapped player)
forward void L4D_TankClaw_GroundPound_Pre(int tank, int claw);
// When hitting the ground (maybe only when hitting an incapped player)
forward void L4D_TankClaw_GroundPound_Post(int tank, int claw);
// When a tank swings and punches a player.
forward Action L4D_TankClaw_OnPlayerHit_Pre(int tank, int claw, int player);
// When a tank swings and punches a player.
forward void L4D_TankClaw_OnPlayerHit_Post(int tank, int claw, int player);
// When a tank swings and punches a player.
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_TankClaw_OnPlayerHit_PostHandled(int tank, int claw, int player);
// When a tank rock hits something and explodes.
forward void L4D_TankRock_OnDetonate(int tank, int rock);
// When a tank rock is thrown.
forward Action L4D_TankRock_OnRelease(int tank, int rock, float vecPos[3], float vecAng[3], float vecVel[3], float vecRot[3]);
// When a tank rock is thrown.
forward void L4D_TankRock_OnRelease_Post(int tank, int rock, float vecPos[3], float vecAng[3], float vecVel[3], float vecRot[3]);
// Is used for displaying the "X gets Tank" window and transferring Tank control
forward Action L4D_OnTryOfferingTankBot(int tank_index, bool &enterStasis);
// Is used for displaying the "X gets Tank" window and transferring Tank control
forward void L4D_OnTryOfferingTankBot_Post(int tank_index, bool enterStasis);
// Is used for displaying the "X gets Tank" window and transferring Tank control
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnTryOfferingTankBot_PostHandled(int tank_index, bool enterStasis);
// Called when a tank throws a rock. Blocking this call will keep the tank from throwing a rock
forward Action L4D_OnCThrowActivate(int ability);
// Called when a tank throws a rock. Blocking this call will keep the tank from throwing a rock
forward void L4D_OnCThrowActivate_Post(int ability);
// Called when a tank throws a rock. Blocking this call will keep the tank from throwing a rock
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnCThrowActivate_PostHandled(int ability);
// Called whenever a tank uses his primary (punch) or secondary (throw) attack (uses ACT_* activity numbers)
forward Action L4D2_OnSelectTankAttackPre(int client, int &sequence);
// Called whenever a tank uses his primary (punch) or secondary (throw) attack (uses m_nSequence animation numbers)
forward Action L4D2_OnSelectTankAttack(int client, int &sequence);
// L4D2 only. Called when a player uses his melee weapons primary attack
forward Action L4D_OnStartMeleeSwing(int client, bool boolean);
// L4D2 only. Called when a player uses his melee weapons primary attack
forward void L4D_OnStartMeleeSwing_Post(int client, bool boolean);
// Called to calculate the damage when a melee weapon hits something
forward Action L4D2_MeleeGetDamageForVictim(int client, int weapon, int victim, float &damage);
// Called when the last Finale stage is reached and the Rescue means becomes 'available'.
forward Action L4D2_OnSendInRescueVehicle();
// L4D2 only. Called when the director stage changes
forward Action L4D2_OnChangeFinaleStage(int &finaleType, const char[] arg);
// L4D2 only. Called when the director stage changes
forward void L4D2_OnChangeFinaleStage_Post(int finaleType, const char[] arg);
// Called before score calculations and the scoreboard display
forward Action L4D2_OnEndVersusModeRound(bool countSurvivors);
// Called after all score calculations are complete and the scoreboard shows
forward void L4D2_OnEndVersusModeRound_Post();
// Called after all score calculations are complete and the scoreboard shows
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D2_OnEndVersusModeRound_PostHandled();
// Called when a player is about to grab a ledge
forward Action L4D_OnLedgeGrabbed(int client);
// Called when a player is about to grab a ledge
forward void L4D_OnLedgeGrabbed_Post(int client);
// Called when a player is about to grab a ledge
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnLedgeGrabbed_PostHandled(int client);
// Called post-revive so all data values are post-revive status.
forward void L4D2_OnRevived(int client);
// Called when a Survivor shoves
forward void L4D_OnSwingStart(int client, int weapon);
// L4D2 only uses this on Special Infected. Blocks hunter dead stop
forward Action L4D_OnShovedBySurvivor(int client, int victim, const float vecDir[3]);
// L4D2 only uses this on Special Infected. Blocks hunter dead stop
forward void L4D_OnShovedBySurvivor_Post(int client, int victim, const float vecDir[3]);
// L4D2 only uses this on Special Infected. Blocks hunter dead stop
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnShovedBySurvivor_PostHandled(int client, int victim, const float vecDir[3]);
// Called for every single shovable and even some of the unshovable entities in the game
forward Action L4D2_OnEntityShoved(int client, int entity, int weapon, float vecDir[3], bool bIsHighPounce);
// Called for every single shovable and even some of the unshovable entities in the game
forward void L4D2_OnEntityShoved_Post(int client, int entity, int weapon, float vecDir[3], bool bIsHighPounce);
// Called for every single shovable and even some of the unshovable entities in the game
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D2_OnEntityShoved_PostHandled(int client, int entity, int weapon, float vecDir[3], bool bIsHighPounce);
// Source is always null for Charger impacts (Valve)
forward Action L4D2_OnStagger(int target, int source);
// Source is always null for Charger impacts (Valve)
forward void L4D2_OnStagger_Post(int target, int source);
// Source is always null for Charger impacts (Valve)
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D2_OnStagger_PostHandled(int target, int source);
// L4D2 only. Called when a player is flung to the ground.
forward Action L4D2_OnPlayerFling(int client, int attacker, float vecDir[3]);
// L4D2 only. Called when a player is flung to the ground.
forward void L4D2_OnPlayerFling_Post(int client, int attacker, float vecDir[3]);
// L4D2 only. Called when a player is flung to the ground.
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D2_OnPlayerFling_PostHandled(int client, int attacker, float vecDir[3]);
// The survivor that is about to get stumbled as a result of "attacker" capping someone in close proximity
forward Action L4D2_OnPounceOrLeapStumble(int victim, int attacker);
// The survivor that is about to get stumbled as a result of "attacker" capping someone in close proximity
forward void L4D2_OnPounceOrLeapStumble_Post(int victim, int attacker);
// The survivor that is about to get stumbled as a result of "attacker" capping someone in close proximity
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D2_OnPounceOrLeapStumble_PostHandled(int victim, int attacker);
// Called when someone is about to be hit by a Tank rock or lunged by a Hunter
forward Action L4D_OnKnockedDown(int client, int reason);
// Called when a player is flung by Charger impact.
forward void L4D_OnKnockedDown_Post(int client, int reason);
// Called when a player is flung by Charger impact.
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnKnockedDown_PostHandled(int client, int reason);
// Called when a player is about to be flung probably by Charger impact.
forward Action L4D2_OnThrowImpactedSurvivor(int attacker, int victim);
// Called when a player is flung by Charger impact.
forward void L4D2_OnThrowImpactedSurvivor_Post(int attacker, int victim);
// Called when a player is flung by Charger impact.
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D2_OnThrowImpactedSurvivor_PostHandled(int attacker, int victim);
// Called when a player is falling in a fatal zone.
forward Action L4D_OnFatalFalling(int client, int camera);
// Called when a player is falling.
forward void L4D_OnFalling(int client);
// Molotov and Spitter fire/goo spread
forward Action L4D2_OnSpitSpread(int spitter, int projectile, float &x, float &y, float &z);
// Causes bots to use or give healing items (except in safe room on non-expert)
forward Action L4D2_OnUseHealingItems(int client);
// Indicates which item the Survivor Bot will attempt to pick up
forward Action L4D2_OnFindScavengeItem(int client, int &item);
// Called when Special Infected are targeting a victim
forward Action L4D2_OnChooseVictim(int specialInfected, int &curTarget);
// Called when a Survivor player is about to be pounced on by a Hunter
forward Action L4D_OnPouncedOnSurvivor(int victim, int attacker);
// Called when a Survivor player is about to be pounced on by a Hunter
forward void L4D_OnPouncedOnSurvivor_Post(int victim, int attacker);
// Called when a Survivor player is about to be pounced on by a Hunter
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnPouncedOnSurvivor_PostHandled(int victim, int attacker);
// Called when a Survivor player is about to be grabbed by a Smoker
forward Action L4D_OnGrabWithTongue(int victim, int attacker);
// Called when a Survivor player is about to be grabbed by a Smoker
forward void L4D_OnGrabWithTongue_Post(int victim, int attacker);
// Called when a Survivor player is about to be grabbed by a Smoker
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnGrabWithTongue_PostHandled(int victim, int attacker);
// Called when a player (Survivor or Special Infected) is about to be extinguished
forward Action L4D_PlayerExtinguish(int client);
// L4D2 only. Called when a Survivor player is about to be ridden by a Jockey
forward Action L4D2_OnJockeyRide(int victim, int attacker);
// L4D2 only. Called when a Survivor player is starting to be ridden by a Jockey
forward void L4D2_OnJockeyRide_Post(int victim, int attacker);
// L4D2 only. Called when a Survivor player is about to be carried by a Charger
forward Action L4D2_OnStartCarryingVictim(int victim, int attacker);
// L4D2 only. Called when a Survivor player is starting to be carried by a Charger
forward void L4D2_OnStartCarryingVictim_Post(int victim, int attacker);
// L4D2 only. Called when a player is about to be pummelled by a Charger.
forward Action L4D2_OnPummelVictim(int attacker, int victim);
// L4D2 only. Called when a player is about to be pummelled by a Charger.
forward void L4D2_OnPummelVictim_Post(int attacker, int victim);
// L4D2 only. Called when a player is about to be pummelled by a Charger.
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D2_OnPummelVictim_PostHandled(int attacker, int victim);
// Called when a Survivor player is covered in Boomer bile, or when using "Bile the World" plugin by "AtomicStryker"
forward Action L4D_OnVomitedUpon(int victim, int &attacker, bool &boomerExplosion);
// Called when a Survivor player is covered in Boomer bile, or when using "Bile the World" plugin by "AtomicStryker"
forward void L4D_OnVomitedUpon_Post(int victim, int attacker, bool boomerExplosion);
// Called when a Survivor player is covered in Boomer bile, or when using "Bile the World" plugin by "AtomicStryker"
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_OnVomitedUpon_PostHandled(int victim, int attacker, bool boomerExplosion);
// Called when a Special Infected is about to be hit from a Bilejar explosion
forward Action L4D2_OnHitByVomitJar(int victim, int &attacker);
// Called when a Special Infected is hit from a Bilejar explosion
forward void L4D2_OnHitByVomitJar_Post(int victim, int attacker);
// Called when a PipeBomb projectile is being created
forward Action L4D_PipeBombProjectile_Pre(int client, float vecPos[3], float vecAng[3], float vecVel[3], float vecRot[3]);
// Called when a PipeBomb projectile has been created
forward void L4D_PipeBombProjectile_Post(int client, int projectile, float vecPos[3], float vecAng[3], float vecVel[3], float vecRot[3]);
// Called when a PipeBomb projectile has been created
// Only called when relative pre-hook is blocked by a plugin with return Plugin_Handled
forward void L4D_PipeBombProjectile_PostHandled(int client, int projectile, float vecPos[3], float vecAng[3], float vecVel[3], float vecRot[3]);
// L4D2 only. Called when Spitter Acid is determining if a client or entity can be damaged
forward Action L4D2_CInsectSwarm_CanHarm(int acid, int spitter, int entity);
// L4D2 only. Called when Spitter Acid is determining if a client or entity can be damaged
forward void L4D2_CInsectSwarm_CanHarm_Post(int acid, int spitter, int entity);
// Called when a physics prop is broken
forward void L4D_CBreakableProp_Break(int prop, int entity);
// L4D2 only. Called when a gascan is broken
forward void L4D2_CGasCan_EventKilled(int gascan);
// L4D2 only. Called when someone is about to pour a gascan into a nozzle
forward Action L4D2_CGasCan_ShouldStartAction(int client, int nozzle, int gascan);
// L4D2 only. Called when someone is about to pour a gascan into a nozzle
forward void L4D2_CGasCan_ShouldStartAction_Post(int client, int nozzle, int gascan);
// L4D2 only. Called when someone completes pouring a gascan into a nozzle
forward Action L4D2_CGasCan_ActionComplete(int client, int gascan, int nozzle);
// L4D2 only. Called when someone completes pouring a gascan into a nozzle
forward void L4D2_CGasCan_ActionComplete_Post(int client, int gascan, int nozzle);
// Returns the current game mode type when it changes. 0=Unknown or error. 1=Coop. 2=Survival. 4=Versus. 8=Scavenge (L4D2).
forward void L4D_OnGameModeChange(int gamemode);
// Called when the server changes hibernation status
forward void L4D_OnServerHibernationUpdate(bool hibernating);
// L4D2 only. Called when the client's material system is expecting instructions from the server in regards to addons
forward Action L4D2_OnClientDisableAddons(const char[] SteamID);
// DEPRECATED - UNUSED
// L4D_OnGetRandomPZSpawnPosition(int &client, int &zombieClass, int &attempts, float vecPos[3]);
// forward Action L4D_OnInfectedShoved(int infected, int entity);
// forward void L4D2_OnWaterMove(int client);
Natives: (L4D1 = 132 & L4D2 = 223)
Spoiler
PHP Code:
// ====================
// Animation Hook
// View the data folder cfgs for a list of Activity strings and their related sequence numbers.
// View the include "[B]left4dhooks_anim.inc[/B]" for a list of animation enums that can be used in plugins.
// ====================
// AnimHookCallback callback called whenever animation is invoked.
function Action(int client, int &sequence);
// Runs a specified VScript code and returns values from it.
native bool L4D2_GetVScriptOutput(char[] code, char[] buffer, int maxlength);
// Returns the current game mode type. 0=Unknown or error. 1=Coop. 2=Survival. 4=Versus. 8=Scavenge (L4D2).
native int L4D_GetGameModeType();
// Returns a Survivors current temporary health buffer HP.
native float L4D_GetTempHealth(int client);
// Sets a Survivors temporary health buffer HP.
native int L4D_SetTempHealth(int client, float health);
// Returns the reserve ammo for a specific players weapon
native int L4D_GetReserveAmmo(int client, int weapon);
// Sets the reserve ammo for a specific players weapon
native void L4D_SetReserveAmmo(int client, int weapon, int ammo);
// Plays specified music string name on the music channel to a client.
native void L4D_PlayMusic(int client, const char[] music_str, int source_ent = 0, float one_float, bool one_bool, bool two_bool);
// Stops playing the specified music_str to the client.
native void L4D_StopMusic(int client, const char[] music_str, float one_float = 0.0, bool one_bool = false);
// Deafens a player with a high pitch ringing sound for a few seconds.
native int L4D_Deafen(int client);
// Creates the dissolve effect on common infected, players or objects.
native int L4D_Dissolve(int entity);
// Removes the boomer vomit effect from a player.
native void L4D_OnITExpired(int client);
// Returns the estimated fall damage of a player.
native float L4D_EstimateFallingDamage(int client);
// Sets a physics entity angular velocity vector.
native int L4D_AngularVelocity(int entity, const float vecAng[3]);
// Attempts to find a random valid position to spawn a Special Infected.
native bool L4D_GetRandomPZSpawnPosition(int client, int zombieClass, int attempts, float vecPos[3]);
// Given a vector position, returns the relative NavArea.
native int L4D_GetNearestNavArea(const float vecPos[3]);
// Returns the nav address of the last known area.
native int L4D_GetLastKnownArea(int client);
// L4D2 only. Gets the flow distance of furthest survivor ahead.
native float L4D2_GetFurthestSurvivorFlow();
// Given a nav area value, returns a randomly selected position for spawning.
native void L4D_FindRandomSpot(int NavArea, float vecPos[3]);
// Returns true when any survivor has left the starting area and true in Versus when the saferoom door automatically opens.
native bool L4D_HasAnySurvivorLeftSafeArea();
// Returns true when any survivor is in the starting checkpoint area.
native bool L4D_IsAnySurvivorInStartArea();
// Returns true when any survivor is in the starting or ending checkpoint area.
native bool L4D_IsAnySurvivorInCheckpoint();
// Returns true when the specified Survivor or Special Infected is in the starting checkpoint area.
native bool L4D_IsInFirstCheckpoint(int client);
// Returns true when the specified Survivor or Special Infected is in the ending checkpoint area.
native bool L4D_IsInLastCheckpoint(int client);
// Returns the entity index of the first saferoom door, if available.
native int L4D_GetCheckpointFirst();
// Returns the entity index of the last saferoom door, if available.
native int L4D_GetCheckpointLast();
// Detonates an active grenade projectile
native int L4D_DetonateProjectile(int entity);
// Creates an activated Tank Rock projectile.
native int L4D_TankRockPrj(int client, const float vecPos[3], const float vecAng[3]);
// Creates an activated PipeBomb projectile.
native int L4D_PipeBombPrj(int client, const float vecPos[3], const float vecAng[3]);
// Creates an activated Molotov projectile.
native int L4D_MolotovPrj(int client, const float vecPos[3], const float vecAng[3]);
// L4D2 only. Creates an activated VomitJar projectile.
native int L4D2_VomitJarPrj(int client, const float vecPos[3], const float vecAng[3]);
// L4D2 Only. Creates an activated Grenade Launcher projectile.
native int L4D2_GrenadeLauncherPrj(int client, const float vecPos[3], const float vecAng[3]);
// L4D2 only. Creates a Spitter goo projectile
native int L4D2_SpitterPrj(int client, const float vecPos[3], const float vecAng[3]);
// Gives the player adrenaline effect and health benefits.
native void L4D2_UseAdrenaline(int client, float fTime = 15.0, bool heal = true);
// Respawns a player from dead state.
native void L4D_RespawnPlayer(int client);
// To takeover a Survivor bot. First use "ChangeClientTeam" and change them to 0. Then call "L4D_SetHumanSpec" then call "L4D_TakeOverBot".
native int L4D_SetHumanSpec(int bot, int client);
// To takeover a Survivor bot. First use "ChangeClientTeam" and change them to 0. Then call "L4D_SetHumanSpec" then call "L4D_TakeOverBot".
native int L4D_TakeOverBot(int client);
// Returns true when the "You will enter Spawn Mode in X seconds" text appears on the screen.
native bool L4D_CanBecomeGhost(int client);
// L4D2 only. Returns if Wandering Witches are allowed.
native bool L4D2_AreWanderersAllowed();
// Returns true when the rescue vehicle is leaving until the screen fades and credits start.
native bool L4D_IsFinaleEscapeInProgress();
// L4D2 only. Returns the current Finale stage type.
native int L4D2_GetCurrentFinaleStage();
// L4D2 only. Forces the ScriptedMode stage to advance to the next stage.
native void L4D2_ForceNextStage();
// Forces the game to start in Versus.
native void L4D_ForceVersusStart();
// Forces the game to start in Survival.
native void L4D_ForceSurvivalStart();
// Forces the game to start in Scavenge.
native void L4D2_ForceScavengeStart();
// L4D2 only. Returns true when any tanks are on the map.
native bool L4D2_IsTankInPlay();
// L4D2 only. Checks if a world position is accessible to a Survivor bot.
native bool L4D2_IsReachable(int client, const float vecPos[3]);
// Returns the nav distance between two areas. Does not account for out-of-bounds areas.
native float L4D2_NavAreaTravelDistance(float startPos[3], float endPos[3], bool ignoreNavBlockers);
// Returns if players can control infected.
native bool L4D_HasPlayerControlledZombies();
// L4D2 only. Returns the value of the specified Director Variable key
native int L4D2_GetScriptValueInt(const char[] key, int value);
// L4D2 only. Returns if there is a configurable difficulty setting.
native bool L4D2_HasConfigurableDifficultySetting();
// Returns the maps default Survivor set
native int L4D2_GetSurvivorSetMap();
// Returns the current Survivor set
native int L4D2_GetSurvivorSetMod();
// L4D2 only. Returns if the current game mode is Coop/Realism mode.
native bool L4D2_IsGenericCooperativeMode();
// Returns if the current game mode is Coop mode.
native bool L4D_IsCoopMode();
// L4D2 only. Returns if the current game mode is Realism mode.
native bool L4D2_IsRealismMode();
// Returns if the current game mode is Survival mode.
native bool L4D_IsSurvivalMode();
// L4D2 only. Returns if the current game mode is Scavenge mode.
native bool L4D2_IsScavengeMode();
// Returns if the current game mode is Versus mode.
native bool L4D_IsVersusMode();
// These natives are using VScripts to call functions - this is much slower than native SDKCalls.
// Popular VScript functions will be converted to standard native SDKCalls. Please tell me.
// Recommend not using these too often, instead request proper native SDKCalls.
// Returns the number of maps played since a new campaign (not the current chapter).
native int L4D2_VScriptWrapper_GetMapNumber();
// Returns true if the character has ever been injured by a member of the given team.
native bool L4D2_VScriptWrapper_HasEverBeenInjured(int client, int team);
// Returns the time the character has been alive (only valid when alive).
native float L4D2_VScriptWrapper_GetAliveDuration(int client);
// Returns true when a player is dead and can spectate others.
native bool L4D2_VScriptWrapper_IsDead(int client);
// Returns true when a player is dead, but cannot spectate others yet.
native bool L4D2_VScriptWrapper_IsDying(int client);
// Causes Adrenaline's speed and visual effect, no change to health.
native bool L4D2_VScriptWrapper_UseAdrenaline(int client, float time);
// Revive a dead player by defib.
native bool L4D2_VScriptWrapper_ReviveByDefib(int client);
// Revive an incapacitated player.
native bool L4D2_VScriptWrapper_ReviveFromIncap(int client);
// Get the current bits for the bot sense flags: BOT_CANT_SEE, BOT_CANT_HEAR, BOT_CANT_FEEL.
native int L4D2_VScriptWrapper_GetSenseFlags(int client);
// Test two vector positions if they can be reached (only returns false if a location has no valid NavArea, out-of-bounds can be valid).
native bool L4D2_VScriptWrapper_NavAreaBuildPath(float startPos[3], float endPos[3], float flMaxPathLength, bool checkLOS, bool checkGround, int teamID, bool ignoreNavBlockers);
// Compute distance between two areas.
native float L4D2_VScriptWrapper_NavAreaTravelDistance(float startPos[3], float endPos[3], float flMaxPathLength, bool checkLOS, bool checkGround);
// ====================
// Various Natives - left4downtown.inc
// ====================
// L4D2 only. Restarts the setup timer (when in scavenge mode)
native int L4D_ScavengeBeginRoundSetupTime();
// L4D2 only. Get the remaining spawn time for an SI
native float L4D_GetPlayerSpawnTime(int player);
// Restarts the round, switching the map if necessary
native int L4D_RestartScenarioFromVote(const char[] map);
// Gets the max versus completion score for the map
native int L4D_GetVersusMaxCompletionScore();
// Sets the max versus completion score for the map
native int L4D_SetVersusMaxCompletionScore(int score);
// The campaign scores are not set until the end of round 2, use L4D_GetCampaignScores to get them earlier.
native int L4D_GetTeamScore(int logical_team, bool campaign_score=false);
// Tells if the Mission (map) is the first map of the campaign
native bool L4D_IsFirstMapInScenario();
// Tells if the Mission (map) is the final map of the campaign
native bool L4D_IsMissionFinalMap();
// Notifies the CGameRulesProxy that the game state has been changed
native void L4D_NotifyNetworkStateChanged();
// Trigger's a target player's stagger behavior
native void L4D_StaggerPlayer(int target, int source_ent, float vecSource[3]);
// Calls in the rescue vehicle
native void L4D2_SendInRescueVehicle();
// L4D2 only. Changes the Finale stage
native void L4D2_ChangeFinaleStage(int finaleType, const char[] arg);
// Replaces a players tank control with another player
native void L4D_ReplaceTank(int tank, int newtank);
// Spawns a Tank
native int L4D2_SpawnTank(const float vecPos[3], const float vecAng[3]);
// Spawns a Special Infected
native int L4D2_SpawnSpecial(int zombieClass, const float vecPos[3], const float vecAng[3]);
// Spawns a Witch
native int L4D2_SpawnWitch(const float vecPos[3], const float vecAng[3]);
// L4D2 only. Spawns a Witch Bride
native int L4D2_SpawnWitchBride(const float vecPos[3], const float vecAng[3]);
// Current Tank count
native int L4D2_GetTankCount();
// Current Witch count
native int L4D2_GetWitchCount();
// Returns the current map chapter number of the campaign
native int L4D_GetCurrentChapter();
// Returns the maximum number of chapters for the current game mode
native int L4D_GetMaxChapters();
// L4D2 only. These are the actual values used for campaign scores--not proxies
native void L4D2_GetVersusCampaignScores(int scores[2]);
// L4D2 only. These are the actual values used for campaign scores--not proxies
native void L4D2_SetVersusCampaignScores(const int scores[2]);
// L4D2 only. These values are checked against as the survivors move through the map. Once they are passed, the tank spawns.
native void L4D2_GetVersusTankFlowPercent(float tankFlows[2]);
// L4D2 only. These values are checked against as the survivors move through the map. Once they are passed, the tank spawns.
native void L4D2_SetVersusTankFlowPercent(const float tankFlows[2]);
// L4D2 only. These values are checked against as the survivors move through the map. Once they are passed, the witch spawns.
native void L4D2_GetVersusWitchFlowPercent(float witchFlows[2]);
// L4D2 only. These values are checked against as the survivors move through the map. Once they are passed, the witch spawns.
native void L4D2_SetVersusWitchFlowPercent(const float witchFlows[2]);
// Removes lobby reservation from a server.
native void L4D_LobbyUnreserve();
// Checks if the server is currently reserved for a lobby
native bool L4D_LobbyIsReserved();
// Returns the lobby reservation ID
native void L4D_GetLobbyReservation(char [] reservation, int maxlength);
// Sets the lobby reservation ID
native void L4D_SetLobbyReservation(char reservation[20]);
// DEPRECATED - UNUSED
// The campaign scores are updated after L4D_OnSetCampaignScores
// native int L4D_GetCampaignScores(int &scoreA, int &scoreB);
// ====================
// TIMERS - All are L4D2 only.
// ====================
// Resets a given CountdownTimer
native void L4D2_CTimerReset(L4D2CountdownTimer timer);
// Starts a given CountdownTimer with a given duration
native void L4D2_CTimerStart(L4D2CountdownTimer timer, float duration);
// Invalidates a given CountdownTimer
native void L4D2_CTimerInvalidate(L4D2CountdownTimer timer);
// Tells if a given CountdownTimer has started
native bool L4D2_CTimerHasStarted(L4D2CountdownTimer timer);
// Tells if a given CountdownTimer is elapsed
native bool L4D2_CTimerIsElapsed(L4D2CountdownTimer timer);
// Gets elapsed time of a given CountdownTimer, from the timed it was started
native float L4D2_CTimerGetElapsedTime(L4D2CountdownTimer timer);
// Gets remaining time on a given CountdownTimer
native float L4D2_CTimerGetRemainingTime(L4D2CountdownTimer timer);
// Gets the duration of a given CountdownTimer
native float L4D2_CTimerGetCountdownDuration(L4D2CountdownTimer timer);
// Starts a given IntervalTimer
native void L4D2_ITimerStart(L4D2IntervalTimer timer);
// Invalidates a given IntervalTimer
native void L4D2_ITimerInvalidate(L4D2IntervalTimer timer);
// Tells whether a given IntervalTimer has started
native bool L4D2_ITimerHasStarted(L4D2IntervalTimer timer);
// Gets the elapsed time of a given IntervalTimer
native float L4D2_ITimerGetElapsedTime(L4D2IntervalTimer timer);
// Returns the weapon ID for a specific classname
native int L4D_GetWeaponID(const char[] weaponName);
// Checks for a given weapon string to exist in the WeaponInformationDatabase
native bool L4D2_IsValidWeapon(const char[] weaponName);
// Read an int-typed attribute for a given weapon from the WeaponInformationDatabase
native int L4D2_GetIntWeaponAttribute(const char[] weaponName, L4D2IntWeaponAttributes attr);
// Read a float-typed attribute for a given weapon from the WeaponInformationDatabase
native float L4D2_GetFloatWeaponAttribute(const char[] weaponName, L4D2FloatWeaponAttributes attr);
// Set an int-typed attribute for a given weapon from the WeaponInformationDatabase to a given value
native void L4D2_SetIntWeaponAttribute(const char[] weaponName, L4D2IntWeaponAttributes attr, int value);
// Set a float-typed attribute for a given weapon from the WeaponInformationDatabase to a given value
native void L4D2_SetFloatWeaponAttribute(const char[] weaponName, L4D2FloatWeaponAttributes attr, float value);
// L4D2 only. Retrieve the index for a given melee weapon from the Melee Weapon Database
native int L4D2_GetMeleeWeaponIndex(const char[] weaponName);
// L4D2 only. Read an int-typed attribute for a given id from the Melee Weapon Database
native int L4D2_GetIntMeleeAttribute(int id, L4D2IntMeleeWeaponAttributes attr);
// L4D2 only. Read a float-typed attribute for a given id from the Melee Weapon Database
native float L4D2_GetFloatMeleeAttribute(int id, L4D2FloatMeleeWeaponAttributes attr);
// L4D2 only. Read a bool-typed attribute for a given id from the Melee Weapon Database
native bool L4D2_GetBoolMeleeAttribute(int id, L4D2BoolMeleeWeaponAttributes attr);
// L4D2 only. Set an int-typed attribute for a given id from the Melee Weapon Database to a given value
native void L4D2_SetIntMeleeAttribute(int id, L4D2IntMeleeWeaponAttributes attr, int value);
// L4D2 only. Set a float-typed attribute for a given id from the Melee Weapon Database to a given value
native void L4D2_SetFloatMeleeAttribute(int id, L4D2FloatMeleeWeaponAttributes attr, float value);
// L4D2 only. Set a bool-typed attribute for a given id from the Melee Weapon Database to a given value
native void L4D2_SetBoolMeleeAttribute(int id, L4D2BoolMeleeWeaponAttributes attr, bool value);
// ====================
// l4d2_direct.inc (some are duplicates of the above, ported to keep consistency and allow minimal modification of existing plugins)
// ====================
// Get the current Tank count stored by the director.
native int L4D2Direct_GetTankCount();
// Returns the number of infected waiting to spawn
native int L4D2Direct_GetPendingMobCount();
// Sets the number of infected waiting to spawn
native void L4D2Direct_SetPendingMobCount(int count);
// Get a reference to the CDirector natural mob spawn CountdownTimer
native CountdownTimer L4D2Direct_GetMobSpawnTimer();
// L4D2 only. Get a reference to a IntervalTimer that counts up from the last death of a given SI class
native IntervalTimer L4D2Direct_GetSIClassDeathTimer(int class);
// L4D2 only. Get a reference to a CountdownTimer that counts down from the last attempted director-controlled spawn of an SI
native CountdownTimer L4D2Direct_GetSIClassSpawnTimer(int class);
// Gets the number of times the tank has passed to a player.
native int L4D2Direct_GetTankPassedCount();
// Sets the number of times the tank has passed to a player.
native void L4D2Direct_SetTankPassedCount(int passes);
// Reads the director's stored campaign score for a given team.
native int L4D2Direct_GetVSCampaignScore(int teamNumber);
// Set the director's stored campaign score for a given team.
native void L4D2Direct_SetVSCampaignScore(int teamNumber, int score);
// Reads the tank flow percent for a given round for versus mode
native float L4D2Direct_GetVSTankFlowPercent(int roundNumber);
// Sets the tank flow percent for a given round for versus mode
native int L4D2Direct_SetVSTankFlowPercent(int roundNumber, float flow);
// Is there going to be a tank spawned during the given round
native bool L4D2Direct_GetVSTankToSpawnThisRound(int roundNumber);
// Tell the director whether or not to spawn a(nother) flow distance-based tank for this round.
native void L4D2Direct_SetVSTankToSpawnThisRound(int roundNumber, bool spawn);
// Reads the witch flow percent for a given round for versus mode
native float L4D2Direct_GetVSWitchFlowPercent(int roundNumber);
// Sets the witch flow percent for a given round for versus mode
native int L4D2Direct_SetVSWitchFlowPercent(int roundNumber, float flow);
// Is there going to be a witch spawned during the given round
native bool L4D2Direct_GetVSWitchToSpawnThisRound(int roundNumber);
// Tell the director whether or not to spawn a(nother) flow distance-based witch for this round.
native int L4D2Direct_SetVSWitchToSpawnThisRound(int roundNumber, bool spawn);
// L4D2 only. Get a reference to the VersusStart CountdownTimer
native CountdownTimer L4D2Direct_GetVSStartTimer();
// L4D2 only. Get a reference to the Scavenge Round Setup CountdownTimer
native CountdownTimer L4D2Direct_GetScavengeRoundSetupTimer();
// L4D2 only. Get a reference to the Scavenge Overtime Grace CountdownTimer
native CountdownTimer L4D2Direct_GetScavengeOvertimeGraceTimer();
// Get the max flow distance (in flow units) for the current map.
native float L4D2Direct_GetMapMaxFlowDistance();
// L4D2 only. Get a reference to a CountdownTimer that tracks when an SI player can next spawn.
native CountdownTimer L4D2Direct_GetSpawnTimer(int client);
// Get a reference to a CountdownTimer that tracks when an survivor player is invulnerable due to "godframes".
native CountdownTimer L4D2Direct_GetInvulnerabilityTimer(int client);
// Looks up the number of tickets a client has for entry into the tank lottery.
native int L4D2Direct_GetTankTickets(int client);
// Sets the number of tickets a player has for entry into the tank lottery.
native void L4D2Direct_SetTankTickets(int client, int tickets);
// L4D2 only. Gets a client's shove penalty.
native int L4D2Direct_GetShovePenalty(int client);
// L4D2 only. Sets a client's shove penalty.
native void L4D2Direct_SetShovePenalty(int client, int penalty);
// L4D2 only. Gets the time at which a survivor can perform his next +attack2.
native float L4D2Direct_GetNextShoveTime(int client);
// L4D2 only. Sets the time at which a survivor can perform his next +attack2.
native void L4D2Direct_SetNextShoveTime(int client, float time);
// L4D2 only. Gets the health of the survivor from before they were incapacitated
native int L4D2Direct_GetPreIncapHealth(int client);
// L4D2 only. Sets the health of the survivor from before they were incapacitated
native void L4D2Direct_SetPreIncapHealth(int client, int health);
// L4D2 only. Gets the temporary health of the survivor from before they were incapacitated
native int L4D2Direct_GetPreIncapHealthBuffer(int client);
// L4D2 only. Sets the health of the survivor from before they were incapacitated
native void L4D2Direct_SetPreIncapHealthBuffer(int client, int health);
// L4D2 only. Gets the maximum number of flames a CInferno is allowed to spawn.
native int L4D2Direct_GetInfernoMaxFlames(int entity);
// L4D2 only. Sets the maximum number of flames a CInferno is allowed to spawn.
native void L4D2Direct_SetInfernoMaxFlames(int entity, int flames);
// L4D2 only: Returns the CDirectorScriptedEventManager address.
native int L4D2Direct_GetScriptedEventManager();
// Get the TerrorNavArea which holds a specific position.
native Address L4D2Direct_GetTerrorNavArea(float pos[3], float beneathLimit = 120.0);
// Find the distance through the map (in flow units) that a TerrorNavArea is located.
native float L4D2Direct_GetTerrorNavAreaFlow(Address pTerrorNavArea);
// Force the director to pass the tank.
native bool L4D2Direct_TryOfferingTankBot(int client, int bEnterStasis);
// Gets a player's distance in flow units.
native float L4D2Direct_GetFlowDistance(int client);
// Plays the specified animation for a player
native void L4D2Direct_DoAnimationEvent(int client, int event);
// L4D1 only. Get the clients health bonus.
native int L4DDirect_GetSurvivorHealthBonus(int client);
// L4D1 only. Sets the clients health bonus.
native void L4DDirect_SetSurvivorHealthBonus(int client, int health, bool recompute = true);
// L4D1 only. Compute the scores on the scoreboard
native void L4DDirect_RecomputeTeamScores();
// ====================
// l4d2d_timers.inc - timer stuff
// ====================
// Reset a CountdownTimer to begin counting down again from now to its original duration
native void CTimer_Reset(CountdownTimer timer);
// Start a CountdownTimer from now for a given duration
native void CTimer_Start(CountdownTimer timer, float duration);
// Invalidate a CountdownTimer, so it is considered not running
native void CTimer_Invalidate(CountdownTimer timer);
// Determine if a CountdownTimer has started counting down.
native bool CTimer_HasStarted(CountdownTimer timer);
// Determine if a CountdownTimer is elapsed.
native bool CTimer_IsElapsed(CountdownTimer timer);
// Check how long a CountdownTimer has been running
native float CTimer_GetElapsedTime(CountdownTimer timer);
// Check how much time remains before a CountdownTimer is elapsed.
native float CTimer_GetRemainingTime(CountdownTimer timer);
// Get the countdown duration used for a CountdownTimer
native float CTimer_GetCountdownDuration(CountdownTimer timer);
// Reset an IntervalTimer to begin counting up again from now
native void ITimer_Reset(IntervalTimer timer);
// Start an IntervalTimer to begin counting up from now
native void ITimer_Start(IntervalTimer timer);
// Invalidate an IntervalTimer, so it is considered not running
native void ITimer_Invalidate(IntervalTimer timer);
// Check if an IntervalTimer has started
native bool ITimer_HasStarted(IntervalTimer timer);
// Get the elapsed time of an IntervalTimer
native float ITimer_GetElapsedTime(IntervalTimer timer);
// Read duration variable in CTimer
native float CTimer_GetDuration(CountdownTimer timer);
// Set duration variable in CTimer
native void CTimer_SetDuration(CountdownTimer timer, float duration);
// Read timestamp variable in CTimer
native float CTimer_GetTimestamp(CountdownTimer timer);
// Set timestamp variable in CTimer
native void CTimer_SetTimestamp(CountdownTimer timer, float timestamp);
// Read timestamp variable in ITimer
native float ITimer_GetTimestamp(IntervalTimer timer);
// Set timestamp variable in ITimer
native void ITimer_SetTimestamp(IntervalTimer timer, float timestamp);
// Creates the boomer vomit effect on Survivors or Special infected
native void L4D_CTerrorPlayer_OnVomitedUpon(int client, int attacker);
// L4D2 only. Creates the boomer vomit effect on Survivors or Special infected
native void L4D2_CTerrorPlayer_OnHitByVomitJar(int client, int attacker);
// L4D2 only. Creates the boomer vomit effect on Common infected
native void L4D2_Infected_OnHitByVomitJar(int entity, int attacker);
// L4D2 only. Flings a player to the ground, like they were hit by a Charger
native void L4D2_CTerrorPlayer_Fling(int client, int attacker, float vecDir[3]);
// Cancels a player staggering
native void L4D_CancelStagger(int client);
// Flings a Survivor like when they're flung by a nearby Charger impact
native void L4D2_Charger_ThrowImpactedSurvivor(int victim, int attacker);
// Makes a Charger carry a Survivor
native void L4D2_Charger_StartCarryingVictim(int victim, int attacker);
// Makes a Charger pummel a Survivor
native void L4D2_Charger_PummelVictim(int victim, int attacker);
// Makes a Charger stop pummelling a Survivor
native void L4D2_Charger_EndPummel(int victim, int attacker);
// Spawns all dead survivors in rescuable rooms.
native void L4D_CreateRescuableSurvivors();
// Revives an incapacitated survivor, also from ledge hanging
native void L4D_ReviveSurvivor(int client);
// L4D2 only. Retrieve a clients map flow progress percentage. Doesn't have to be Versus mode
native int L4D2_GetVersusCompletionPlayer(int client);
// Returns client who is furthest in flow
native int L4D_GetHighestFlowSurvivor();
// Retrieve the specified common infected map flow distance
native float L4D_GetInfectedFlowDistance(int entity);
// Takeover another special infected.
native void L4D_TakeOverZombieBot(int client, int target);
// Replaces the player with a bot
native void L4D_ReplaceWithBot(int client);
// Kills the player. Teleports their view to a random survivor
native void L4D_CullZombie(int client);
// Sets a players zombie class, special infected can be alive and change!
native void L4D_SetClass(int client, int zombieClass);
// Spawns a special infected from ghost state. Returns the clients "m_customAbility" weapon, or -1 on error (possibly not a ghost)
native int L4D_MaterializeFromGhost(int client);
// Turns an alive player into the ghost state
native bool L4D_BecomeGhost(int client);
// Enter ghost/dead mode. Some state values may have different results. Unknown.
native void L4D_State_Transition(int client, int state);
// L4D2 only. Swaps the teams in Versus
native void L4D2_SwapTeams();
// L4D2 only. Returns if Versus team are flipped
native int L4D2_AreTeamsFlipped();
// L4D2 only. Starts a Versus rematch vote like end of game before credits roll
native void L4D2_StartRematchVote();
// L4D2 only. Seems to restart the chapter like "mp_restartgame". In Versus the teams flip.
native void L4D2_FullRestart();
// L4D2 only. Hides end of round scoreboard.
native void L4D2_HideVersusScoreboard();
// L4D2 only. Hides end of round scoreboard.
native void L4D2_HideScavengeScoreboard();
// L4D2 only. Hides end of round scoreboard.
native void L4D2_HideScoreboard();
// NOT WORKING? Setup car alarm for object. Seems to have no affect. Only works on prop_breakable or prop_car_alarm?
native int L4D_RegisterForbiddenTarget(int entity);
// NOT WORKING? Remove car alarm for object. Seems to have no affect. Only works on prop_breakable or prop_car_alarm?
native void L4D_UnRegisterForbiddenTarget(int entity);
// Returns the OS of the server.
stock OS_Type GetOSType(Handle &hGamedata=null)
// An alternative to TeleportEntity that maintains lerped movement client-side when setting an entity's new origin.
stock bool SetAbsOrigin(int iEntity, const float vec[3])
// An alternative to TeleportEntity that maintains lerped movement client-side when setting an entity's new velocity.
stock bool SetAbsVelocity(int iEntity, const float vec[3])
// An alternative to TeleportEntity that maintains lerped movement client-side when setting an entity's new angles.
stock bool SetAbsAngles(int iEntity, const float vec[3])
// Copies the origin and angles vectors for world space attachment index location.
stock bool GetAttachmentVectors(int iEntity, char[] attachmentName, float vecOrigin[3], float vecAngles[3])
// Looks up an entity's attachment index via its name.
stock int LookupAttachment(int iEntity, char[] attachmentName)
// Copies the origin and angles vectors for world space attachment index location.
stock bool GetAttachment(int iEntity, int iAttachment, float vecOrigin[3], float vecAngles[3])
// Checks whether a given position is in water.
stock bool IsPositionInWater(float vecOrigin[3])
// Sets DSP effect post audio FX.
stock void Terror_SetPendingDspEffect(int iClient, float flDelay, int dspEffectType)
// L4D2 only. Sets the adrenaline effect duration of a survivor.
stock void Terror_SetAdrenalineTime(int iClient, float flDuration)
// L4D2 only. Returns the remaining duration of a survivor's adrenaline effect.
stock float Terror_GetAdrenalineTime(int iClient)
// Create a physics explosion that does not affect players and don't check for line of sight and no force fall-off.
stock void PhysicsExplode(float vecOrigin[3], int iMagnitude, float flRadius, bool bDamage=false)
// L4D2 only. Sets up an invisible explosion to push client-side physics.
stock void TE_SetupExplodeForce(float vecOrigin[3], float flRadius, float flMagnitude)
// Creates a clientside physics prop.
stock void TE_SetupPhysicsProp(float vecModelOrigin[3], int iPrecacheModel, float vecModelAngles[3]={0.0, ...}, float vecVelocity[3]={0.0, ...}, int iFlags=0, int iEffects=0, int iSkin=0, int RGB[3]={255, ...})
// Sets up a dynamic light.
stock bool TE_SetupDynamicLight(float vecOrigin[3], int RGB[3], float flRadius, float flTime, float flDecay=0.0, int exponent=0)
// Sets up a particle effect's attachment.
stock void TE_SetupParticleAttachment(int iParticleIndex, int iAttachmentIndex, int iEntIndex, bool bFollow=false)
// Sets up a particle effect.
stock void TE_SetupParticle(int iParticleIndex, float vecParticleStartPos[3], float vecParticleEndPos[3]={0.0, 0.0, 0.0}, float vecParticleAngles[3]={0.0, 0.0, 0.0}, int iEntity=0)
// Sets up a particle effect to follow an entity's origin (0, 0, 0).
stock void TE_SetupParticleFollowEntity(int iParticleIndex, int iEntIndex, float vecParticleAngles[3]={0.0, 0.0, 0.0})
// L4D2 only. Sets up a particle effect to follow an entity's origin (0, 0, 0) while maintaining offset.
stock void TE_SetupParticleFollowEntity_MaintainOffset(int iParticleIndex, int iEntIndex, float vecParticleStartPos[3], float vecParticleAngles[3]={0.0, 0.0, 0.0})
// Set up particle that attaches to points on a model that is predefined in particle i think.
stock void TE_SetupParticle_ControlPoints(int iParticleIndex, int iEntIndex, float vecParticleStartPos[3])
// Sets up a particle effect via its name to follow an entity's origin (0, 0, 0).
stock bool TE_SetupParticleFollowEntity_Name(char[] sParticleName, int iEntIndex, float vecParticleAngles[3]={0.0, 0.0, 0.0})
// Sets up a particle effect via its name to follow an entity's origin (0, 0, 0) while maintaining offset.
stock bool TE_SetupParticleFollowEntity_MaintainOffset_Name(char[] sParticleName, int iEntIndex, float vecParticleStartPos[3], float vecParticleAngles[3]={0.0, 0.0, 0.0})
// Sets up a particle effect via a name.
stock bool TE_SetupParticle_Name(char[] sParticleName, float vecParticleStartPos[3], float vecParticleEndPos[3]={0.0, 0.0, 0.0}, float vecParticleAngles[3]={0.0, 0.0, 0.0}, int iEntity=0)
// Sets up a particle effect's attachment via a name.
stock bool TE_SetupParticleAttachment_Names(char[] sParticleName, char[] sAttachmentName, int iEntIndex, bool bFollow=false)
// Stops all particle effects emitted on an entity, such as attachment followers.
stock void TE_SetupStopAllParticles(int iEntIndex)
// Sets up tracer sound for client-side.
stock void TE_SetupTracerSound(float vecParticleStartPos[3], float vecParticleEndPos[3])
// Note to apply to static props pass 0(world) to iTarget and iHitbox is used for static prop index TR_GetHitBoxIndex() to trace it.
stock void TE_SetupEntityDecal(float vecOrigin[3], float vecStart[3], int iTarget, int iHitbox=0, int iPrecacheDecal)
// Sets up a world decal.
stock void TE_SetupWorldDecal(float vecOrigin[3], int iPrecacheDecal)
// Sets up a decal from a traceray.
stock bool TE_SetupDecal_FromTrace(Handle hTR=INVALID_HANDLE, char[] sDecalName)
// Gets a Decal index or late precaches it.
stock int GetDecalIndex(char[] sDecalName)
// Gets a particle system index or late precaches it.
stock int GetParticleIndex(char[] sParticleName)
// A wrapper function for SMLib's PrecacheParticleSystem to avoid include collisions.
stock int Precache_Particle_System(const char[] particleSystem)
// Get an entity's world space origin.
stock void GetAbsOrigin(int iEntity, float vecOrigin[3], bool bCenter=false)
// Returns survivor player shove penalty.
stock int L4D_GetPlayerShovePenalty(int client)
// Set survivor player shove penalty.
stock void L4D_SetPlayerShovePenalty(int client, int shovePenalty)
// Returns tank player's frustration.
stock int L4D_GetTankFrustration(int client)
// Set tank player's frustration.
stock void L4D_SetTankFrustration(int client, int frustration)
// Returns whether survivor player is idle.
stock bool L4D_IsPlayerIdle(int client)
// Returns survivor bot of idle survivor player.
stock int L4D_GetBotOfIdlePlayer(int client)
// Returns idle survivor player of survivor bot.
stock int L4D_GetIdlePlayerOfBot(int bot)
// Retrieves client data from the resource entity.
stock int L4D_GetPlayerResourceData(int client, L4DResourceType type)
// Sets client data in the resource entity.
stock bool L4D_SetPlayerResourceData(int client, L4DResourceType type, any value)
// Removes the weapon from a client's weapon slot
stock void L4D_RemoveWeaponSlot(int client, L4DWeaponSlot slot)
// Removes all weapons from a client
stock void L4D_RemoveAllWeapons(int client)
// Returns whether the finale is active.
stock bool L4D_IsFinaleActive()
// Returns whether any survivor have left the safe area.
stock bool L4D_HasAnySurvivorLeftSafeArea()
// Returns pending tank player.
stock int L4D_GetPendingTankPlayer()
// L4D2 only. Set entity glow. This is consider safer and more robust over setting each glow property on their own because glow offset will be check first.
stock bool L4D2_SetEntityGlow(int entity, L4D2GlowType type, int range, int minRange, colorOverride[3], bool flashing)
// ====================================================================================================
// From "l4d_weapon_stocks.inc" - Thanks to "Mr. Zero":
// ====================================================================================================
// L4D2 only. Returns whether weapon id is valid.
stock bool L4D2_IsValidWeaponId(L4D2WeaponId weaponId)
// L4D2 only. Returns whether weapon name is a valid weapon.
stock bool L4D2_IsValidWeaponName(const char[] weaponName)
// L4D2 only. Checks to see if a given weapon id has a known WeaponModel in this file's model array.
stock bool L4D2_HasValidWeaponWorldModel(L4D2WeaponId weaponId)
// L4D2 only. Returns weapon world model by weapon id.
stock int L4D2_GetWeaponModelByWeaponId(L4D2WeaponId weaponId, char[] dest, int destlen)
// L4D2 only. Returns weapon id by weapon world model.
stock L4D2WeaponId L4D2_GetWeaponIdByWeaponModel(const char[] model)
// L4D2 only. Returns weapon id by weapon name.
stock L4D2WeaponId L4D2_GetWeaponIdByWeaponName(const char[] weaponName)
// L4D2 only. Returns weapon name by weapon id.
stock int L4D2_GetWeaponNameByWeaponId(L4D2WeaponId weaponId, char[] dest, int destlen)
// L4D2 only. Returns weapon id of entity.
stock L4D2WeaponId L4D2_GetWeaponId(int weapon)
// L4D2 only. Initialize the L4D2 weapon names trie. Not necessary to be executed, done by the functions that require the trie.
stock void L4D2_InitWeaponNameTrie()
Changes:
Code:
1.104 (28-May-2022)
- Fixed the new natives from the last update throwing errors in L4D1.
1.103 (28-May-2022)
- L4D2: Added new natives:
"L4D2_Charger_ThrowImpactedSurvivor" - To throw a Survivor like when they're flung by a Charger impacting nearby.
"L4D2_Charger_StartCarryingVictim" - To carry a Survivor by a Charger.
"L4D2_Charger_PummelVictim" - To pummel a specific Survivor by a Charger.
"L4D2_Charger_EndPummel" - To end pummelling a Survivor by a Charger.
- Various changes to the "left4dhooks.inc" include file. Thanks to "Vinillia" for fixing.
- Added some missing params
- Added some const qualifiers
- Renamed some brief params
- Changed some return types to any to avoid extra casting
- When recompiling plugins changes maybe required to align with these fixes.
- Updated: Plugin and test plugin.
- Updated: "left4dhooks.inc" and "left4dhooks_stocks.inc" Include files.
- Updated: "left4dhooks.l4d2.txt" GameData file.
1.102 (16-May-2022)
- Added various post hook forwards that will trigger even when the relative pre hook has been blocked with return Plugin_Handled. This is since the changes in Left4DHooks version 1.94.
- Added new forwards:
"L4D_OnSpawnSpecial_PostHandled", "L4D_OnSpawnTank_PostHandled", "L4D_OnSpawnWitch_PostHandled", "L4D_OnMobRushStart_PostHandled", "L4D_OnSpawnITMob_PostHandled", "L4D_OnSpawnMob_PostHandled",
"L4D_OnEnterGhostState_PostHandled", "L4D_OnFirstSurvivorLeftSafeArea_PostHandled", "L4D_OnGetMissionVSBossSpawning_PostHandled", "L4D_TankClaw_OnPlayerHit_PostHandled", "L4D_OnTryOfferingTankBot_PostHandled",
"L4D_OnCThrowActivate_PostHandled", "L4D2_OnEndVersusModeRound_PostHandled", "L4D_OnLedgeGrabbed_PostHandled", "L4D2_OnStagger_PostHandled", "L4D_OnShovedBySurvivor_PostHandled", "L4D2_OnEntityShoved_PostHandled",
"L4D2_OnPounceOrLeapStumble_PostHandled", "L4D_OnKnockedDown_PostHandled", "L4D2_OnPummelVictim_PostHandled", "L4D2_OnThrowImpactedSurvivor_PostHandled", "L4D2_OnPlayerFling_PostHandled",
"L4D_OnMaterializeFromGhost_PostHandled", "L4D_OnVomitedUpon_PostHandled", "L4D_PipeBombProjectile_PostHandled", "L4D_OnPouncedOnSurvivor_PostHandled", "L4D_OnGrabWithTongue_PostHandled".
1.101 (10-May-2022)
- Added natives "L4D_GetCheckpointFirst" and "L4D_GetCheckpointLast" to get the first and last saferoom door entities.
- Updated: "left4dhooks.inc" Include file.
1.100 (28-Apr-2022)
- Fixed forward "L4D2_OnStagger_Post" throwing errors. Thanks to "Eyal282" for reporting.
1.99 (27-Apr-2022)
- Fixed forward "L4D2_OnStagger_Post" not triggering. Thanks to "Eyal282" for reporting.
1.98 (27-Apr-2022)
- Added new forward "L4D_OnSwingStart" to trigger when a Survivor shoves.
- Added post hook forward "L4D_OnShovedBySurvivor_Post". Requested by "Eyal282".
- Added post hook forwards: "L4D_TankRock_OnRelease_Post, "L4D_OnCThrowActivate_Post", "L4D_OnLedgeGrabbed_Post", "L4D2_OnEntityShoved_Post",
- "L4D_OnPouncedOnSurvivor_Post", "L4D_OnStartMeleeSwing_Post" and "L4D2_OnChangeFinaleStage_Post"
- Fixed native "L4D2Direct_SetNextShoveTime" not working when setting the shove time earlier than the current value. Thanks to "Eyal282" for reporting and helping fix.
- Updated: Plugin and test plugin.
- Updated: "left4dhooks.inc" Include file.
- Updated: "left4dhooks.l4d1.txt" and "left4dhooks.l4d2.txt" GameData files.
1.97 (15-Apr-2022)
- Fixed removing animation detours in the same frame as the detour callback, crashing the server. Thanks to "Red Flame" and "fdxx" for reporting and helping.
- Fixed not erasing all animation hooks on client disconnect. Thanks to "sorallll" for reporting and fixing.
- Fixed not hooking pre hooks when only post forwards were used. Thanks to "Beatles" for reporting.
1.96 (11-Apr-2022)
- Fixed error on client disconnect. Thanks to "sorallll" for reporting.
1.95 (10-Apr-2022)
- Added stock "GetRandomClient" in the "left4dhooks_silver.inc" include file.
- Added forward "L4D_OnWitchSetHarasser" to fire when a Witch has been startled. Requested by "ProjectSky".
- Added post hook forward "L4D_OnTryOfferingTankBot_Post" to compliment it's related forward "L4D_OnTryOfferingTankBot".
- Fixed animation hooks not removing the detour when no longer required.
- Fixed animation hooks not cleaning up when a client disconnects.
- Fixed animation hooks triggering on clients other than those specified. Thanks to "JoinedSenses", "nosoop" and "Impact" for helping.
- Fixed forward "L4D2_OnPummelVictim" bugging out the victim when blocking the pummel.
- Fixed some description errors in the "left4dhooks.inc" include file. Thanks to "Eyal282" for reporting.
- Fixed a compile warning in 1.11 from the "left4dhooks_silver.inc" include file.
- Updated: Plugin and test plugin.
- Updated: "left4dhooks.inc" and "left4dhooks_silver.inc" Include files.
- Updated: "left4dhooks.l4d1.txt" and "left4dhooks.l4d2.txt" GameData files.
1.94 (29-Mar-2022)
- Added natives "L4D_GetReserveAmmo" and "L4D_SetReserveAmmo" to get and set a players weapons reserve ammo.
- Changed forward "L4D2_CGasCan_ShouldStartAction" swapping the nozzle and gascan params - to keep consistency with "L4D2_CGasCan_ActionComplete". Thanks to "Eyal282" for reporting.
- Fixed forward "L4D2_OnPlayerFling" not firing. Thanks to "Forgetest" for reporting.
- The follow forwards will no longer fire their post hook counterparts when blocked in the pre-hook (this allows using the post hooks to guarantee the forwards detoured function is invoked):
"L4D2_OnHitByVomitJar", "L4D_OnVomitedUpon", "L4D2_CInsectSwarm_CanHarm", "L4D2_OnStartCarryingVictim", "L4D2_OnStartCarryingVictim", "L4D2_OnJockeyRide", "L4D_OnGrabWithTongue",
"L4D2_CGasCan_ActionComplete", "L4D2_CGasCan_ShouldStartAction", "L4D_PipeBombProjectile_Pre", "L4D_OnMaterializeFromGhostPre", "L4D2_OnPlayerFling", "L4D2_OnThrowImpactedSurvivor",
"L4D2_OnPummelVictim", "L4D_OnKnockedDown", "L4D2_OnPounceOrLeapStumble", "L4D2_OnEndVersusModeRound", "L4D_OnTryOfferingTankBot", "L4D_TankClaw_OnPlayerHit_Pre", "L4D_OnGetMissionVSBossSpawning",
"L4D_OnEnterGhostState", "L4D_OnSpawnMob", "L4D_OnSpawnITMob", "L4D_OnMobRushStart", "L4D_OnFirstSurvivorLeftSafeArea", "L4D_OnSpawnWitch", "L4D2_OnSpawnWitchBride", "L4D_OnSpawnTank" and "L4D_OnSpawnSpecial".
1.93 (25-Mar-2022)
- Fixed forward "L4D_OnVomitedUpon_Post" throwing errors.
1.92 (24-Mar-2022)
- Fixed forward "L4D_OnSpawnSpecial_Post" firing when the client index is -1. Seems the code wasn't copied to the release.
1.91 (24-Mar-2022)
- Added post hook forwards:
"L4D2_CGasCan_ShouldStartAction_Post", "L4D2_CGasCan_ActionComplete_Post", "L4D2_CInsectSwarm_CanHarm_Post",
"L4D_OnMobRushStart_Post", "L4D_OnSpawnITMob_Post", "L4D_OnSpawnMob_Post", "L4D2_OnStagger_Post", "L4D2_OnPounceOrLeapStumble_Post",
"L4D_OnSetCampaignScores_Post", "L4D_OnRecalculateVersusScore_Post", "L4D_OnHasConfigurableDifficulty_Post",
"L4D_OnVomitedUpon_Post", "L4D2_OnHitByVomitJar_Post", "L4D2_OnJockeyRide_Post" and "L4D2_OnStartCarryingVictim_Post".
- Changed forward "L4D2_CGasCan_ShouldStartAction" params to include the nozzle entity.
- Added some missing "MarkNativeAsOptional" lines to the include file.
- Cleaned and tidied up some code.
- Fixed forward "L4D_OnSpawnSpecial" firing when the client index is -1. Thanks to "Marttt" for reporting.
- Fixed forward "L4D2_CGasCan_ShouldStartAction" crashing. Thanks to "Eyal282" for reporting.
- Fixed native "L4D_GetCurrentChapter" sometimes reporting the wrong chapter number.
- Updated: Plugin and test plugin.
- Updated: "left4dhooks.inc" and "left4dhooks_silver.inc" Include files.
- Updated: "left4dhooks.l4d2.txt" GameData file.
1.90 (20-Mar-2022)
- Added forwards "L4D_OnKnockedDown" and "L4D_OnKnockedDown_Post" to trigger when a Survivor is being thrown by a Tank rock or Hunter lung.
- Added forwards "L4D2_OnThrowImpactedSurvivor" and "L4D2_OnThrowImpactedSurvivor_Post" to trigger when a Survivor is impacted by a Charger.
- Added forwards "L4D2_OnPummelVictim" and "L4D2_OnPummelVictim_Post" to trigger when a Survivor is about to be pummelled by a Charger.
- Added native "L4D_EstimateFallingDamage" to check a players estimated falling damage. Requested by "Eyal282".
- Added stocks "L4D_GetPinnedSurvivor" and "L4D2_IsMultiCharged" in the "left4dhooks_silver.inc" include file. Requested by "Eyal282".
- Changed stock "L4D_IsPlayerStaggering" in the "left4dhooks_silver.inc" include file to add better thanks. Thanks to "HarryPotter" for modifying.
- Changed forward "L4D_OnMaterializeFromGhost" from "Action" type to "void". Thanks to "Eyal282" for reporting.
- Updated: Plugin and test plugin.
- Updated: "left4dhooks.inc" and "left4dhooks_silver.inc" Include files.
- Updated: "left4dhooks.l4d1.txt" and "left4dhooks.l4d2.txt" GameData files.
1.89 (02-Mar-2022)
- Fixed various @ targeting from only selecting 1 player. Thanks to "Eyal282" for reporting.
- Changed stock "L4D_ForcePanicEvent" in the "left4dhooks_silver.inc" include file" to fix breaking and in L4D2 trigger under more circumstances. Thanks to "Eyal282" for reporting.
1.88 (01-Mar-2022)
- Added forward "L4D2_CGasCan_ShouldStartAction" (L4D2 only) to trigger when someone is about to pour a gascan. Requested by "Eyal282".
- Added forward "L4D2_OnPlayerFling_Post" as a post hook to supplement the "L4D2_OnPlayerFling" forward. Requested by "Eyal282".
- Added natives "L4D_ForceVersusStart", "L4D_ForceSurvivalStart" and "L4D2_ForceScavengeStart" (L4D2 only). Requested by "ProjectSky".
- Thanks to "Lux" for some advice.
- Added stock "L4D_GetClientTeam" in the "left4dhooks_stocks.inc" include file. Requested by Eyal282".
- Added stock "L4D_IsPlayerStaggering" in the "left4dhooks_silver.inc" include file. Thanks to "HarryPotter" for writing.
- Changed stock "L4D_ForcePanicEvent" in the "left4dhooks_silver.inc" include file to strip cheat flags when executing the command. Thanks to "Eyal282" for reporting.
- Fixed stock "L4D_GetPinnedInfected" in the "left4dhooks_silver.inc" include file not returning a Charger carrying someone. Thanks to "Eyal282" for reporting.
- Added enums "L4D1ZombieClassname" and "L4D2ZombieClassname" to the "left4dhooks_stocks.inc" include file to retrieve a classname from the relative "L4D1ZombieClassType" and "L4D2ZombieClassType" enums.
- Added target filters "@blackwhite" and "@bw" to target people who are on their third strike (black and white - about to die). Requested by "eyal282".
- Added target filters "@survivorbots" and "@sb" to target Survivor Bots. Requested by "LordVGames".
- Added target filters "@infectedbots" and "@ib" to target Infected Bots. Requested by "LordVGames".
- Changed "L4D2Direct_SetShovePenalty" and "L4D2Direct_SetNextShoveTime" to use SDKCalls instead of writing to memory.
- Changes to potentially fix intermittent crashing on map change when using "CTimer_Set*", "ITimer_Set*", natives.
- Thanks to "Forgetest" and "vikingo12" for reporting and possible solutions.
- Requires re-compiling with SourceMod 1.11 to take affect.
- Updated: Plugin and test plugin.
- Updated: "left4dhooks.inc" Include file.
- Updated: "left4dhooks_silver.inc" Include file.
- Updated: "left4dhooks_stocks.inc" Include file.
- Updated: "left4dhooks.l4d1.txt" and "left4dhooks.l4d2.txt" GameData files.
- Plugins using these stocks should recompile their plugin if the relative stock mentioned above has been updated.
1.87 (06-Feb-2022)
- Added native "L4D_LobbyIsReserved" to return if players connected from the lobby and reserved the server.
- Added natives "L4D_GetLobbyReservation" and "L4D_SetLobbyReservation" to get and set the lobby reservation ID.
- Setting lobby reservation may not work when L4DToolZ is installed.
- Added new weapon attribute. Requested by "vikingo12".
- L4D2FloatWeaponAttributes: "L4D2FWA_ReloadDuration".
- L4D2: now dynamically generates the "CTerrorGameRules::IsRealism" signature to future proof against updates breaking the signature.
- Updated: Plugin.
- Updated: "left4dhooks.inc" Include file.
- Updated: "left4dhooks.l4d1.txt" and "left4dhooks.l4d2.txt" GameData files.
1.86 (02-Feb-2022)
- Added forward "L4D_OnServerHibernationUpdate" to report when server hibernation status changes. Requested by ProjectSky".
- Added new weapon attribute. Requested by "A1m".
- L4D2FloatWeaponAttributes: "L4D2FWA_GainRange".
- Fixed broken signatures in L4D1 and L4D2 due to game updates.
- Updated: Plugin.
- Updated: "left4dhooks.inc" Include file.
- Updated: "left4dhooks.l4d1.txt" and "left4dhooks.l4d2.txt" GameData files.
1.85 (10-Jan-2022)
- Fixed "L4D2IWA_Bucket", "L4D2IWA_Tier", "L4D2FWA_VerticalPunch" and "L4D2FWA_HorizontalPunch" not reading offsets. Thanks to "DarklSide" for reporting.
- Fixed native "AnimHookDisable" removing all hooks when multiple identical hook callbacks are added from a single plugin. Thanks to "Eärendil" for reporting.
1.84 (08-Jan-2022)
- Fixed forward "L4D_OnTryOfferingTankBot" detour returning the wrong value when using "Plugin_Changed". Thanks to "Nuki" for reporting.
- Fixed "Local_GetRandomClient" not processing alive or bots values correctly. Thanks to "Mrs cheng" for reporting.
- Now using a random seed when using functions that randomly select players. Requested by "Mrs cheng".
- More error messages report the OS, game and plugin version.
- Updated: Plugin.
- Updated: "left4dhooks_silver.inc" Include file.
1.83 (25-Dec-2021)
- Made error messages report the OS, game and plugin version.
- Wildcarded the "CDirector::RestartScenarioFromVote" signature for L4D1. Thanks to "Beatles" or reporting.
- Updated: Plugin.
- Updated: "left4dhooks.l4d1.txt" GameData file.
1.82 (14-Dec-2021)
- Added new weapon attributes. Thanks to "iaNanaNana" for requesting and giving offsets.
- L4D2IntWeaponAttributes: "L4D2IWA_Bucket" (both games) and "L4D2IWA_Tier" (L4D2 only).
- L4D2FloatWeaponAttributes: "L4D2FWA_VerticalPunch" and "L4D2FWA_HorizontalPunch".
- Updated: Plugin.
- Updated: "left4dhooks.inc" Include file.
- Updated: "left4dhooks.l4d1.txt" and "left4dhooks.l4d2.txt" GameData files.
1.81 (30-Nov-2021)
- Fixed forward "L4D_OnVomitedUpon" sometimes throwing errors about null pointer. Thanks to "Krufftys Killers" for reporting.
- Changed function "Local_GetRandomClient" in "left4dhooks_silver.inc" to be stock. Thanks to "A1m" for reporting.
- Updated: Plugin.
- Updated: "left4dhooks_silver.inc" Include file.
1.80 (24-Nov-2021)
- Fixed forward "L4D_OnSpawnSpecial_Post" param error. Thanks to "fdxx" for reporting.
1.79 (23-Nov-2021)
- Changed forward "L4D_OnSpawnSpecial_Post" prototype to remove the reference variable.
- Updated: Plugin and Test plugin.
- Updated: "left4dhooks.inc" Include file.
1.78 (23-Nov-2021)
- Added forwards "L4D_OnSpawnSpecial_Post", "L4D_OnSpawnTank_Post", "L4D_OnSpawnWitch_Post" and "L4D2_OnSpawnWitchBride_Post". Requested by "A1m".
- Added stocks "GetAnyRandomClient", "GetRandomSurvivor" and "GetRandomInfected" to the "left4dhooks_silver.inc" include file.
- Updated: Plugin and Test plugin.
- Updated: "left4dhooks.l4d1" and "left4dhooks.l4d2" GameData files.
- Updated: "left4dhooks.inc" and "left4dhooks_silver.inc" Include files.
1.77 (21-Nov-2021)
- Fixed not detouring some functions when only 1 detour was used instead of both pre and post. Thanks to "fdxx" for reporting.
1.76 (20-Nov-2021)
- Fixed native "L4D2_IsReachable" using a bad signature. Thanks to "tRololo312312" for reporting.
- Wildcarded the "Music::Play" signatures to be compatible with plugins detouring. Thanks to "user2000", "Edison1318" and "Shadowysn" for reporting.
- Wildcarded the "ZombieManager::SpawnTank" signatures to be compatible with plugins detouring. Thanks to "Tank Rush" for reporting.
- L4D1 and L4D2 GameData files updated.
1.75 (18-Nov-2021)
- Fixed forward "L4D2_OnHitByVomitJar" throwing errors about null pointer.
- Forwards "L4D_OnVomitedUpon" and "L4D2_OnHitByVomitJar" attacker can now be reported as 0.
- "left4dhooks_silver.inc" include:
- Deprecated stock "L4D_IsPlayerIncapped".
- "left4dhooks_stocks.inc" include:
- Renamed the stock "L4D_HasAnySurvivorLeftSafeArea" to "L4D_HasAnySurvivorLeftSafeAreaStock" (the native "L4D_HasAnySurvivorLeftSafeArea" still exists).
- Fixed compile errors on SourceMod version 1.11. Thanks to "user2000" for reporting.
- Replaced indentation spaces with tabs.
- Note: "#include <left4dhooks>" will load all <left4dhooks_*> includes. Other "#include <left4dhooks_*>" will attempt to load each other if included on their own.
- Only required to use "#include <left4dhooks>" for all features and stocks availability.
- Plugin and Include files updated.
1.74 (16-Nov-2021)
- Fixed releasing 1.73 with the wrong "left4dhooks_stocks.inc" include file version. Thanks to "moschinovac" for reporting.
1.73 (15-Nov-2021)
- Added tons of new stocks! About 147!
- Added some new enums to the "left4dhooks_silver.inc" include file: "L4D_TEAM_*", "L4D_ZOMBIE_CLASS_*", "L4D2_ZOMBIE_CLASS_*" and "L4D_WEAPON_SLOT_*".
- Added new include file "left4dhooks_lux_library.inc" - various new stocks from "lux_library.inc". Thanks to "Lux" for the original file and allowing use.
- Added new include file "left4dhooks_silver.inc" - various new stocks. This will be updated over time to add new simple stock functions.
- Added new inclide file "left4dhooks_stocks.inc" - various new stocks from "l4d_stocks.inc". Thanks to "Mr. Zero" for the original files.
- This is also combined with the "l4d_weapon_stocks.inc" include file by "Mr. Zero".
- Only required to copy to the "scripting/include" directory when compiling, "left4dhooks.inc" will include these automatically.
- New GameData file "lux_library.txt" used for the "left4dhooks_lux_library.inc" include file. Thanks to "Lux" for providing these.
- Updated: Plugin, Test plugin, Include file.
- Added: New include files and GameData file.
1.72 (10-Nov-2021)
- Added native "L4D_GetPointer" to return various pointer addresses.
- Added native "L4D_GetClientFromAddress" to return a client index from a memory address.
- Added native "L4D_GetEntityFromAddress" to return an entity index from a memory address.
- Added native "L4D_ReadMemoryString" to read a string from a memory address.
- Added native "L4D_GetServerOS" to return the current server OS.
1.71 (07-Nov-2021)
- Fixed native "L4D2_GetSurvivorSetMod" not being restricted to L4D2. Thanks to "HarryPotter" for reporting.
- Plugin now loads about 1 second faster and no longer creates about 1 second delay on map changes.
- Changes to the "sm_l4dd_detours" and "sm_l4dhooks_detours" commands to prevent errors when using the DEBUG or DETOUR defines.
1.70 (07-Nov-2021)
- Added native "L4D_TankRockPrj" to create a Tank Rock projectile.
- Added native "L4D_DetonateProjectile" to detonate grenade projectiles.
- Added natives to L4D2: "L4D2_GetSurvivorSetMap" and "L4D2_GetSurvivorSetMod" to return the maps and modified Survivor set.
- Changed forwards "L4D_OnGetSurvivorSet" and "L4D_OnFastGetSurvivorSet" to post hooks to retrieve the correct value. Thanks to "Gabe Iggy" for reporting.
- Fixed detours "OnShovedBySurvivor_Clone" and "OnStaggered_Clone" being broken on L4D1 linux. Thanks to "HarryPotter" for reporting.
- GameData files, include file and plugins updated.
1.69a (04-Nov-2021)
- Added missing forwards "L4D_OnPouncedOnSurvivor" and "L4D2_OnStartCarryingVictim" to the include file. Thanks to "ProjectSky" for reporting.
1.69 (03-Nov-2021)
- Added forward "L4D_OnPouncedOnSurvivor" to notify when a Survivor is being pounced on by a Hunter.
- Added forward "L4D2_OnStartCarryingVictim" to L4D2 to notify when a Survivor is being grabbed by a Charger.
- Fixed some natives disabling the plugin if their signatures broke. Only their functionality will break.
- GameData files, include file and plugins updated.
1.68 (02-Nov-2021)
- Added forward "L4D_OnGrabWithTongue" to L4D2 to notify when someone is about to be grabbed by a Smoker Tongue. Requested by "Alexmy".
- Added forward "L4D2_OnJockeyRide" to notify when someone is about to be ridden by a Jockey. Requested by "Alexmy".
- Cleaned and consolidated the code: standardized gamedata names, function names and variable names.
- Compatibility support for SourceMod 1.11. Fixed various warnings.
- GameData files, include file and plugins updated.
1.67 (25-Oct-2021)
- Fixed the create projectile natives from failing still when passing 0 entity index. Thanks to "BHaType" for reporting.
- Fixed L4D1 Linux forward "TryOfferingTankBot" sometimes throwing errors. Thanks to "HarryPotter" for reporting.
- Fixed L4D1 setting "L4D2FWA_PenetrationNumLayers" - float values will be rounded to ceiling. Thanks to "epzminion" for finding and "Psyk0tik" for reporting.
- Fixed target filters "@isb" and "@isp" being flipped.
1.66 (21-Oct-2021)
- Fixed L4D1 Linux not finding the "g_pWeaponInfoDatabase" signature. Thanks to "Ja-Forces" for reporting.
- L4D1 GameData updated.
1.65 (20-Oct-2021)
- Changed forward "L4D2_CGasCan_EventKilled" params to show the inflictor and attacker.
- Thanks to "ProjectSky" for reminding me.
- Plugins and include file updated.
1.64 (20-Oct-2021)
- Added 1 new forward to L4D1 and L4D2:
- "L4D_CBreakableProp_Break" - When a physics prop is broken.
- Added 3 new forwards to L4D2:
- "L4D2_CGasCan_EventKilled" - When a GasCan is destroyed.
- "L4D2_CGasCan_ActionComplete" - When a Survivor has finished pouring gas.
- "L4D2_CInsectSwarm_CanHarm" - When Spitter Acid is checking if a player or entity can be damaged.
- Added 1 new native to L4D1 and L4D2:
- "L4D_GetWeaponID" - to get the Weapon ID by classname
- Added and unlocked all the weapon attribute modification natives to L4D1:
- Thanks to "Psyk0tik" for the suggestion and information about offsets.
- "L4D2_IsValidWeapon"
- "L4D2_GetFloatWeaponAttribute" and "L4D2_SetFloatWeaponAttribute"
- "L4D2_GetIntWeaponAttribute" and "L4D2_SetIntWeaponAttribute"
- "L4D2IntWeaponAttributes" enums - ("L4D2IWA_Bullets", "L4D2IWA_Damage", "L4D2IWA_ClipSize")
- "L4D2FloatWeaponAttributes" enums - ("L4D2FWA_MaxPlayerSpeed", "L4D2FWA_SpreadPerShot", "L4D2FWA_MaxSpread", "L4D2FWA_Range", etc)
- Added new target filters (requested by Tonblader):
"@deads" - Dead Survivors (all, bots)
"@deadsi" - Dead Special Infected (all, bots)
"@deadsp" - Dead Survivors players (no bots)
"@deadsip" - Dead Special Infected players (no bots)
"@deadsb" - Dead Survivors bots (no players)
"@deadsib" - Dead Special Infected bots (no players)
"@sp" - Survivors players (no bots)
"@isp" - Special Infected players (no bots)
"@isb" - Incapped Survivor Only Bots
"@isp" - Incapped Survivor Only Players
- Changed target filter names (requested by Tonblader):
"@incappedsurvivorbot" to "@rincappedsurvivorbot"
"@isb" to "@risb"
"@survivorbot" to "@rsurvivorbot"
"@sb" to "@rsb"
"@infectedbot" to "@rinfectedbot"
"@ib" to "@rib"
"@tankbot" to "@rtankbot"
"@tb" to "@rtb"
- Added "FINALE_*" enums to the include file for use with the "L4D2_ChangeFinaleStage" and "L4D2_GetCurrentFinaleStage" natives and "L4D2_OnChangeFinaleStage" forward.
- Thanks to "Dragokas" for suggesting.
- GameData files, include file and plugins updated.
1.63 (15-Oct-2021)
- Changed all projectile natives to allow passing 0 (world) instead of a client index. Thanks to "BHaType" for reporting.
- Changed forward "L4D_OnGameModeChange" from "Action" type to "void". Thanks to "Psyk0tik" for reporting.
- Fixed commands "sm_l4dd_detours" and "sm_l4dhooks_detours" not showing all forwards when they have pre and post hooks.
- Added 11 new forwards to L4D1 and L4D2. Thanks to "Psyk0tik" for the suggestions, signatures and detour functions.
- "L4D_TankClaw_DoSwing_Pre" - When a tank is swinging to punch.
- "L4D_TankClaw_DoSwing_Post" - When a tank is swinging to punch.
- "L4D_TankClaw_GroundPound_Pre" - When an tank punches the ground.
- "L4D_TankClaw_GroundPound_Post" - When an tank punches the ground.
- "L4D_TankClaw_OnPlayerHit_Pre" - When a tank swings and punches a player.
- "L4D_TankClaw_OnPlayerHit_Post" - When a tank swings and punches a player.
- "L4D_TankRock_OnDetonate" - When a tank rock hits something.
- "L4D_TankRock_OnRelease" - When a tank rock is thrown.
- "L4D_PlayerExtinguish" - When a player is about to be extinguished.
- "L4D_PipeBombProjectile_Pre" - When a PipeBomb projectile is being created.
- "L4D_PipeBombProjectile_Post" - After a PipeBomb projectile is created.
- Added 1 new forward to L4D2. Thanks to "Lux" for the suggestion, signature and detour functions.
- "L4D2_MeleeGetDamageForVictim" - When calculating melee damage to inflict on something.
- GameData files, include file and plugins updated.
1.62 (08-Oct-2021)
- L4D1 Linux: Update thanks to "Forgetest" for writing.
- L4D1 Linux: Fixed issues with the forwards "L4D_OnShovedBySurvivor" and "L4D2_OnStagger". Thanks "HarryPotter" for reporting.
- L4D1 GameData file and plugin updated.
1.61 (05-Oct-2021)
- Added natives "L4D_GetTempHealth" and "L4D_SetTempHealth" to handle Survivors temporary health buffer.
- Added natives "L4D_PlayMusic" to play a specified music string to a client. Thanks to "DeathChaos25" and "Shadowysn" for "Dynamic Soundtrack Sets" plugin.
- Added natives "L4D_StopMusic" to stop playing a specified music string to a client. Thanks to "DeathChaos25" and "Shadowysn" for "Dynamic Soundtrack Sets" plugin.
- Moved the animation ACT_* enums from "include/left4dhooks.inc" to "include/left4dhooks_anim.inc". Suggested by "Accelerator". No plugin changes required.
- Thanks to "Psyk0tik" for requesting the following forwards and natives and their signatures found here: https://github.com/Psykotikism/L4D1-2_Signatures
- Added natives:
- "L4D2_HasConfigurableDifficultySetting" - Returns if there is a configurable difficulty setting.
- "L4D2_IsGenericCooperativeMode" - Returns if the current game mode is Coop/Realism mode.
- "L4D_IsCoopMode" - Returns if the current game mode is Coop mode.
- "L4D2_IsRealismMode" - Returns if the current game mode is Realism mode.
- "L4D2_IsScavengeMode" - Returns if the current game mode is Scavenge mode.
- "L4D_IsSurvivalMode" - Returns if the current game mode is Survival mode.
- "L4D_IsVersusMode" - Returns if the current game mode is Versus mode.
- Added forwards:
- "L4D_OnFalling" - Called when a player is falling.
- "L4D_OnFatalFalling" - Called when a player is falling in a fatal zone.
- "L4D2_OnPlayerFling" - Called when a player is flung to the ground.
- "L4D_OnEnterStasis" - Called when a Tank enters stasis mode in Versus mode.
- "L4D_OnLeaveStasis" - Called when a Tank leaves stasis mode in Versus mode.
- GameData files, include file and plugins updated.
1.60 (29-Sep-2021)
- Added native "L4D2_GrenadeLauncherPrj" to create an activated Grenade Launcher projectile which detonates on impact. L4D2 only.
- Fixed L4D1 Linux "MolotovProjectile_Create" signature. Thanks to "Ja-Forces" for reporting.
1.59 (29-Sep-2021)
- HotFix: Fix Linux not loading the last 2 natives.
1.58 (29-Sep-2021)
- Added native "L4D_MolotovPrj" to create an activated Molotov projectile which detonates on impact.
- Added native "L4D2_VomitJarPrj" to create an activated VomitJar projectile which detonates on impact. L4D2 only.
- Added "STATE_*" enums to the include file for use with the "L4D_State_Transition" native. Thanks to "BHaType" for providing.
- Fixed some incorrect information in the include file. Thanks to "jackz" for reporting.
- GameData files, include file and plugins updated.
1.57 (18-Sep-2021)
- Changed the method for getting the current GameMode. Should have no more issues. Thanks to "ddd123" for reporting.
- L4D2: Wildcarded the "CTerrorPlayer::Fling" signature for compatibility with being detoured. Thanks to "ddd123" for reporting.
- L4D2 GameData file and plugin updated.
1.56 (15-Sep-2021)
- Fixed spawning an entity directly OnMapStart (can cause crashes), delayed by a frame to fix errors. Thanks to "fdxx" for reporting.
1.55 (12-Sep-2021)
- Fixed native "L4D2Direct_TryOfferingTankBot" not working for L4D1 Linux due to the last update. Thanks to "Forgetest" for reporting.
- L4D1 gamedata file updated only.
1.54 (12-Sep-2021)
- Big thanks to "Forgetest" and "HarryPotter" for helping fix and test this release.
- Added forward "L4D_OnGameModeChange" to notify plugins when the mode has changed to Coop, Versus, Survival and Scavenge (L4D2).
- Added native "L4D_GetGameModeType" to return if the current game mode is Coop, Versus, Survival or Scavenge (L4D2).
- Update for L4D1:
- Fixed on Linux forward "L4D_OnSpawnWitch" from not triggering for some Witch spawns. Thanks to "Forgetest" for fixing.
- Fixed on Linux forward "L4D_OnTryOfferingTankBot" from not triggering on the first tank. Thanks to "Forgetest" for fixing.
- Unlocked native "L4D2Direct_GetMobSpawnTimer" for usage in L4D1. Thanks to "HarryPotter" for reporting functionality.
- Unlocked native "L4D2Direct_GetTankCount" for usage in L4D1. Missed this from the last update.
- L4D1 GameData file, include file and plugins updated.
1.53 (09-Sep-2021)
- Update for L4D1:
- Added forward "L4D_OnRecalculateVersusScore" from "raziEiL"'s port of "L4D Direct".
- Added natives "L4DDirect_GetSurvivorHealthBonus", "L4DDirect_SetSurvivorHealthBonus" and "L4DDirect_RecomputeTeamScores" from "raziEiL"'s port of "L4D Direct".
- Changed native "L4D2_GetTankCount" to use the directors variable instead of counting entities. Thanks to "Forgetest" for the offsets.
- Unblocked native "L4D_GetTeamScore" for usage in L4D1. Accepts logical_team params 1-6.
- Fixed forward "L4D_OnFirstSurvivorLeftSafeArea" not blocking correctly. Thanks to "Forgetest" for the solution.
- Various fixes and additions thanks to "HarryPotter" for requesting and testing.
- L4D1 GameData file, include file and plugins updated.
1.52 (31-Aug-2021)
- Added L4D1 and L4D2 specific "ACT_*" animation activity constants to the include file for usage in animation pre-hooks. See the include file for details.
- Wildcarded "RestartScenarioFromVote" detour to be compatible with the "[L4D2] Restart Without Changelevel" plugin by "iaNanaNana".
- Various minor changes to the code legibility.
- L4D2 GameData updated. Include file and plugins updated.
1.51 (10-Aug-2021)
- Added natives "L4D_GetCurrentChapter" and "L4D_GetMaxChapters" to get the current and max chapters count. Thanks to "Psyk0tik" for help.
- L4D1: added natives "L4D_GetVersusMaxCompletionScore" and "L4D_SetVersusMaxCompletionScore" to get/set Versus max score. Thanks to "BHaType" for offsets.
- L4D1: Fixed broken "CThrowActivate" signature due to the 1.0.4.0 update. Thank to "matrixmark" for reporting.
- GameData files, include file and plugins updated.
1.50 (22-Jul-2021)
- Fixed "Native was not found" errors in L4D1. Thanks to "xerox8521" for reporting.
- Test plugin: Fixed "L4D_OnMaterializeFromGhostPre" and "L4D_OnMaterializeFromGhost" throwing "String formatted incorrectly" errors.
1.49 (13-Jul-2021)
- L4D2: Fixed the "SpawnTimer" offset being wrong. Thanks to "Forgetest" for reporting.
- L4D2: GameData file updated.
1.48 (13-Jul-2021)
- Fixed "Param is not a pointer" in the "L4D_OnVomitedUpon" forward. Thanks to "ddd123" for reporting.
- L4D2: Changed the way "ForceNextStage" address is read on Windows, hopefully future proof.
- L4D2: GameData file updated.
1.47 (10-Jul-2021)
- Fixed "Trying to get value for null pointer" in the "L4D_OnVomitedUpon" forward. Thanks to "Shadowart" for reporting.
1.46 (09-Jul-2021)
- L4D2: Added native "L4D2_ExecVScriptCode" to exec VScript code instead of having to create an entity to fire code.
- L4D2: Fixed GameData file from the "2.2.2.0" game update.
1.45 (04-Jul-2021)
- Fixed bad description for "L4D_SetHumanSpec" and "L4D_TakeOverBot" in the Include file.
- L4D1: Fixed forward "L4D_OnVomitedUpon" crashing. GameData file updated. Thanks to "Crasher_3637" for reporting.
1.44 (01-Jul-2021)
- Fixed forward "L4D_OnMaterializeFromGhost" not firing. Thanks to "ProjectSky" for reporting.
- Fixed changelog description. Thanks to "Spirit_12" for reporting.
1.43 (01-Jul-2021)
- L4D1 & L4D2 update:
- Added forward "L4D_OnMaterializeFromGhostPre" and "L4D_OnMaterializeFromGhost" when a client spawns out of ghost mode. Thanks to "ProjectSky" and "sorallll" and for suggesting.
- Added native "L4D_RespawnPlayer" to respawn a dead player.
- Added native "L4D_SetHumanSpec" to takeover a bot.
- Added native "L4D_TakeOverBot" to takeover a bot.
- Added native "L4D_CanBecomeGhost" to determine when someone is about to enter ghost mode.
- Added native "L4D2_AreWanderersAllowed" to determine if Witches can wander.
- Added native "L4D_IsFinaleEscapeInProgress" to determine when the rescue vehicle is leaving until.
- Added native "L4D_GetLastKnownArea" to retrieve a clients last known nav area.
- Added missing "ACT_ITEM2_VM_LOWERED_TO_IDLE" to the "data/left4dhooks.l4d2.cfg" config.
- Updated: Plugin, Test plugin, Include file, GameData files and "data/left4dhooks.l4d2.cfg" config.
1.42 (23-Jun-2021)
- L4D1 & L4D2 update:
- Added forward "L4D_OnVomitedUpon" when client is covered in vomit.
- Added forward "L4D_OnEnterGhostStatePre" with the ability to block entering ghost state.
- Changed 2 signatures to be compatible with detouring: "CTerrorPlayer::OnStaggered" and "CTerrorPlayer::OnVomitedUpon".
- L4D2 update only:
- Added forward "L4D2_OnHitByVomitJar" when a Bilejar explodes on clients.
- Added native "L4D2_NavAreaTravelDistance" to return the nav flow distance between two areas.
- Added native "L4D2_UseAdrenaline" to give a player the Adrenaline effect and health benefits.
- Added various natives as wrappers executing VScript code:
- These are slower than native SDKCalls, please report popular ones to convert to fast SDKCalls.
"L4D2_VScriptWrapper_GetMapNumber"
"L4D2_VScriptWrapper_HasEverBeenInjured"
"L4D2_VScriptWrapper_GetAliveDuration"
"L4D2_VScriptWrapper_IsDead"
"L4D2_VScriptWrapper_IsDying"
"L4D2_VScriptWrapper_UseAdrenaline"
"L4D2_VScriptWrapper_ReviveByDefib"
"L4D2_VScriptWrapper_ReviveFromIncap"
"L4D2_VScriptWrapper_GetSenseFlags"
"L4D2_VScriptWrapper_NavAreaBuildPath"
"L4D2_VScriptWrapper_NavAreaTravelDistance" // Added as a demonstration and test, SDKCall is available, use "L4D2_NavAreaTravelDistance" instead.
- Updated: Plugin, Test plugin, GameData and Include file. Both L4D1 and L4D2.
- Thanks to "Eärendil" for showing me how to call some VScript functions.
1.41 (18-Jun-2021)
- L4D2: Fixed "InvulnerabilityTimer" offset. Thanks to "Nuki" for helping.
- GameData .txt file updated.
1.40 (16-Jun-2021)
- L4D2: Fixed various offsets breaking from "2.2.1.3" game update. Thanks to "Nuki" for reporting and helping.
- GameData .txt file updated.
1.39 (16-Jun-2021)
- Changed command "sm_l4dd_detours" results displayed to be read easier.
- L4D2: Fixed signatures breaking from "2.2.1.3" game update. Thanks to "Crasher_3637" for fixing.
- L4D2: Fixed "VanillaModeOffset" in Linux breaking from "2.2.1.3" game update. Thanks to "Accelerator74" for fixing.
- GameData .txt file updated.
1.38 (28-Apr-2021)
- Changed native "L4D2_IsReachable" to allow using team 2 and team 4.
1.37 (20-Apr-2021)
- Removed "RoundRespawn" being used, was for private testing, maybe a future native. Thanks to "Ja-Forces" for reporting.
1.36 (20-Apr-2021)
- Added optional forward "AP_OnPluginUpdate" from "Autoreload Plugins" by "Dragokas", to rescan required detours when loaded plugins change.
- Fixed native "L4D2Direct_GetFlowDistance" sometimes returning -9999.0 when invalid, now returns 0.0;
- Fixed native "L4D_FindRandomSpot" from crashing Linux servers. Thanks to "Gold Fish" for reporting and fixing and "Marttt" for testing.
- Restricted native "L4D2_IsReachable" client index to Survivor bots only. Attempts to find a valid bot otherwise it will throw an error. Thanks to "Forgetest" for reporting.
- Signatures compatibility with plugins detouring them. L4D1: "OnLedgeGrabbed", "OnRevived" and L4D2: "OnLedgeGrabbed". Thanks to "Dragokas" for providing.
- Updated: L4D1 GameData file.
- Updated: L4D2 GameData file.
- Updated: Plugin and Include file.
- Updated: Test plugin to reflect above changes.
1.35 (10-Apr-2021)
- Fixed native "L4D_GetTeamScore" error message when using the wrong team values. Thanks to "BHaType" for reporting.
- Restricted native "L4D2_IsReachable" client index to bots only. Attempts to find a valid bot otherwise it will throw an error. Thanks to "Forgetest" for reporting.
1.34 (23-Mar-2021)
- Added native "L4D_HasPlayerControlledZombies" to return if players can control infected. Thanks to "Spirit_12" for requesting.
- Thanks to "Crasher_3637" for the L4D1 signature.
- Fixed Linux detection accidentally being broken from version 1.17 update.
- Updated: L4D1 GameData file.
- Updated: L4D2 GameData file.
- Updated: Plugin and Include file.
- Updated: Test plugin to reflect above changes.
1.33a (04-Mar-2021)
- L4D1 GameData updated. Changes fixing "L4D2_OnEntityShoved" were missing from the previous update.
1.33 (02-Mar-2021)
- Changed forward "L4D2_OnEntityShoved" to trigger for all entities being shoved not just clients.
- Fixed forward "L4D2_OnEntityShoved" not working in L4D1. GameData file updated for L4D1.
- Fixed native "L4D_IsFirstMapInScenario" crashing in L4D1 from changes in version 1.30 update.
1.32 (23-Feb-2021)
- Changed native "L4D_GetRandomPZSpawnPosition" to accept client index of 0. Thanks to "Accelerator74" for reporting.
- Fixed target filters misspelling "incapped". Thanks to "Forgetest" for reporting.
1.31 (23-Feb-2021)
- Added Target Filters to target randomly. Requested by "Tonblader":
"@incappedsurvivors", "@is"
"@randomincappedsurvivor", "@ris"
"@randomsurvivor", "@rs"
"@randominfected", "@ri"
"@randomtank", "@rt"
"@incappedsurvivorbot", "@isb"
"@survivorbot", "@sb"
"@infectedbot", "@ib"
"@tankbot", "@tb"
- Fixed "L4D_GetPlayerSpawnTime" from returning the wrong value again. Thanks to "Forgetest" for reporting.
1.30 (15-Feb-2021)
- Fixed natives "L4D2_SetIntMeleeAttribute" and "L4D2_SetFloatMeleeAttribute" functions. Thanks to "bw4re" for reporting.
- Fixed native "L4D_GetPlayerSpawnTime" giving the wrong time. Thanks to "Forgetest" for reporting.
- Fixes by "Dragokas"
- Fixed native "L4D_IsFirstMapInScenario" call with SDKCall_Raw returned error in SM 1.11, L4D1. Thanks to "Crasher" for reporting, and "Rostu" for help.
- Fixed "ForceNextStage" signature (WIN).
- Updated: L4D2 GameData file.
- Updated: Plugin
1.29 (10-Oct-2020)
- Fixed "L4D_StaggerPlayer" not working with NULL_VECTOR. Thanks to "Zippeli" for reporting.
1.28 (09-Oct-2020)
- Added command "sm_l4dd_unreserve" to remove lobby reservation. Added for testing purposes but is functional.
- Fixed L4D1 GameData failing to find "g_pServer" address. Thanks to "Ja-Forces" for reporting.
- Fixed forward "L4D_OnFirstSurvivorLeftSafeArea" throwing errors about null pointer.
1.27 (05-Oct-2020)
- Fixed not loading in L4D1 due to recent changes. Thanks to "TiTz" for reporting.
1.26 (01-Oct-2020)
- L4D2: Fixed the new target filters not working correctly, now matches by modelname for Survivors instead of character netprop.
1.25 (01-Oct-2020)
- Added survivor specific target filters: @nick, @rochelle, @coach, @ellis, @bill, @zoey, @francis, @louis
- Added special infected target filters: @smokers, @boomers, @hunters, @spitters, @jockeys, @chargers
- Changed native "L4D2_GetMeleeWeaponIndex" to return -1 instead of throwing an error, due to melee being unavailable.
- Fixed melee weapon IDs being incorrect depending on which are enabled. Thanks to "iaNanaNana" for reporting.
- Updated the "data/left4dhooks.l4d2.cfg" config with latest "ACT_*" animation numbers.
1.24 (27-Sep-2020)
- Reverted change: native "L4D_GetTeamScore" now accepts values 1 and 2 again.
- Changed natives:
"L4D2Direct_GetVSTankFlowPercent", "L4D2Direct_SetVSTankFlowPercent", "L4D2Direct_GetVSTankToSpawnThisRound",
"L4D2Direct_SetVSTankToSpawnThisRound", "L4D2Direct_GetVSWitchFlowPercent", "L4D2Direct_SetVSWitchFlowPercent",
"L4D2Direct_GetVSWitchToSpawnThisRound" and "L4D2Direct_SetVSWitchToSpawnThisRound".
- Corrected natives "roundNumber" to consider "m_bAreTeamsFlipped" and "m_bInSecondHalfOfRound".
- Thanks to "devilesk" for native value clarification.
1.23 (27-Sep-2020)
- Update by "ProdigySim" to fix Addons Eclipse. Thank you!
- Updated: L4D2 GameData file.
1.22 (24-Sep-2020)
- Compatibility update for L4D2's "The Last Stand" update.
- Big thanks to "ProdigySim" for help updating various gamedata offsets and signatures.
- Added support for the 2 new melee weapons.
- Changed native "L4D_GetTeamScore" to accept values 0 and 1 which seems is the standard.
- Late loading with debug enabled now shows the g_pGameRules pointer.
- Moved hard coded Addon Eclipse offsets to gamedata.
1.21 (01-Sep-2020)
- Removed teleporting the old and new tank players when using "L4D_ReplaceTank" native.
1.20 (28-Aug-2020)
- Changed forward "L4D_OnEnterGhostState" hook from pre to post hook. Thanks to "Forgetest" for reporting.
- Fixed forward "L4D_OnShovedBySurvivor" client and target order being wrong. Thanks to "Forgetest" for reporting.
1.19 (27-Aug-2020)
- Fixed native "L4D2Direct_TryOfferingTankBot" from crashing the server. Thanks to "disawar1" for reporting.
1.18 (20-Aug-2020)
- Thanks to "Forgetest" for reporting the following issues and testing multiple fixes.
- Fixed natives using "L4D2CT_VersusStartTimer" from reading the incorrect address.
- Fixed native "L4D2_IsValidWeapon" returning false when the classname is missing "weapon_".
- Fixed address "g_pGameRules" being incorrect after certain map or mode changes, this broke the following natives:
"L4D2_GetVersusCompletionPlayer", "L4D_GetVersusMaxCompletionScore" and "L4D_SetVersusMaxCompletionScore".
- Note: native "L4D2_IsValidWeapon" and various "*WeaponAttribute" natives still returns invalid for CSS weapons.
This only happens on the servers first load until map is changed and the CSS weapons are precached using whichever method
your server uses to enable CSS weapons. Plugins using or modifying CSS weapons might need to be updated with this in mind.
1.17 (20-Jul-2020)
- Added native (L4D2 only): "L4D2_IsReachable" to check if a position is accessible to a Survivor Bot.
- Fixed include native "L4D2_AreTeamsFlipped" returning an int instead of bool. Thanks to "BloodyBlade" for reporting.
- Fixed native "L4D_GetHighestFlowSurvivor" throwing errors in 1.11. Thanks to "yuzumi" for reporting.
- Removed some useless "view_as" code. Might remove more in the future.
- Updated: L4D2 GameData file.
- Updated: Plugin and Include file.
- Updated: Test plugin to reflect above changes.
1.16a (16-Jun-2020)
- Fixed using the wrong offset for "m_PendingMobCount". Thanks to "fbef0102" for reporting.
- Updated: GameData file for L4D2 Linux only.
1.16 (05-Jun-2020)
- Added native "L4D_LobbyUnreserve" finally, to support "Remove Lobby Reservation (When Full)" plugin.
- Huge thanks to "GAMMACASE" and "Deathreus" for helping figure why the native was crashing.
- L4D1: GameData updated to support this native.
- Updated: L4D1 GameData file.
- Updated: Plugin and Include file.
1.15 (15-May-2020)
- Added a valid entity check for "L4D2_OnFindScavengeItem" due to so many plugins passing bad entities and throwing errors.
- Fixed "L4D_Dissolve" native description in the include file. Thanks to "Psyk0tik" for reporting.
1.14 (10-May-2020)
- Added native (L4D2 only): "L4D2Direct_GetScriptedEventManager" to return the scripted event manager pointer.
- This native replicates "L4D2_GetCDirectorScriptedEventManager" used by other plugins.
- Added 19 missing natives from L4D2Direct (L4D1 and L4D2):
- "CTimer_Reset", "CTimer_Start", "CTimer_Invalidate", "CTimer_HasStarted", "CTimer_IsElapsed", "CTimer_GetElapsedTime", "CTimer_GetRemainingTime",
- "CTimer_GetCountdownDuration", "ITimer_Reset", "ITimer_Start", "ITimer_Invalidate", "ITimer_HasStarted", "ITimer_GetElapsedTime",
- "CTimer_GetDuration", "CTimer_SetDuration", "CTimer_GetTimestamp", "CTimer_SetTimestamp", "ITimer_GetTimestamp", "ITimer_SetTimestamp"
- Fixed "L4D_OnTryOfferingTankBot" not returning a valid client index.
- Thanks to "Mis" for requesting changes and reporting bugs.
- Updated: Plugin and Include file.
- Updated: Test plugin to reflect above changes.
1.13 (05-May-2020)
- Added better error log message when gamedata file is missing.
- Fixed "L4D2_OnEntityShoved" not detecting the last client. Thanks to "Addie" for reporting.
- Made all natives optional from the include file. Thanks to "Crasher_3637" for requesting.
- Optional natives can be set by plugins with "#undef REQUIRE_PLUGIN" before "#include <left4dhooks>" and "#define REQUIRE_PLUGIN" after.
- Updated: Plugin and Include file.
- Updated: Test plugin to reflect above changes.
1.12 (09-Apr-2020)
- Added commands "sm_l4dd_detours" and "sm_l4dd_reload" as wrappers to "sm_l4dhooks_detours" and "sm_l4dhooks_reload".
- Fixed command "sm_l4dhooks_detours" displaying the wrong forward, now also displays the plugin name using that forward.
1.11 (18-Mar-2020)
- Added command "sm_l4dhooks_detours" to display which forwards are enabled.
- Added missing natives: "L4D2Direct_GetPendingMobCount" and "L4D2Direct_SetPendingMobCount" from "raziEiL"'s port.
- Fixed native "L4D2_GetVScriptOutput" using the provided buffer to execute code. Buffer now can be small to get small return values.
- Optimized native "L4D2_GetVScriptOutput" to reuse the same entity for multiple calls in the same frame.
- Maximum native "L4D2_GetVScriptOutput" code allowed seems to be 1006 characters.
- Updated: Plugin, Include and GameData files.
- Updated: Test plugin to reflect above changes.
1.10 (14-Mar-2020)
- Added natives (L4D1 & L4D2): "L4D_IsAnySurvivorInStartArea", "L4D_IsInFirstCheckpoint" and "L4D_IsInLastCheckpoint".
- Added native (L4D2 only): "L4D2_GetCurrentFinaleStage".
- Thanks to "Nuki" for requesting.
- Fixed missing "L4D2IWA_ClipSize" offset. Now this works: L4D2_SetIntWeaponAttribute("weapon_rifle", L4D2IWA_ClipSize, 100);
- See include for details.
- Updated: Plugin, Include and GameData files.
- Updated: Test plugin to reflect above changes.
1.9 (10-Mar-2020)
- Added native (L4D2 only): "L4D2_GetVScriptOutput" to execute VScript code and get return data.
- This is modified from an example script I published on 29-Jun-2019: https://forums.alliedmods.net/showthread.php?t=317145
- Added new natives (L4D2 only): "L4D2_ForceNextStage", "L4D2_IsTankInPlay" and "L4D2_GetFurthestSurvivorFlow"
- Added new natives (L4D1 & L4D2): "L4D_HasAnySurvivorLeftSafeArea" and "L4D_IsAnySurvivorInCheckpoint".
- See the "NATIVES - Silvers" section inside the include file for details.
- Thanks to "Nuki" for requesting.
- Updated: Plugin, Include and GameData files.
- Updated: Test plugin to reflect above changes.
1.8 (08-Mar-2020)
- Added AutoExecConfig to generate a cvars config saved to "cfgs/sourcemod/left4dhooks.cfg".
- Loads signatures in "OnPluginStart" except "g_pGameRules" which can only load in "OnMapStart".
- Thanks to "Accelerator74" for requesting and testing.
- Fixed some wrong return types in the include file.
- Updated: Plugin and Include file.
1.7 (04-Mar-2020)
- Added natives "L4D_GetNearestNavArea" and "L4D_FindRandomSpot" to get a random spawn position.
- Fixed native "L4D2Direct_GetFlowDistance" sometimes causing server crashes.
- Fixed natives "L4D_IsFirstMapInScenario" and "L4D_IsMissionFinalMap" sometimes returning incorrect values. Thanks to "Accelerator74".
- Updated: Plugin, Include and GameData files.
- Updated: Test plugin to reflect above changes.
1.6 (02-Mar-2020)
- Fixed the animation hook throwing an "Exception reported: Client is not connected" error.
Thanks to "Accelerator74" for reporting:
- Fixed Addons Disabler "l4d2_addons_eclipse" not working without any plugins using the forward to detour.
- Fixed "L4D2Direct_GetVSWitchFlowPercent" and "L4D2Direct_SetVSWitchFlowPercent" natives.
1.5 (29-Feb-2020)
- Added Director Variables to be rechecked:
- Some of these only work in the Finale, some may only work outside of the Finale. L4D2 is weird.
"SmokerLimit", "BoomerLimit", "HunterLimit", "SpitterLimit", "JockeyLimit", "ChargerLimit", "TankLimit",
"DominatorLimit", "WitchLimit" and "CommonLimit".
Challenge Mode variables, if required:
"cm_MaxSpecials", "cm_BaseSpecialLimit", "cm_SmokerLimit", "cm_BoomerLimit", "cm_HunterLimit", "cm_SpitterLimit",
"cm_JockeyLimit", "cm_ChargerLimit", "cm_TankLimit", "cm_DominatorLimit", "cm_WitchLimit" and "cm_CommonLimit".
- Added Target Filters (thanks to "hoanganh810972" for reporting as missing):
Survivors: "@s", "@surv", "@survivors"
Specials: "@i", "@infe", "@infected"
Tanks: "@t", "@tank", "@tanks"
- Fixed native "L4D_CreateRescuableSurvivors" from not working. Now spawns all dead survivors into rescuable rooms.
- Removed "L4D_OnGetRandomPZSpawnPosition" forward due to spawning specials at 0,0,0 when modifying any value.
- Updated: Plugin, Include and GameData files.
- Updated: Test plugin to reflect above changes.
1.4 (28-Feb-2020)
- AnimHooks no longer affect the same client index if the previous user disconnected and someone else connected.
- Clarified AnimHooks details in the include file. All AnimHooks are removed on map change.
- Fixed L4D1: "Invalid Handle" errors caused by Director Variables fix. Thanks to "TiTz" for reporting.
1.3 (27-Feb-2020)
- Added forward "L4D_OnGetRandomPZSpawnPosition" to display when the game selects a position.
- Added native "L4D_GetRandomPZSpawnPosition" to select a random position.
- Thanks to "Accelerator74" for requesting.
- Added forward "L4D2_OnSelectTankAttackPre" to handle "ACT_*" activity numbers.
- Changed "L4D2_OnSelectTankAttack" to use "m_nSequence" numbers instead, just like the extension did.
- Changed the "AnimHook" functions to use "ACT_*" activity numbers (pre-hook) and "m_nSequence" animation number (post-hook).
- Existing plugins using "L4D2_OnSelectTankAttack" no longer need to change anything.
- Existing plugins with the new "AnimHook" hook can now use normal model "m_nSequence" sequence numbers in the post hook.
- Thanks to "Accelerator74" for reporting the fix.
- Updated: Plugin, Include and GameData files.
- Updated: Test plugin to demonstrate each change.
1.2 (27-Feb-2020)
- Wildcarded the following signatures to be compatible with 3rd party plugin detours:
- L4D2: "ChooseVictim", "GetSurvivorSet" and "ChangeFinaleStage".
- Thanks to "xZk" for reporting.
1.1 (27-Feb-2020)
- Added 26 new natives to L4D2 and 15 to L4D1 from "l4d2addresses.txt". Thanks to "Nuki" for suggesting.
- See the "NATIVES - l4d2addresses.txt" section inside the include file for details.
- Added 7 new natives to L4D2 and 5 to L4D1 from my plugins.
- See the "NATIVES - Silvers" section inside the include file for details.
- Fixed "L4D2_OnEndVersusModeRound" forwards triggering more than once per round. Thanks to "spumer" for reporting.
- Fixed creating forwards and natives in the wrong place. Thanks to "Accelerator74" for reporting.
- Fixed some signatures failing when other plugins detour them. Thanks to "hoanganh810972" for reporting.
- Fixed cvar "l4d2_addons_eclipse" - values 0 and 1 now disable/enable addons unless otherwise handled.
- Fixed not forwarding some Director Variables that were initialized too early. Thanks to "hoanganh81097" for reporting.
- Thanks to "Spirit_12" for ideas with the Director Variables fix.
- Removed unused actions from some forwards.
- Updated: Plugin, Include and GameData files.
1.0 (24-Feb-2020)
- Initial release.
Compiling/Updating Plugins:
For plugins changing from "left4downtown" or those using "l4d2_direct":
Replace include line: "<left4downtown>" with "<left4dhooks>"
Replace "<l4d2_direct>" with "<left4dhooks>" or remove line if already replacing "<left4downtown>" with "<left4dhooks>"
I remember when you actually took charge to start this project. Great to see it come to fruition. I feel like this need to be a revolving plugin with updates based on new natives.
Wait you actually implemented IsTeamFull native ? That's huge.
Just gonna leave this here for now. I didn't have time to test and don't want to create a whole thread without testing. Feel free to try it out.
This is just a tiny plugin to showcase the L4D_OnLedgeGrabbed forward. Pretty much it allows you to control if a survivor will grab onto the ledge when they are being smoked or jocked.
Code:
"l4d2_lc", "1", "On/Off for the plugin.
"l4d2_lc_jockey", "1", "On/Off switch for Jockey ledge grab"
"l4d2_lc_smoker", "1", "On/Off switch for Smoker ledge grab"
But the creation of natives and forwards is better to transfer to the function AskPluginLoad2. otherwise we get something like this:
Code:
L 02/25/2020 - 12:03:02: [SM] Unable to load plugin "l4d_scorefixesfinale.smx": Native "L4D_IsMissionFinalMap" was not found
L 02/25/2020 - 12:03:02: [SM] Unable to load plugin "l4d2_match_start.smx": Native "L4D_RestartScenarioFromVote" was not found
L 02/25/2020 - 12:03:02: [SM] Unable to load plugin "bossfixes.smx": Native "L4D2_SetVersusTankFlowPercent" was not found
L 02/25/2020 - 12:03:02: [SM] Unable to load plugin "CmdBalance.smx": Native "L4D2_SetVersusCampaignScores" was not found
L 02/25/2020 - 12:03:02: [SM] Unable to load plugin "TwoTanks.smx": Native "L4D2Direct_GetMapMaxFlowDistance" was not found