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)
"@sip" // 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 - Lots of fixes, additions, requests and suggestions.
Psyk0tik - Various signatures, requests and suggestions.
BHaType - Various offsets, requests and suggestions.
Marttt - Various plugins and testing.
A1m` - Various changes to the code.
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 = 147 & L4D2 = 216)
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]);
// L4D2 only. Called when a Witch Bride spawns
forward void L4D2_OnSpawnWitchBride_PostHandled(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);
// This happens when player is looking to take over a bot
forward Action L4D_OnTakeOverBot(int client);
// This happens when player is looking to take over a bot
forward void L4D_OnTakeOverBot_Post(int client, bool success);
// This happens when player is looking to take over a bot
forward void L4D_OnTakeOverBot_PostHandled(int client, bool success);
// 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 void 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 void L4D_OnMaterializeFromGhost_PostHandled(int client);
// Called whenever CDirector::OnFinishIntro is invoked
forward void L4D_OnFinishIntro();
// 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);
// Triggers after round start when Survivors are forced into starting positions, usually first map and finale escape start, does not trigger on all maps
forward void L4D_OnForceSurvivorPositions_Pre();
// Triggers after round start when Survivors are forced into starting positions, usually first map and finale escape start, does not trigger on all maps
forward void L4D_OnForceSurvivorPositions();
// Triggers after round start when Survivors are released from the starting positions, usually first map and finale escape start, does not trigger on all maps
forward void L4D_OnReleaseSurvivorPositions();
// Triggers on concept talking
forward void L4D_OnSpeakResponseConcept_Pre(int entity);
// Triggers on concept talking
forward void L4D_OnSpeakResponseConcept_Post(int entity);
// 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. Called whenever CSquirrelVM::GetValue() is invoked
forward Action L4D2_OnGetScriptValueVoid(const char[] key, fieldtype_t &type, VariantBuffer retVal, int hScope);
// L4D2 only. Called whenever CSquirrelVM::GetValue() is invoked
forward Action L4D2_OnGetScriptValueInt(const char[] key, int &retVal, int hScope);
// L4D2 only. Called whenever CSquirrelVM::GetValue() is invoked
forward Action L4D2_OnGetScriptValueFloat(const char[] key, float &retVal, int hScope);
// L4D2 only. Called whenever CSquirrelVM::GetValue() is invoked
forward Action L4D2_OnGetScriptValueVector(const char[] key, float retVal[3], int hScope);
// 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);
// When a player loses tank control and is replaced by another player. 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, const float vecPos[3], const float vecAng[3], const float vecVel[3], const float vecRot[3]);
// When a tank rock touches an entity to bounce
forward Action L4D_TankRock_BounceTouch(int tank, int rock, int entity);
// When a tank rock touches an entity to bounce
forward void L4D_TankRock_BounceTouch_Post(int tank, int rock, int entity);
// When a tank rock touches an entity to bounce
forward void L4D_TankRock_BounceTouch_PostHandled(int tank, int rock, int entity);
// 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);
// L4D2 only. Called when a player uses his melee weapons primary attack
forward void L4D_OnStartMeleeSwing_PostHandled(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 whenever CTerrorPlayer::DoAnimationEvent is invoked
forward Action L4D_OnDoAnimationEvent(int client, int &event, int &variant_param);
// Called whenever CTerrorPlayer::DoAnimationEvent is invoked
forward void L4D_OnDoAnimationEvent_Post(int client, int event, int variant_param);
// Called whenever CTerrorPlayer::DoAnimationEvent is invoked
forward void L4D_OnDoAnimationEvent_PostHandled(int client, int event, int variant_param);
// 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);
// L4D2 only. Called when the director stage changes
forward void L4D2_OnChangeFinaleStage_PostHandled(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, const 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, const float vecDir[3], bool bIsHighPounce);
// Source is always null for Charger impacts (Valve)
forward Action L4D2_OnStagger(int client, int source);
// Source is always null for Charger impacts (Valve)
forward void L4D2_OnStagger_Post(int client, 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 client, int source);
// Called when a players staggering is about to be cancelled
forward Action L4D_OnCancelStagger(int client);
// Called when a players staggering is being cancelled
forward void L4D_OnCancelStagger_Post(int client);
// Called when a players staggering has not been cancelled
forward void L4D_OnCancelStagger_PostHandled(int client);
// 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, const 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, const float vecDir[3]);
// Called when a player is staggering or a Hunter has been knocked off someone
forward Action L4D_OnMotionControlledXY(int client, int activity);
// 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);
// Called when a player is coughing, most likely from Smoker Cloud, but possibly called by other plugins
forward Action L4D_OnPlayerCough(int client, int attacker);
// Called when a player is coughing, most likely from Smoker Cloud, but possibly called by other plugins
forward void L4D_OnPlayerCough_Post(int client, int attacker);
// Called when a player is coughing, most likely from Smoker Cloud, but possibly called by other plugins
forward void L4D_OnPlayerCough_PostHandled(int client, int attacker);
// Called when a player is about to be incapacitated
forward Action L4D_OnIncapacitated(int client, int &inflictor, int &attacker, float &damage, int &damagetype);
// Called when a player is about to be incapacitated
forward void L4D_OnIncapacitated_Post(int client, int inflictor, int attacker, float damage, int damagetype);
// Called when a player is about to be incapacitated
forward void L4D_OnIncapacitated_PostHandled(int client, int inflictor, int attacker, float damage, int damagetype);
// Called when a player dies, listing their currently held weapons and objects that are being dropped
forward void L4D_OnDeathDroppedWeapons(int client, int weapons[6]);
// Molotov and Spitter fire/goo spread
forward Action L4D2_OnSpitSpread(int spitter, int projectile, float &x, float &y, float &z);
// Called when a player (Survivor or Special Infected) is about to be extinguished
forward Action L4D_PlayerExtinguish(int client);
// 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_Pre(int specialInfected, int &lastTarget);
// 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);
// 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 starting to be ridden by a Jockey
forward void L4D2_OnJockeyRide_PostHandled(int victim, int attacker);
// Called when a Survivor is slammed into a wall by a Charger, or on the first pummel if bWallSlam is 0
forward Action L4D2_OnSlammedSurvivor(int victim, int attacker, bool &bWallSlam, bool &bDeadlyCharge);
// Called when a Survivor is slammed into a wall by a Charger, or on the first pummel if bWallSlam is 0
forward void L4D2_OnSlammedSurvivor_Post(int victim, int attacker, bool bWallSlam, bool bDeadlyCharge);
// Called when a Survivor is slammed into a wall by a Charger, or on the first pummel if bWallSlam is 0
forward void L4D2_OnSlammedSurvivor_PostHandled(int victim, int attacker, bool bWallSlam, bool bDeadlyCharge);
// 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 Survivor player is starting to be carried by a Charger
forward void L4D2_OnStartCarryingVictim_PostHandled(int victim, int attacker);
// Called when a Charger impacts a wall or object after charging, but not when carrying a Survivor
forward void L4D2_OnChargerImpact(int client);
// 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 Special Infected is hit from a Bilejar explosion
forward void L4D2_OnHitByVomitJar_PostHandled(int victim, int attacker);
// Called when a common infected or Witch is hit from a Bilejar explosion and possibly boomer explosion
forward Action L4D2_Infected_HitByVomitJar(int victim, int &attacker);
// Called when a common infected or Witch is hit from a Bilejar explosion and possibly boomer explosion
forward void L4D2_Infected_HitByVomitJar_Post(int victim, int attacker);
// Called when a common infected or Witch is hit from a Bilejar explosion and possibly boomer explosion
forward void L4D2_Infected_HitByVomitJar_PostHandled(int victim, int attacker);
// Called when a Molotov projectile is being created
forward Action L4D_MolotovProjectile_Pre(int client, float vecPos[3], float vecAng[3], float vecVel[3], float vecRot[3]);
// Called when a Molotov projectile has been created
forward void L4D_MolotovProjectile_Post(int client, int projectile, const float vecPos[3], const float vecAng[3], const float vecVel[3], const float vecRot[3]);
// Called when a Molotov projectile has been blocked
forward void L4D_MolotovProjectile_PostHandled(int client, int projectile, const float vecPos[3], const float vecAng[3], const float vecVel[3], const float vecRot[3]);
// 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, const float vecPos[3], const float vecAng[3], const float vecVel[3], const float vecRot[3]);
// Called when a PipeBomb projectile has been blocked
forward void L4D_PipeBombProjectile_PostHandled(int client, int projectile, const float vecPos[3], const float vecAng[3], const float vecVel[3], const float vecRot[3]);
// Called when a VomitJar projectile is being created
forward Action L4D2_VomitJarProjectile_Pre(int client, float vecPos[3], float vecAng[3], float vecVel[3], float vecRot[3]);
// Called when a VomitJar projectile has been created
forward void L4D2_VomitJarProjectile_Post(int client, int projectile, const float vecPos[3], const float vecAng[3], const float vecVel[3], const float vecRot[3]);
// Called when a VomitJar projectile has been blocked
forward void L4D2_VomitJarProjectile_PostHandled(int client, int projectile, const float vecPos[3], const float vecAng[3], const float vecVel[3], const float vecRot[3]);
// Called when a Grenade Launcher projectile is being created
forward Action L4D2_GrenadeLauncherProjectile_Pre(int client, float vecPos[3], float vecAng[3], float vecVel[3], float vecRot[3], bool &bIncendiary);
// Called when a Grenade Launcher projectile has been created
forward void L4D2_GrenadeLauncherProjectile_Post(int client, int projectile, const float vecPos[3], const float vecAng[3], const float vecVel[3], const float vecRot[3], bool bIncendiary);
// Called when a Grenade Launcher projectile has been blocked
forward void L4D2_GrenadeLauncherProjectile_PostHandled(int client, int projectile, const float vecPos[3], const float vecAng[3], const float vecVel[3], const float vecRot[3], bool bIncendiary);
// Called when a Molotov projectile is about to explode
forward Action L4D_Molotov_Detonate(int entity, int client);
// Called when a Molotov projectile has exploded
// This forward will not trigger if the relative pre-hook forward has been blocked with Plugin_Handled
forward void L4D_Molotov_Detonate_Post(int entity, int client);
// Called when a Molotov projectile explosion was prevented
// This forward will ONLY trigger if the relative pre-hook forward has been blocked with Plugin_Handled
forward void L4D_Molotov_Detonate_PostHandled(int entity, int client);
// Called when a PipeBomb projectile (or possibly a breakable prop, see include file notes below) is about to explode
forward Action L4D_PipeBomb_Detonate(int entity, int client);
// Called when a PipeBomb projectile (or possibly a breakable prop, see include file notes below) has exploded
// This forward will not trigger if the relative pre-hook forward has been blocked with Plugin_Handled
forward void L4D_PipeBomb_Detonate_Post(int entity, int client);
// Called when a PipeBomb projectile explosion (or possibly a breakable prop, see include file notes below) was prevented
// This forward will ONLY trigger if the relative pre-hook forward has been blocked with Plugin_Handled
forward void L4D_PipeBomb_Detonate_PostHandled(int entity, int client);
// L4D2 only. Called when a VomitJar projectile is about to explode
forward Action L4D2_VomitJar_Detonate(int entity, int client);
// L4D2 only. Called when a VomitJar projectile is about to explode
// This forward will not trigger if the relative pre-hook forward has been blocked with Plugin_Handled
forward void L4D2_VomitJar_Detonate_Post(int entity, int client);
// Called when a VomitJar projectile is about to explode
// This forward will ONLY trigger if the relative pre-hook forward has been blocked with Plugin_Handled
forward void L4D2_VomitJar_Detonate_PostHandled(int entity, int client);
// Called when a Grenade Launcher projectile is about to explode
forward Action L4D2_GrenadeLauncher_Detonate(int entity, int client);
// L4D2 only. Called when a Grenade Launcher projectile is about to explode
// This forward will not trigger if the relative pre-hook forward has been blocked with Plugin_Handled
forward void L4D2_GrenadeLauncher_Detonate_Post(int entity, int client);
// Called when a Grenade Launcher projectile is about to explode
// This forward will ONLY trigger if the relative pre-hook forward has been blocked with Plugin_Handled
forward void L4D2_GrenadeLauncher_Detonate_PostHandled(int entity, int client);
// 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);
// L4D2 only. Called when Spitter Acid is determining if a client or entity can be damaged
forward void L4D2_CInsectSwarm_CanHarm_PostHandled(int acid, int spitter, int entity);
// Called when a physics prop is broken
forward void L4D_CBreakableProp_Break(int prop, int entity);
// L4D1 only. Called when a player is using a first aid kit to heal
forward Action L4D1_FirstAidKit_StartHealing(int client, int entity);
// L4D1 only. Called when a player is using a first aid kit to heal
forward void L4D1_FirstAidKit_StartHealing_Post(int client, int entity);
// L4D1 only. Called when a player is using a first aid kit to heal
forward void L4D1_FirstAidKit_StartHealing_PostHandled(int client, int entity);
// Called when a player is holding an item and about to use it
forward Action L4D2_OnStartUseAction(any action, int client, int target);
// Called when a player is holding an item and about to use it
forward void L4D2_OnStartUseAction_Post(any action, int client, int target);
// Called when a player is holding an item and about to use it
forward void L4D2_OnStartUseAction_PostHandled(any action, int client, int target);
// L4D2 only. Called when a player is using an item and about to use it
forward Action L4D2_BackpackItem_StartAction(int client, int entity, any type);
// L4D2 only. Called when a player is using an item and about to use it
forward void L4D2_BackpackItem_StartAction_Post(int client, int entity);
// L4D2 only. Called when a player is using an item and about to use it
forward void L4D2_BackpackItem_StartAction_PostHandled(int client, int entity);
// L4D2 only. Called when a gascan is broken
forward Action L4D2_CGasCan_EventKilled(int gascan, int &inflictor, int &attacker);
// L4D2 only. Called when a gascan is broken
forward void L4D2_CGasCan_EventKilled_Post(int gascan, int inflictor, int attacker);
// L4D2 only. Called when a gascan is broken
forward void L4D2_CGasCan_EventKilled_PostHandled(int gascan, int inflictor, int attacker);
// L4D2 only. Called when someone is about to pour a gascan into a nozzle
forward Action L4D2_CGasCan_ShouldStartAction(int client, int gascan, int nozzle);
// L4D2 only. Called when someone is about to pour a gascan into a nozzle
forward void L4D2_CGasCan_ShouldStartAction_Post(int client, int gascan, int nozzle);
// L4D2 only. Called when someone is about to pour a gascan into a nozzle
forward void L4D2_CGasCan_ShouldStartAction_PostHandled(int client, int gascan, int nozzle);
// 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);
// L4D2 only. Called when someone completes pouring a gascan into a nozzle
forward void L4D2_CGasCan_ActionComplete_PostHandled(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);
Natives: (L4D1 = 173 & L4D2 = 274)
Spoiler
PHP Code:
// ====================
// Animation Hook
// View the data folder cfgs for a list of Activity strings and their related sequence numbers
// View the include "left4dhooks_anim.inc" 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);
// Precaches a particle effect
native void L4D_PrecacheParticle(const char[] sEffectName);
// This triggers OnUser1 and FireUser1 etc using the AcceptEntityInput method to "Kill" an entity
native void L4D_RemoveEntityDelay(int entity, float time, int user = 4);
// Returns the address pointer to various internal game objects
native Address L4D_GetPointer(PointerType ptr_type);
// Returns a client index from a memory address
native int L4D_GetClientFromAddress(Address addy);
// Returns an entity index from a memory address
native int L4D_GetEntityFromAddress(Address addy);
// Returns a string read from a memory address
native int L4D_ReadMemoryString(Address addy, char[] buffer, int maxlength);
// Returns the servers operating system
native int L4D_GetServerOS();
// Returns the Left4DHooks version number. For example version "1.122" is 1122
native int Left4DHooks_Version();
// Checks if the map and addresses are loaded that some natives rely on
native bool L4D_HasMapStarted();
// L4D2 only. Returns an entities script scope (HSCRIPT)
native int L4D2_GetScriptScope(int entity);
// L4D2 only. Creates or uses an existing "logic_script" entity that is created by Left4DHooks
native int L4D2_GetVScriptEntity();
// 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);
// Returns the worldspace center of an entity
native int L4D_GetEntityWorldSpaceCenter(int entity, float vecPos[3]);
// 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 any L4D_GetNearestNavArea(const float vecPos[3], float maxDist = 300.0, bool anyZ = false, bool checkLOS = false, bool checkGround = false, int teamID = 2);
// Returns the nav address of the last known area
native any L4D_GetLastKnownArea(int client);
// Returns if an entity is touching a trigger
native bool L4D_IsTouchingTrigger(int trigger, int entity);
// L4D2 only. Gets the first Special Infected type the Director will spawn. Value set on map start
native int L4D2_GetFirstSpawnClass();
// L4D2 only. Sets the first Special Infected type the Director will spawn
native void L4D2_SetFirstSpawnClass(int zombieClass);
// 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]);
// L4D2 only. Checks if a player is visible to a specified position. Should be slightly faster than using TR_TraceRayFilterEx
native bool L4D2_IsVisibleToPlayer(int client, int team, int team_target, int NavArea, float vecPos[3]);
// Teleports a player to a valid position if they are stuck
native void L4D_WarpToValidPositionIfStuck(int client);
// 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 all survivors are in the finale area
native bool L4D_AreAllSurvivorsInFinaleArea();
// 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 true when a given vector is within the starting checkpoint area
native bool L4D_IsPositionInFirstCheckpoint(float vecPos[3]);
// Returns true when a given vector is within the ending checkpoint area
native bool L4D_IsPositionInLastCheckpoint(float vecPos[3]);
// 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();
// 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);
// L4D2 only. 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_NavAreaBuildPath(Address nav_startPos, Address nav_endPos, float flMaxPathLength, int teamID, bool ignoreNavBlockers);
// L4D2 only. Uses the VScript "CommandABot" function to command a bot to attack, move, retreat or reset previous command
native bool L4D2_CommandABot(int entity, int target, BOT_CMD type, float vecPos[3] = NULL_VECTOR);
// Returns if players can control infected
native bool L4D_HasPlayerControlledZombies();
// 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], const float vecVel[3] = NULL_VECTOR);
// Gives the player adrenaline effect and health benefits
native void L4D2_UseAdrenaline(int client, float fTime = 15.0, bool heal = true, bool event = 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);
// Set a dead Special Infected players time until they transition into ghost state. Can be used when the "ghost_spawn_time" event triggers
native void L4D_SetBecomeGhostAt(int client, float time);
// Sets a client as idle, afk - away from keyboard
native bool L4D_GoAwayFromKeyboard(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 any L4D2_GetCurrentFinaleStage();
// L4D2 only. Forces the ScriptedMode stage to advance to the next stage
native void L4D2_ForceNextStage();
// Returns the Survival setup countdown time before start (director_survival_setup_time must be non-0)
native int L4D2_GetSurvivalStartTime();
// Sets the Survival countdown time before start
native void L4D2_SetSurvivalStartTime(int time);
// 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();
// Revive a dead player by defib, players the getting up animation
native void L4D2_DefibByDeadBody(int client, int reviver, bool nopenalty);
// L4D2 only. Returns the directors script scope handle
native int L4D2_GetDirectorScriptScope(int level);
// L4D2 only. Returns the value of the specified Director Variable key
native int L4D2_GetScriptValueInt(const char[] key, int value);
// L4D2 only. Returns the value of the specified Director Variable key
native float L4D2_GetScriptValueFloat(const char[] key, float 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);
// 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 any L4D2_VScriptWrapper_GetSenseFlags(int client);
// 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();
// Spawns all Scavenge gascans in the map
native void L4D2_SpawnAllScavengeItems();
// L4D2 only. Get the remaining spawn time for an SI
native float L4D_GetPlayerSpawnTime(int player);
// Set the remaining spawn time for a SI
native void L4D_SetPlayerSpawnTime(int player, float time, bool bReportToPlayer = true);
// 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);
// Set the current campaign scores stored in the Director
native void L4D_SetCampaignScores(int scoreA, int scoreB);
// 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(bool anyMap = false);
// 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();
// Returns if the intro cutscene is playing
native int L4D_IsInIntro();
// Returns all TheNavAreas addresses
native void L4D_GetAllNavAreas(ArrayList aList);
// Returns a given NavArea's ID from it's address
native int L4D_GetNavAreaID(Address area);
// Returns a given NavArea address from it's ID
native Address L4D_GetNavAreaByID(int id);
// Returns origin of a given NavArea
native void L4D_GetNavAreaPos(Address area, float vecPos[3]);
// Returns center of a given NavArea
native void L4D_GetNavAreaCenter(Address area, float vecPos[3]);
// Returns size of a given NavArea
native void L4D_GetNavAreaSize(Address area, float vecSize[3]);
// Returns true if this area is connected to other area in given direction. (If you set direction to -1 or 4, it will automatically check all directions for a connection)
native bool L4D_NavArea_IsConnected(Address area1, Address area2, int direction);
// Returns the nav area attribute flags
native int L4D_GetNavArea_AttributeFlags(Address pTerrorNavArea);
// Sets the nav area attribute flags
native void L4D_SetNavArea_AttributeFlags(Address pTerrorNavArea, int flags);
// Returns the terror nav area attribute flags
native int L4D_GetNavArea_SpawnAttributes(Address pTerrorNavArea);
// Sets the terror nav area attribute flags
native void L4D_SetNavArea_SpawnAttributes(Address pTerrorNavArea, int flags);
// 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]);
// ====================
// 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 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 any 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, int variant_param = 0);
// 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);
// Finds the Use client/entity if available
native int L4D_FindUseEntity(int client, bool players = false, float range = 96.0);
// Forces a Hunter to pin a victim
native void L4D_ForceHunterVictim(int victim, int attacker);
// Forces a Smoker to grab a victim with their tongue
native void L4D_ForceSmokerVictim(int victim, int attacker);
// Forces a Jockey to pin a victim
native void L4D2_ForceJockeyVictim(int victim, int attacker);
// L4D2 only. Flings a Survivor like when they're flung by a nearby Charger impact
native void L4D2_Charger_ThrowImpactedSurvivor(int victim, int attacker);
// L4D2 only. Makes a Charger carry a Survivor
native void L4D2_Charger_StartCarryingVictim(int victim, int attacker);
// L4D2 only. Makes a Charger pummel a Survivor
native void L4D2_Charger_PummelVictim(int victim, int attacker);
// L4D2 only. Makes a Charger stop pummelling a Survivor
native void L4D2_Charger_EndPummel(int victim, int attacker);
// Makes a Charger stop carrying a Survivor
native void L4D2_Charger_EndCarry(int victim, int attacker);
// L4D2 only. Makes a Jockey stop riding a Survivor
native void L4D2_Jockey_EndRide(int victim, int attacker);
// Makes a Hunter end pounce on a Survivor
native void L4D_Hunter_ReleaseVictim(int victim, int attacker);
// Makes a Smoker stop hanging a Survivor from it's tongue
native void L4D_Smoker_ReleaseVictim(int victim, int attacker);
// Spawns all dead survivors in rescuable rooms
native void L4D_CreateRescuableSurvivors();
// Stops reviving an incapacitated survivor, also from ledge hanging
native void L4D_StopBeingRevived(int client, bool vocalize = false);
// 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);
// Resets a players state equivalent to when they die
native void L4D_CleanupPlayerState(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();
// Ends a Versus round
native void L4D_EndVersusModeRound(bool countSurvivors);
// L4D2 only. Starts a Versus rematch vote like end of game before credits roll
native void L4D2_StartRematchVote();
// Passes a Versus rematch vote like end of game before credits roll
native void L4D2_Rematch();
// 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);
// ====================
// PlayerAnimState natives and methodmaps: (thanks to Forgetest) - See the include file for details
// ====================
methodmap PlayerAnimState {
// Get the PlayerAnimState instance of a player.
public static native PlayerAnimState FromPlayer(int client);
// Main activity of player's animation, matching enums in "left4dhooks_anim.inc".
public native int GetMainActivity();
// Restart and recalculate the main activity.
public native void ResetMainActivity();
// All booleans (or flags) that used for animation events.
property bool m_bIsCustomSequence { // True only after "CTerrorPlayerAnimState::SetCustomSequence".
public native get();
public native set(bool value);
}
property bool m_bIsDead {
public native get();
public native set(bool value);
}
property bool m_bIsHealing {
public native get();
public native set(bool value);
}
property bool m_bIsResurrection {
public native get();
public native set(bool value);
}
property bool m_bIsHitByCharger { // aka multi-charged, bowling.
public native get();
public native set(bool value);
}
property bool m_bIsPummeled {
public native get();
public native set(bool value);
}
property bool m_bIsSlammedIntoWall {
public native get();
public native set(bool value);
}
property bool m_bIsSlammedIntoGround {
public native get();
public native set(bool value);
}
property bool m_bIsStartPummel { // Something to do with charger pummel animation, not sure about the name.
public native get();
public native set(bool value);
}
property bool m_bIsPounded { // Pummel get-up
public native get();
public native set(bool value);
}
property bool m_bIsCarriedByCharger {
public native get();
public native set(bool value);
}
property bool m_bIsPunchedByTank { // Rock get-up shares this
public native get();
public native set(bool value);
}
property bool m_bIsSpitting {
public native get();
public native set(bool value);
}
property bool m_bIsPouncedOn {
public native get();
public native set(bool value);
}
property bool m_bIsTongueAttacked {
public native get();
public native set(bool value);
}
property bool m_bIsStartChainsaw {
public native get();
public native set(bool value);
}
property bool m_bIsIsPouncing {
public native get();
public native set(bool value);
}
property bool m_bIsRiding {
public native get();
public native set(bool value);
}
property bool m_bIsJockeyRidden {
public native get();
public native set(bool value);
}
property bool m_bIsTonguing {
public native get();
public native set(bool value);
}
property bool m_bIsCharging {
public native get();
public native set(bool value);
}
property bool m_bIsPummeling {
public native get();
public native set(bool value);
}
property bool m_bIsPounding {
public native get();
public native set(bool value);
}
property bool m_bIsTongueReelingIn {
public native get();
public native set(bool value);
}
property bool m_bIsTongueAttacking {
public native get();
public native set(bool value);
}
}
// ====================
// Ammo_t natives and methodmaps: (thanks to Forgetest) - See the include file for details
// ====================
methodmap Ammo_t
{
public native void GetName(char[] buffer, int maxlength);
property int nDamageType {
public native get();
public native set(int nDamageType);
}
property int eTracerType {
public native get();
public native set(int eTracerType);
}
property float physicsForceImpulse {
public native get();
public native set(float physicsForceImpulse);
}
property int nMinSplashSize {
public native get();
public native set(int nMinSplashSize);
}
property int nMaxSplashSize {
public native get();
public native set(int nMaxSplashSize);
}
property int nFlags {
public native get();
public native set(int nFlags);
}
// Values for player/NPC damage and carrying capability
// If the integers are set, they override the CVars
property int pPlrDmg { // CVar for player damage amount
public native get();
public native set(int pPlrDmg);
}
property int pNPCDmg { // CVar for NPC damage amount
public native get();
public native set(int pNPCDmg);
}
property int pMaxCarry { // CVar for maximum number can carry
public native get();
public native set(int pMaxCarry);
}
property ConVarPtrWrapper pPlrDmgCVar { // CVar for player damage amount
public native get();
}
property ConVarPtrWrapper pNPCDmgCVar { // CVar for NPC damage amount
public native get();
}
property ConVarPtrWrapper pMaxCarryCVar { // CVar for maximum number can carry
public native get();
}
}
// ====================
// AmmoDef natives and methodmaps: (thanks to Forgetest) - See the include file for details
// ====================
methodmap AmmoDef
{
// Retrieves the ammo index (m_nAmmoIndex).
public static native int GetAmmoIndex();
// Returns a pointer to the Ammo at the Index passed in.
public static native Ammo_t GetAmmoOfIndex(int nAmmoIndex);
// Returns an index for the ammo name.
public static native int Index(const char[] psz);
// Retrieves the maximum ammo that a player can carry.
public static native int MaxCarry(int nAmmoIndex);
public static native int PlrDamage(int nAmmoIndex);
public static native int NPCDamage(int nAmmoIndex);
public static native int DamageType(int nAmmoIndex);
public static native int Flags(int nAmmoIndex);
public static native int MinSplashSize(int nAmmoIndex);
public static native int MaxSplashSize(int nAmmoIndex);
public static native int TracerType(int nAmmoIndex);
public static native float DamageForce(int nAmmoIndex);
}
// 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 the clients team using L4DTeam
stock L4DTeam L4D_GetClientTeam(int client)
// Changes the client's team using L4DTeam
stock void L4D_ChangeClientTeam(int client, L4DTeam team)
// L4D1 only. Returns zombie player L4D1 zombie class
stock L4D1ZombieClassType L4D1_GetPlayerZombieClass(int client)
// L4D1 only. Set zombie player L4D1 zombie class
stock void L4D1_SetPlayerZombieClass(int client, L4D1ZombieClassType class)
// L4D2 only. Returns zombie player L4D2 zombie class
stock L4D2ZombieClassType L4D2_GetPlayerZombieClass(int client)
// L4D2 only. Set zombie player L4D2 zombie class
stock void L4D2_SetPlayerZombieClass(int client, L4D2ZombieClassType class)
// Returns ghost state of zombie player
stock bool L4D_IsPlayerGhost(int client)
// Sets ghost state of zombie player
stock void L4D_SetPlayerGhostState(int client, bool isGhost)
// Returns ghost spawn state of zombie player
stock int L4D_GetPlayerGhostSpawnState(int client)
// Set zombie player's ghost spawn state bits
stock void L4D_SetPlayerGhostSpawnState(int client, int bits)
// Returns whether zombie player is culling
stock bool L4D_IsPlayerCulling(int client)
// Set culling state of zombie player
stock void L4D_SetPlayerCullingState(int client, bool isCulling)
// Returns whether player is incapacitated
stock bool L4D_IsPlayerIncapacitated(int client)
// Set player's incapacitated state
stock void L4D_SetPlayerIncapacitatedState(int client, bool isIncapacitated)
// 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)
// L4D2 only. Set entity glow type
stock void L4D2_SetEntityGlow_Type(int entity, L4D2GlowType type)
// L4D2 only. Set entity glow range
stock void L4D2_SetEntityGlow_Range(int entity, int range)
// L4D2 only. Set entity glow min range
stock void L4D2_SetEntityGlow_MinRange(int entity, int minRange)
// L4D2 only. Set entity glow color
stock void L4D2_SetEntityGlow_Color(int entity, int colorOverride[3])
// L4D2 only. Set entity glow flashing state
stock void L4D2_SetEntityGlow_Flashing(int entity, 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.153 (17-Sep-2024)
- Changed natives "L4D2Direct_SetVSCampaignScore" and "L4D2_SetVersusCampaignScores" to update the tab scoreboard and real scores. Thanks to "Pa4H" for reporting.
- Fixed the "NAV_SPAWN_*" attribute comments in the "left4dhooks.inc" include file. Thanks to "Marttt" for reporting.
- Updated: Plugin.
- Updated: "/scripting/l4dd/l4dd_natives.sp" project file.
- Updated: "/scripting/include/left4dhooks.inc" include file.
1.152 (07-Sep-2024)
- Added 4 member pointers of CDirector for L4D_GetPointer() to use. Thanks to "blueblur0730" for adding on GitHub.
- Added native "L4D_SetCampaignScores" to set the current campaign scores stored in the Director.
- Added native "L4D2_DefibByDeadBody" for L4D2 to revive a players death model and revive animation. Partially added by "King_OXO".
- Added stocks "L4D_GetFlowFromPoint" and "L4D_IsEnoughFlow" to the "left4dhooks_silver.inc" include file. Thanks to "King_OXO" for adding.
- Added stock "L4D_ChangeClientTeam" to the "left4dhooks_stocks.inc" include file. Thanks to "Arman" for adding.
- Changed native "L4DDirect_RecomputeTeamScores" to support L4D1. Requested by "Arman".
- Fixed the "L4D2_GetVersusCampaignScores" and "L4D2_SetVersusCampaignScores" natives from not working. Thanks to "Arman" for reporting.
- L4D2: Fixed the "m_rescueCheckTimer" and "m_iszScriptId" offsets. Thanks to "yuzumi" for providing.
- Updated: Plugin and test plugin.
- Updated: "/gamedata/left4dhooks.l4d1.txt" GameData file.
- Updated: "/gamedata/left4dhooks.l4d2.txt" GameData file.
- Updated: "/scripting/l4dd/l4dd_forwards.sp" project file.
- Updated: "/scripting/l4dd/l4dd_gamedata.sp" project file.
- Updated: "/scripting/l4dd/l4dd_natives.sp" project file.
- Updated: "/scripting/l4dd/l4dd_setup.sp" project file.
- Updated: "/scripting/include/left4dhooks.inc" include file.
- Updated: "/scripting/include/left4dhooks_silver.inc" include file.
- Updated: "/scripting/include/left4dhooks_stocks.inc" include file.
1.151 (17-Jun-2024)
- Added forward "L4D_OnFinishIntro" to fire when the intro cutscene has finished (probably only first chapter of a campaign).
- Added native "L4D_IsInIntro" to determine if the intro cutscene is playing.
- Fixed native "L4D_CancelStagger" blocking being able to stagger someone after calling cancel stagger within the same or next few frames. Thanks to "KoMiKoZa" for reporting. Bug affected "Shove Handler" plugin.
1.150 (06-May-2024)
- L4D1 Linux: Removed some unused clone functions that were removed from the game update. Thanks to "Ja-Forces" and "Forgetest" for reporting.
1.149 (06-May-2024)
- Repackage of the last update to include the GameData changes, which it did not.
1.148 (05-May-2024)
- Update to fix GameData changes on Linux due to the recent update in L4D1. Thanks to "Forgetest" for fixing.
- Removed excess "functions" from the L4D1 temporary gamedata file, which were intended only for L4D2.
1.147 (30-Apr-2024)
- Fixed the "L4D_CancelStagger" not working on Special Infected (hackish fix, the SDKCall does not appear to work). Thanks to "Forgetest" for a solution.
- Changed "left4dhooks_silver.inc" include file to include the main "left4dhooks.inc" include, required by some functions. Thanks to "Forgetest" for reporting.
- Moved bool block variables within the forwards to the top, preventing wrongly firing the "*PostHandled" forwards, in case of any error before being set to false.
1.146 (21-Apr-2024)
- Fixed a memory leak from the Animation hooks system. Thanks to "HarryPotter" for reporting.
- Fixed native "L4D_WriteMemoryString" buffer length. Thanks to "HarryPotter" for reporting.
- Changed natives "L4D_Dissolve" and "L4D_TankRockPrj" to return -1 if the entity failed to be created. Thanks to "ReCreator" for reporting.
1.145 (03-Apr-2024)
- Changed natives "L4D_IsPositionInFirstCheckpoint" and "L4D_IsPositionInLastCheckpoint" to scan for the nearest visible NavArea to prevent finding those outside saferooms, and accurately return true.
- Fixed target filters that match specific Survivors not working for multiples of the same characters in L4D1. Thanks to "HarryPotter" for reporting.
- Fixed native "L4D_IsCoopMode" in L4D2 reporting true for Realism mode. Thanks to "HarryPotter" for reporting.
- Really fixed forward "L4D2_OnChooseVictim_Pre" throwing errors in L4D1 (for some reason the changes in gamedata did not carry over to release version).
1.144 (05-Mar-2024)
- Added forwards: "L4D2_OnStartUseAction", "L4D2_OnStartUseAction_Post" and "L4D2_OnStartUseAction_PostHandled" to trigger on actions, see "L4D2UseAction" enum from "left4dhooks_stocks.inc" include file. Requested by "Machine".
- Added native "L4D_IsTouchingTrigger" to detect if an entity is touching a trigger.
- Added native "L4D_StopBeingRevived" to stop a player being revived from incapacitated state.
- Fixed native "L4D_IsInLastCheckpoint" to check if a player is within the "info_changelevel" area of the last checkpoint. Thanks to "Shadowysn" for help pointing out some information to make it work accurately.
- Fixed native "AnimHookDisable" not completely working under some circumstances. Thanks to "Forgetest" for finding and fixing.
- Fixed forward "L4D2_OnChooseVictim_Pre" throwing errors in L4D1.
1.143 (25-Jan-2024)
- Added examples for the"L4D_PipeBomb_Detonate*" forwards to the test plugin for differentiating PipeBomb and breakable prop (propane tank, oxygen tank etc) explosions.
- Clarified forwards "L4D_PipeBomb_Detonate" notes within the include file for differentiating PipeBomb and breakable prop explosions. Thanks to "HarryPotter" for reporting.
- Changed the Spitter Acid bug fix to play the sound from the victim, instead of from the acid source location. Thanks to "JustMadMan" for reporting.
- Fixed forward "L4D_TankRock_OnRelease" from possibly given an invalid Tank owner index. Thanks to "Re:Creator" for reporting.
- Fixed memory leak from clearing animation hook arrays. Thanks to "yongeni" for reporting and "HarryPotter" for fixing.
1.142 (12-Jan-2024)
- Fixed the last update breaking on Linux servers. Thanks to "Hawkins" for reporting and testing.
1.141 (11-Jan-2024)
- Added forwards "L4D_MolotovProjectile*", "L4D2_VomitJarProjectile*" and "L4D2_GrenadeLauncherProjectile*" to trigger when various grenade projectiles are created. Requested by "Kerouha".
- Added forward "L4D2_OnChooseVictim_Pre" which shows the previously targeted entity. Requested by "Forgetest".
- Added "AmmoDef" and "Ammo_t" methodmaps and natives for ammo definitions. Thanks to "Forgetest" for writing and providing.
- Changed stock "L4D_IsPlayerStaggering" to be more accurate. Plugins using this stock should be recompiled. Thanks to "HarryPotter" for updating.
- Changed forward "L4D2_OnChooseVictim" when using return Plugin_Handled to block the function, bots will stand still only instead of targeting themselves and attacking while standing still.
- Changed natives "L4D_PipeBombPrj", "L4D2_VomitJarPrj", "L4D_MolotovPrj", "L4D2_GrenadeLauncherPrj", "L4D2_SpitterPrj" and "L4D_TankRockPrj" to allow specifying the velocity and rotation. Thanks to "Forgetest" for changing.
1.140 (03-Dec-2023)
- Added forwards "L4D_OnIncapacitated", "L4D_OnIncapacitated_Post" and "L4D_OnIncapacitated_PostHandled" to trigger when a Survivor is incapacitated. Requested by "HarryPotter".
- Fixed forwards "L4D2_OnPounceOrLeapStumble*" in L4D1 from throwing errors. Thanks to "HarryPotter" for reporting.
- Increased the Spitter Acid bug fix volume. Thanks to "Marttt" and "KadabraZz" for reporting.
1.139 (25-Oct-2023)
- Added new attribute "L4D2IWA_WeaponType" for use with the "L4D2_GetIntWeaponAttribute" native. Thanks to "Forgetest" for providing.
- Added new enum "WeaponType" for use with the "L4D2IWA_WeaponType" attribute. Thanks to "Forgetest" for providing.
- Added forward "L4D_OnMotionControlledXY" which is called when staggering or other motion controlled animations. Requested by "Forgetest".
- Added forward "L4D_OnDeathDroppedWeapons" to list weapon indexes dropped on player death. Requested by "Forgetest".
- Added forwards "L4D2_GrenadeLauncher_Detonate", "L4D2_GrenadeLauncher_Detonate_Post" and "L4D2_GrenadeLauncher_Detonate_PostHandled" when a Grenade Launcher projectile detonates.
- Added native "L4D_PrecacheParticle" to precache particle effects.
- Added native "L4D_RemoveEntityDelay" to remove an entity after a specified amount of time.
- Added native "L4D_WriteMemoryString" to write a string to a memory address.
- Changed native "L4D_PipeBombPrj" to optionally create the PipeBomb fuse/light particles. Requested by "Eyal282".
- Fixed native "L4D2_IsRealismMode" from returning values other than 0 and 1. Thanks to "Eyal282" for reporting.
- Fixed forward "L4D2_OnFindScavengeItem*" to stop passing invalid entities. Thanks to "kochiurun119" for reporting.
1.138 (25-Sep-2023)
- Fixed the "L4D2_CGasCan_EventKilled*" forwards not triggering when a gascan had not been picked up. Thanks to "Mystik Spiral" for reporting.
1.137 (23-Sep-2023)
- Added forwards "L4D2_Infected_HitByVomitJar", "L4D2_Infected_HitByVomitJar_Post" and "L4D2_Infected_HitByVomitJar_PostHandled" to trigger when common infected are hit with a VomitJar. Requested by "Eyal282".
- Incorporated the Spitter Acid no sound fix for when clients disconnected. Thanks to "Marttt" for reporting.
- Now also flashes red like the game should when taking damage from this bugged entity. Thanks to "Marttt" for reporting.
- Updated to the latest version of the "lux_library" include file. Thanks to "Lux" for reporting.
1.136 (05-Sep-2023)
- Fixed the last update logging an error in L4D1. Thanks to "HarryPotter" for reporting.
- Fixed forward "L4D_TankClaw_DoSwing_Post" having the wrong name and not activating. Thanks to "Forgetest" for reporting.
1.135 (18-Aug-2023)
- Added a ton of natives for "PlayerAnimState" in L4D2 only. See the "methodmap PlayerAnimState" section of the "left4dhooks.inc" include file. Thanks to "Forgetest" for the code and "A1m`" for various stuff.
- Added native "L4D_HasMapStarted" to check if game addresses have been loaded in OnMapStart. For use with some natives that require being called only after OnMapStart.
- Added an example to the test plugin for use with "L4D_HasMapStarted" and natives that require waiting after OnMapStart. See the first OnMapStart section that is commented out.
- Fixed forward "L4D2_OnPounceOrLeapStumble" detour to potentially fix rare random crashes. Thanks to "A1m`" and "Forgetest" for reporting.
- Fixed stock "L4D2_SetEntityGlow" to use the newdecls. Thanks to "Dragokas" for reporting.
- Fixed the test plugin examples for "L4D1_FirstAidKit_StartHealing" and "L4D2_BackpackItem_StartAction". Thanks to "Mystik Spiral" for reporting.
1.134 (10-Jul-2023)
- Added "POINTER_SURVIVALMODE" enum for the "L4D_GetPointer" native to return the SurvivalMode pointer.
- Added "L4D2CT_SurvivalSetupTimer" to the "L4D2CountdownTimer" enum for use with the "L4D2_CTimer*" natives.
- Added stock "L4D_SetPlayerTempHealthFloat" to the "left4dhooks_stocks.inc" include file to set a players temporary health above 200 HP. Thanks to "Eyal282" for the code.
- Added forwards "L4D_TankRock_BounceTouch", "L4D_TankRock_BounceTouch_Post" and "L4D_TankRock_BounceTouch_PostHandled" when a tank rock collides with something. Thanks to "Forgetest" for the code.
- Added natives "L4D2_GetSurvivalStartTime" and "L4D2_SetSurvivalStartTime" to get and set the Survival start time. Requested by "Forgetest".
- Added native "L4D2_SpawnAllScavengeItems" to spawn all Scavenge items. Thanks to "Eyal282" for some of the code and changes.
- Added native "L4D2_Rematch" to restart a Versus game. Thanks to "Eyal282" for some of the code and changes.
- Added native "L4D_EndVersusModeRound" to end the Versus round. Thanks to "Spirit_12" for some of the code and changes.
- Fixed native "L4D2_Charger_StartCarryingVictim" removing teleporting and placement position bug. Thanks to "HarryPotter" for reporting.
- Fixed L4D2 GameData offset for "L4D2_GetFirstSpawnClass" and "L4D2_SetFirstSpawnClass" natives. Thanks to "Forgetest" for reporting the new offset.
- Errors about using natives before OnMapStart will now show the plugin causing it.
1.133 (19-Jun-2023)
- Added details to some natives explaining they can only be used 1 frame after "OnMapStart" due to pointers being unavailable before. Thanks to "HarryPotter" for reporting.
- Added an error log when certain natives are used before before "OnMapStart" instead of an ambiguous error about invalid offsets.
- Added "POINTER_MISSIONINFO" enum for the "L4D_GetPointer" native to return the MissionInfo pointer.
- Added native "L4D_FindUseEntity" to find a valid Use entity. This was added to find a valid target within the "L4D1_FirstAidKit_StartHealing" and "L4D2_BackpackItem_StartAction" pre hook forwards.
- Added natives "L4D_ForceHunterVictim", "L4D_ForceSmokerVictim" and "L4D2_ForceJockeyVictim" to pin specific Special Infected on specific Survivors.
- Added natives "L4D_Hunter_ReleaseVictim", "L4D_Smoker_ReleaseVictim" and "L4D2_Charger_EndCarry" to release pinned victims.
- Changed forwards "L4D2_BackpackItem_StartAction", "L4D2_BackpackItem_StartAction_Post" and "L4D2_BackpackItem_StartAction_PostHandled" to include a weapon type param.
- Changed native "L4D2_UseAdrenaline" adding an optional param to fire the related event. Also fixed max health to use the true value instead of hard coding to 100. Thanks to "Eyal282" for reporting.
- Changed native "L4D_IsMissionFinalMap" adding an optional param to support custom maps with multiple finales to return true if the "env_outtro_stats" entity is detected but not technically the last map.
- Changed native "L4D2_NavAreaBuildPath" to block being called before OnMapStart, to fix any related crashes while TheNavArea is not initialized. Thanks to "Mika Misori" for reporting.
- Changed native "L4D_IsInLastCheckpoint" code, to prevent teleporting Survivors on some 3rd party maps. Thanks to "tRololo312312" for reporting.
- Explanation: calling "TerrorNavMesh::GetLastCheckpoint" would otherwise teleport players to that finale position, for some reason.
- Fixed native "L4D2Direct_GetSIClassDeathTimer" returning the timer for the wrong Special Infected and errors when checking Chargers. Thanks to "PencilMario" for reporting.
- Updated "left4dhooks_lux_library" include file, fixing the "Terror_GetAdrenalineTime" stock to check for adrenaline being active. Thanks to "Lux" for changes and "Eyal282" for reporting.
1.132 (25-May-2023)
- Added forwards "L4D1_FirstAidKit_StartHealing", "L4D1_FirstAidKit_StartHealing_Post" and "L4D1_FirstAidKit_StartHealing_PostHandled" to control first aid kit duration.
- Added forwards "L4D2_BackpackItem_StartAction", "L4D2_BackpackItem_StartAction_Post" and "L4D2_BackpackItem_StartAction_PostHandled" to control first aid kit duration, defibrillator and other use durations.
- Forwards requested by "Eyal282". Thanks to "Psyk0tik" for the detour functions and signatures.
- Fixed various offsets from the from the 2.2.2.7 L4D2 update. Thanks to "sorallll" and "PaaNChaN" for reporting and "SirPlease" for updating.
1.131 (25-May-2023)
- Fixed signatures broken from the 2.2.2.7 L4D2 update.
- Thanks to "robex" and "XiLuo" for reporting changes.
- Thanks to "A1m`" for updating various offsets.
- Added stock "L4D_IsTankProp" in the "left4dhooks_silver.inc" file, to check if a prop can be hit by tanks. Thanks to "Eyal282" for adding.
- Added forward "L4D2_OnChargerImpact" to trigger when a Charger impacts after charging. Requested by "Eyal282".
- Added native "L4D_NavArea_IsConnected" to check if 2 areas are connected. Requested by "Eyal282".
- Added native "L4D_GetNavAreaCenter" to get the center of a NavArea. Requested by "3ipKa".
- Added native "L4D_SetPlayerSpawnTime" to set the spawn timer of a SI. Requested by "A1m`".
- Fixed native "L4D_OnGameModeChange" in L4D2 returning 0 for realism. Thanks to "HarryPotter" for reporting.
- Fixed forward "L4D2_CGasCan_EventKilled" not setting the correct modified values. Thanks to " 4NTEP xD " for reporting.
- Fixed stocks "L4D2_GetWeaponUpgradeAmmoCount" and "L4D2_GetWeaponUpgrades" in the "left4dhooks_stocks" file, to return values other than 0 and 1. Thanks to "BHaType" for reporting.
- Plugins using either of these stocks should be recompiled against the updated file.
- Changes to the test plugin removing unnecessary lines printed to console when forwards trigger.
1.130 (01-May-2023)
- Changed native "L4D2_NavAreaTravelDistance" to support L4D1. Thanks to "Eärendil" for reporting, and "Psyk0tik" for the signature.
- Changed forward "L4D2_CGasCan_EventKilled" to an Action instead of Void forward to allow blocking detonation. Requested by "Mystik Spiral".
- Added forwards "L4D2_CGasCan_EventKilled_Post" and "L4D2_CGasCan_EventKilled_PostHandled" to pair with the changed forward.
- Added a check to validate the "CTerrorGameRules::GetMissionInfo" address. Thanks to "yezi" for reporting.
1.129 (31-Mar-2023)
- Added native "L4D_WarpToValidPositionIfStuck" to teleport a stuck player. Requested by "ioioio".
- Added forwards "L4D_OnTakeOverBot", "L4D_OnTakeOverBot_Post" and "L4D_OnTakeOverBot_PostHandled" that triggers when a client takes over a bot.
- Updated "left4dhooks_lux_library" include file to version "0.5.7".
1.128 (06-Feb-2023)
- Added forwards "L4D_OnDoAnimationEvent", "L4D_OnDoAnimationEvent_Post" and "L4D_OnDoAnimationEvent_PostHandled" to trigger on certain animation events. Requested by "Forgetest".
- Added native "L4D_GetAllNavAreas" to return an ArrayList of all "TheNavAreas" addresses. Requested by "Marttt". Thanks to "HarryPotter" and "Forgetest" for help.
- Added natives "L4D_GetNavAreaPos" and "L4D_GetNavAreaSize" to return the origin and size of a NavArea.
- Added natives "L4D_GetNavAreaID" and "L4D_GetNavAreaByID" to return the ID from a NavArea address, and an address from a NavArea ID.
- Added natives "L4D2_GetFirstSpawnClass" and "L4D2_SetFirstSpawnClass" to get and set the first Special Infected class that will spawn. L4D2 only. Thanks to "Forgetest" providing.
- Added more stocks to the "left4dhooks_silver.inc" include file. Thanks to "knifeeeee" for providing.
- Added enum "POINTER_THENAVAREAS" for the "L4D_GetPointer" native to return the "TheNavAreas" pointer.
- Added enum list "PLAYERANIMEVENT_*" used by the "L4D2Direct_DoAnimationEvent" native and "L4D_OnDoAnimationEvent*" forwards. Thanks to "A1m`" for providing.
- Changed native "L4D2Direct_DoAnimationEvent" to expose the variant param. Requested by "Forgetest".
- Fixed natives "L4D_IsInFirstCheckpoint" and "L4D_IsPositionInFirstCheckpoint" sometimes incorrectly reporting false positives. Thanks to "Voevoda" for reporting.
- Fixed forward "L4D2_OnEntityShoved_Post*" param "bIsHighPounce" to be more reliable, although it may still not report accurately. Thanks to "Forgetest" for changes.
- Fixed forwards "L4D_OnSpawnSpecial_*", "L4D2_OnSpawnWitchBride_*" and "L4D_OnSpawnTank_Post*" to allow returning -1 as client index. Thanks to "Forgetest" for reporting.
- Prevented forwards "L4D_OnTryOfferingTankBot*" from triggering when the client index was 0. Thanks to "Forgetest" for reporting.
1.127 (07-Jan-2023)
- Added more Charger stocks to the "left4dhooks_silver.inc" include file. Thanks to "Forgetest" for providing.
- Added some more "L4D2UseAction" enum values to the "left4dhooks_stocks.inc" include file. Thanks to "Marttt" for reporting.
- Changed natives "L4D_IsPositionIn*" to use a wider search area to the nearest NavArea position, from 300.0 to 1000.0. Suggested by "ProjectSky".
- Added missing post handled forwards to the include file. Thanks to "Forgetest" for reporting.
- "L4D_OnStartMeleeSwing_PostHandled", "L4D2_OnChangeFinaleStage_PostHandled", "L4D2_CGasCan_ShouldStartAction_PostHandled",
- "L4D2_OnHitByVomitJar_PostHandled", "L4D2_CGasCan_ActionComplete_PostHandled", "L4D2_OnJockeyRide_PostHandled" and "L4D2_OnStartCarryingVictim_PostHandled".
- Added forward "L4D2_OnSlammedSurvivor_PostHandled" when the pre hook is being blocked. Requested by "Forgetest".
- Changed forward "L4D2_OnSlammedSurvivor" to allow blocking the forward.
- Changed forward "L4D_OnFatalFalling" to return client index 0 when the client is not available.
- Fixed forward "L4D_OnFatalFalling" throwing errors when client index is 0. Thanks to "Beatles" for reporting.
- Fixed forwards "L4D_TankRock_OnRelease" and "L4D_TankRock_OnRelease_Post" crashing on L4D1 Linux not giving a vecAng. Thanks to "Forgetest" for fixing.
- Deprecated native: "L4D2_AreTeamsFlipped" in favor of using: GameRules_GetProp("m_bAreTeamsFlipped"); - Suggested by "A1m`".
1.126 (21-Dec-2022)
- Added weapon attribute "L4D2IWA_DefaultSize" for the "L4D2_GetIntWeaponAttribute" and "L4D2_SetIntWeaponAttribute" natives to get a weapons default clip size. Thanks to "iaNanaNana" for adding.
- Added natives "L4D_IsPositionInFirstCheckpoint" and "L4D_IsPositionInLastCheckpoint" to check if a given vector is within a checkpoint area. Thanks to "Forgetest" for the code.
- Added native "L4D_GetEntityWorldSpaceCenter" to get an entities worldspace center. Requested by "A1m`".
- Added forwards "L4D_OnCancelStagger", "L4D_OnCancelStagger_Post" and "L4D_OnCancelStagger_PostHandled" to notify when a players stagger is being cancelled. Requested by "Forgetest".
- Fixed native "L4D_IsInLastCheckpoint" teleporting players in the finale. Thanks to "HarryPotter" for reporting.
- L4D1: Fixed forward "L4D_OnReleaseSurvivorPositions" crashing Windows servers by fixing the GameData signature.
- Changed natives: "L4D2Direct_GetNextShoveTime" and "L4D2Direct_SetNextShoveTime" method. Please report any issues.
- Deprecated natives: "L4D2Direct_GetShovePenalty" and "L4D2Direct_SetShovePenalty" in favor of using the "m_iShovePenalty" Prop_Send GetEntProp/SetEntProp natives.
1.125 (07-Dec-2022)
- Fixed update 1.124 breaking "L4D2_OnEndVersusModeRound". Thanks to "Forgetest" for reporting.
- Fixed update 1.124 errors on Windows L4D1. Thanks to "HarryPotter" for reporting.
- Fixed native "L4D_SetBecomeGhostAt" not working on Windows L4D1.
1.124 (07-Dec-2022)
- Fixed natives "L4D2_SetIntMeleeAttribute" and "L4D2_GetIntMeleeAttribute" using Int32 instead of Int16. Thanks to "NoroHime" for reporting.
- Fixed natives "L4D_IsInFirstCheckpoint" and "L4D_IsInLastCheckpoint" to use SDKCalls for accuracy instead of events. Thanks to "BHaType" for reporting.
- Changed native "L4D_IsAnySurvivorInStartArea" to also use the "L4D_IsInFirstCheckpoint" method, since it often incorrectly reported false.
1.123 (03-Dec-2022)
- Added native "L4D_SetBecomeGhostAt" to set when a dead Special Infected player will transition into ghost state. Requested by "sorallll".
- L4D2: Fixed native "L4D_GetPlayerSpawnTime" on Windows reporting the wrong value.
1.122 (15-Nov-2022)
- Added native "Left4DHooks_Version" to get the Left4DHooks plugin version.
- Fixed native "L4D2_SpitterPrj" not playing any acid damage sounds if the attacker index was 0.
- Fixed forwards "L4D_OnGetCrouchTopSpeed", "L4D_OnGetWalkTopSpeed" and "L4D_OnGetRunTopSpeed" from throwing client not in game errors. Thanks to "Eärendil" for reporting.
1.121 (06-Nov-2022)
- Added native "L4D_AreAllSurvivorsInFinaleArea". Requested by "Eärendil".
- Fixed native "L4D2_SpitterPrj" to not emit duplicate sounds from regular Spitter projectiles and playback at about the same volume as default.
- L4D2: Added forwards "L4D2_OnSlammedSurvivor" and "L4D2_OnSlammedSurvivor_Post" when a Survivor is carried by a Charger and slammed into a wall. Thanks to "Forgetest" for adding.
- L4D2: Added stocks "L4D2_GetQueuedPummelStartTime", "L4D2_IsInQueuedPummel", "L4D2_GetQueuedPummelAttacker" and "L4D2_GetQueuedPummelVictim" to the "left4dhooks_silver.inc" include file.
- L4D1: Fixed trying to load the "IsVisibleToPlayer" signature. Thanks to "HarryPotter" for reporting.
- Fixed stocks "IsUsingMinigun" and "StopUsingMinigun" throwing errors from the "left4dhooks_silver.inc" include file. Plugins must recompile to fix this error. Thanks to "HarryPotter" for reporting.
1.120 (20-Oct-2022)
- Update for L4D2.
- Added native "L4D2_CommandABot" to command a bots actions.
- Added native "L4D2_GetScriptScope" to get an entities script ID. Thanks to "Forgetest" for help.
- Added native "L4D2_GetVScriptEntity" to get a VScript "logic_script" entity index.
- Added native "L4D2_IsVisibleToPlayer" to get a VScript "logic_script" entity index. Requested by "morzlee", thanks to "fdxx" and "Psyk0tik" for the code and gamedata.
- Fixed native "ITimer_GetTimestamp" using the wrong stock and returning the wrong values. Thanks to "Forgetest" for reporting.
- L4D2: Fixed forward "L4D2_OnGetScriptValueVector" not returning a vector value and not setting the value when changed.
- Fixed forwards "L4D2_OnGetScriptValue*" not working after map change. Thanks to "Forgetest" for reporting.
1.119 (15-Oct-2022)
- L4D2: Added a new pointer "POINTER_SCRIPTVM" to the "L4D_GetPointer" native.
- L4D2: Added native "L4D2_GetDirectorScriptScope" to get the directors script scope.
- L4D2: Added forwards "L4D2_OnGetScriptValueInt", "L4D2_OnGetScriptValueFloat", "L4D2_OnGetScriptValueVector" and "L4D2_OnGetScriptValueVoid" to use a new system of detecting script values. Thanks to "Forgetest" for coding.
- L4D2: Added forward "L4D_OnForceSurvivorPositions_Pre" - pre relative to "L4D_OnForceSurvivorPositions" forward. Requested by "gabuch2".
- L4D2: Changed native "L4D2_UseAdrenaline" to fire the event even when not healing. Thanks to "HarryPotter" for reporting.
- L4D1 Linux: fixed forward "L4D_OnReleaseSurvivorPositions" using the wrong signature. Thanks to "HarryPotter" for reporting.
- Added stocks "IsUsingMinigun" and "StopUsingMinigun" in the "left4dhooks_silver.inc" include file. Requested by "knifeeeee".
- Added native "L4D_CleanupPlayerState" to clean up a players state. Requested by "knifeeeee".
1.118 (03-Oct-2022)
- Fixed forward "L4D_OnReleaseSurvivorPositions" not being detected when used. Thanks to "gabuch2" for reporting.
1.117 (30-Sep-2022)
- Added forward "L4D_OnReleaseSurvivorPositions" to trigger after round start when Survivors are released from starting positions, usually first map and finale escape start, not all maps. Requested by "gabuch2".
- Added forwards "L4D_OnSpeakResponseConcept_Pre" and "L4D_OnSpeakResponseConcept_Post" to trigger when a talker response is triggered. Requested by "gabuch2".
- Added some details for the "*_Detonate*" forwards in the "left4dhooks.inc" include file
1.116 (21-Sep-2022)
- L4D1: Fixed GameData missing the "L4D_Molotov_Detonate" and "L4D_PipeBomb_Detonate" forwards data.
- L4D2: Fixed native "L4D2_SpitterPrj" crashing the server when playing damage sounds. Thanks to "Marttt" for fixing.
1.115 (20-Sep-2022)
- Added forward "L4D_OnForceSurvivorPositions" Triggers after round start when Survivors are forced into starting positions, usually first map and finale escape start, not all maps. Requested by "gabuch2".
- Added forwards "L4D_Molotov_Detonate", "L4D_PipeBomb_Detonate" and "L4D2_VomitJar_Detonate" with their relative "_Post" and "_PostHandled" forwards to trigger when a grenade projectile is about to explode.
- L4D2: Fixed native "L4D2_SpitterPrj" not causing damage sounds when the projectile is not connected with a player from the Special Infected team. Thanks to "Marttt" for reporting.
- L4D2: Fixed native "L4D2_UseAdrenaline" to use the "adrenaline_health_buffer" cvar value instead of "pain_pills_health_value" for healing and prevent over-healing. Thanks to "HarryPotter" for fixing.
- Fixed stock "L4D_StopReviveAction" from "left4dhooks_silver.inc" include file from throwing errors. Thanks to "Red Flame" for reporting.
1.114 (01-Sep-2022)
- Added forwards "L4D_OnPlayerCough", "L4D_OnPlayerCough_Post" and "L4D_OnPlayerCough_PostHandled" when a player is coughing from a Smoker Cloud.
- Added native "L4D_GoAwayFromKeyboard" to set a client as idle. Requested by "knifeeeee".
- Added natives "L4D_GetNavArea_AttributeFlags" and "L4D_SetNavArea_AttributeFlags" to get and set a nav areas attribute flags.
- Added natives "L4D_GetNavArea_SpawnAttributes" and "L4D_SetNavArea_SpawnAttributes" to get and set a nav areas spawn attribute flags.
- Initial adding of native "L4D2_GetScriptValueString" to return the directors string key values. This crashes when the key has not been set.
- Fixed forward "L4D_OnGetScriptValueString" throwing errors.
- Added missing forwards "L4D2_CInsectSwarm_CanHarm_PostHandled" and "L4D2_OnSpawnWitchBride_PostHandled" to the include file.
- Changes to some forwards information in the include file.
- Changes to prevent errors throwing from some forwards in the test plugin.
1.113 (16-Aug-2022)
- Fixed the natives "L4D_GetCheckpointFirst" and "L4D_GetCheckpointLast" not always finding the saferoom door. Thanks to "azureblue" for reporting.
1.112 (15-Aug-2022)
- Added native "L4D2_GetScriptValueFloat" to return the directors float key values. See the left4dhooks.inc include file for details.
- Changed forwards "L4D_OnGetScriptValueInt" to read and modify the post hook values.
- Probably fixed forward "L4D_OnGetScriptValueString" not modifying the return value when changed.
- Initial adding of forward "L4D_OnGetScriptValueVector" to return the directors vector key values. This is unused and commented out in code due to not being tested.
- Thanks to "Forgetest" for help coding and testing.
- Wildcarded the "SurvivorBot::UseHealingItems" signature to prevent conflicts with other plugins.
1.111 (30-Jul-2022)
- Fixed native "L4D_GetNearestNavArea" additional params not being backwards compatible with plugins compiled against older versions of left4dhooks. Thanks to "Mr. Man" for reporting.
1.110 (15-Jul-2022)
- Added L4D2 native "L4D2_NavAreaBuildPath" to replace the "L4D2_VScriptWrapper_NavAreaBuildPath" native VScript wrapper. Requested by "morzlee". Thanks to "Forgetest" for helping.
- Changed native "L4D_GetNearestNavArea" to accept some more parameters. Suggested by "Forgetest".
- Various minor code changes to adjust for splitting the project (cleaner comments and better error handling when compiling the split project files). Thanks to "Psyk0tik" for some help.
1.109 (05-Jul-2022)
- Plugin now requires SourceMod 1.11. Utilizing some fixes from the new SourceMod and changed code to use new methodmaps.
- Core changes to the source code splitting into multiple files for maintainability. Thanks to "Psyk0tik" for some suggestions.
- Changed forward "L4D2_OnEntityShoved" client detection method. Thanks to "A1m`" for a solution.
- Fixed forwards: "L4D_OnTryOfferingTankBot", "L4D_OnSpawnSpecial", "L4D_OnSpawnTank", "L4D_OnSpawnWitch", "L4D2_OnSpawnWitchBride", "L4D_PipeBombProjectile_Pre" and "L4D2_OnFindScavengeItem"
to return -1 instead of 0 when blocking the functions. Thanks to "Forgetest" for reporting.
- New project files located in "scripting/l4dd/"
1.108 (20-Jun-2022)
- Added support for the "Updater" plugin by "GoD-Tony" to auto-update Left4DHooks. Can change the "ALLOW_UPDATER" define value for various options.
- L4D2: Added native "L4D2_Jockey_EndRide" to stop a Jockey riding a Survivor. Requested by "Eyal282".
1.107 (08-Jun-2022)
- Fixed memory leak when players disconnect. Thanks to "hefiwhfcds2" for reporting.
- Fixed forwards "L4D_OnShovedBySurvivor*" from throwing "null pointer" errors. Thanks to "HarryPotter" for reporting.
- Fixed native "L4D_TakeOverZombieBot" not always setting the correct zombie type in L4D2. Thanks to "a2121858" for fixing.
- Fixed native "L4D2Direct_SetTankTickets" crashing servers. Requires SourceMod 1.11. Thanks to "a2121858" for reporting.
- Potentially fixed other server crashes on map change when writing to memory. Requires SourceMod 1.11.
1.106 (02-Jun-2022)
- Added stock "L4D_HasReachedSmoker" to return if a Survivor has reached the Smoker. Requested by "Nuki".
- Plugin now warns if Left4DHooks is already running, to avoid duplicate plugins.
- Reverted accidental debug logging from the last update. Thanks to "Hawkins" for reporting.
1.105 (01-Jun-2022)
- L4D1: Fixed native "L4D2_GetTankCount" not reporting the correct value. Thanks to "Alexmy" for reporting.
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.
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.
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.
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.
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.
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.
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.
- 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.
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.
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.
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.
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".
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.
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.
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.
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 150!
- 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 include 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.
- 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.
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)
"@sip" - 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 "CMolotovProjectile::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.
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.
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.
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.
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 "Psyk0tik" 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.
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.
- 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.
1.40 (16-Jun-2021)
- L4D2: Fixed various offsets breaking from "2.2.1.3" game update. Thanks to "Nuki" for reporting and helping.
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 "Psyk0tik" for fixing.
- L4D2: Fixed "VanillaModeOffset" in Linux breaking from "2.2.1.3" game update. Thanks to "Accelerator74" for fixing.
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.
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 "Psyk0tik" for the L4D1 signature.
- Fixed Linux detection accidentally being broken from version 1.17 update.
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).
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!
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.
1.16a (16-Jun-2020)
- Fixed using the wrong offset for "m_PendingMobCount". Thanks to "fbef0102" for reporting.
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.
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.
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 "Psyk0tik" for requesting.
- Optional natives can be set by plugins with "#undef REQUIRE_PLUGIN" before "#include <left4dhooks>" and "#define REQUIRE_PLUGIN" after.
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.
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.
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.
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.
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".
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.
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.
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.
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 the line if already replacing "<left4downtown>" with "<left4dhooks>"
Requirements:
Requires SourceMod 1.11+ due to various methodmaps.
Conflicts with Left4Downtown, remove the extension to run.
Optional: Use the Updater plugin to keep Left4DHooks updated to the latest version.
Installation:
Download the .zip and extract the files to their respective folders in your servers \addons\sourcemod\ folder.
NOTICE:
This plugin now requires SourceMod version 1.11 or newer.
Upgrading SourceMod will benefit your server from improved stability, new features and fixes.
Depending on the plugins using Left4DHooks, your server may no longer randomly crash, and some features now work properly without sometimes failing (known issues from SM 1.10 and less).
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