mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-06 21:53:21 +00:00
Update libs
This commit is contained in:
parent
ca2831ec53
commit
da1aad7dac
4 changed files with 4439 additions and 35 deletions
|
@ -10,24 +10,38 @@ enum L4D2Infected
|
||||||
L4D2Infected_Witch = 7,
|
L4D2Infected_Witch = 7,
|
||||||
L4D2Infected_Tank = 8
|
L4D2Infected_Tank = 8
|
||||||
};
|
};
|
||||||
int g_iAttackerTarget[MAXPLAYERS+1], g_PendingBanTroll[MAXPLAYERS+1];
|
|
||||||
int autoPunished = -1, autoPunishMode, lastButtonUser, lastCrescendoUser;
|
|
||||||
bool g_bPendingItemGive[MAXPLAYERS+1];
|
|
||||||
GlobalForward g_PlayerMarkedForward;
|
|
||||||
char steamids[MAXPLAYERS+1][64];
|
|
||||||
Handle g_hWitchAttack;
|
|
||||||
|
|
||||||
//HANDLES
|
GlobalForward g_PlayerMarkedForward;
|
||||||
|
Handle g_hWitchAttack;
|
||||||
Handle hThrowTimer;
|
Handle hThrowTimer;
|
||||||
//CONVARS
|
|
||||||
ConVar hVictimsList, hThrowItemInterval, hAutoPunish, hMagnetChance, hShoveFailChance, hAutoPunishExpire, hMagnetTargetMode, hWitchTargetIncapp;
|
ConVar hVictimsList;
|
||||||
|
ConVar hThrowItemInterval;
|
||||||
|
ConVar hAutoPunish;
|
||||||
|
ConVar hMagnetChance;
|
||||||
|
ConVar hShoveFailChance;
|
||||||
|
ConVar hAutoPunishExpire;
|
||||||
|
ConVar hMagnetTargetMode;
|
||||||
ConVar hBadThrowHitSelf;
|
ConVar hBadThrowHitSelf;
|
||||||
//BOOLS
|
|
||||||
bool lateLoaded; //Is plugin late loaded
|
bool g_bPendingItemGive[MAXPLAYERS+1];
|
||||||
bool bChooseVictimAvailable = false; //For charge player feature, is it available?
|
|
||||||
//INTEGERS
|
int g_iAmmoTable; //Loads the ammo table to get max ammo for weapons
|
||||||
int g_iAmmoTable; //Loads the ammo table to get ammo amounts
|
int autoPunished = -1;
|
||||||
int gChargerVictim = -1; //For charge player feature
|
int autoPunishMode;
|
||||||
|
int lastButtonUser;
|
||||||
|
int lastCrescendoUser;
|
||||||
|
int g_iAttackerTarget[MAXPLAYERS+1];
|
||||||
|
int g_PendingBanTroll[MAXPLAYERS+1];
|
||||||
|
|
||||||
|
int gInstaSpecialType = -1;
|
||||||
|
int gInstaSpecialTarget;
|
||||||
|
float gInstaSpecialSpawnPos[3];
|
||||||
|
float gInstaSpecialSpawnAng[3];
|
||||||
|
bool gInstaSpecialInstaKill;
|
||||||
|
int gInstaSpecialMagnet[MAXPLAYERS+1];
|
||||||
|
|
||||||
|
char steamids[MAXPLAYERS+1][64];
|
||||||
|
|
||||||
#include <feedthetrolls/base>
|
#include <feedthetrolls/base>
|
||||||
#include <feedthetrolls/trolls>
|
#include <feedthetrolls/trolls>
|
||||||
|
|
|
@ -67,7 +67,7 @@ stock void ShowDelayedHintToAll(const char[] format, any ...) {
|
||||||
hintInt++;
|
hintInt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
stock int GetSurvivorId(const char str[16], bool isL4D1 = false) {
|
stock int GetSurvivorId(const char[] str, bool isL4D1 = false) {
|
||||||
int possibleNumber = StringToInt(str, 10);
|
int possibleNumber = StringToInt(str, 10);
|
||||||
if(strlen(str) == 1) {
|
if(strlen(str) == 1) {
|
||||||
if(possibleNumber <= 7 && possibleNumber >= 0) {
|
if(possibleNumber <= 7 && possibleNumber >= 0) {
|
||||||
|
@ -224,7 +224,7 @@ stock bool TraceFilter(int entity, int contentsMask) {
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
stock bool GetGround(int client, float[3] vPos, float[3] vAng) {
|
stock bool GetGround(int client, float vPos[3], float vAng[3]) {
|
||||||
GetClientAbsOrigin(client, vPos);
|
GetClientAbsOrigin(client, vPos);
|
||||||
vAng = vPos;
|
vAng = vPos;
|
||||||
vAng[2] += 5.0;
|
vAng[2] += 5.0;
|
||||||
|
@ -276,7 +276,7 @@ stock bool SpawnMinigun(const float vPos[3], const float vAng[3]) {
|
||||||
|
|
||||||
|
|
||||||
stock bool GiveClientWeapon(int client, const char[] wpnName, bool lasers) {
|
stock bool GiveClientWeapon(int client, const char[] wpnName, bool lasers) {
|
||||||
char sTemp[64];
|
static char sTemp[64];
|
||||||
float pos[3];
|
float pos[3];
|
||||||
GetClientAbsOrigin(client, pos);
|
GetClientAbsOrigin(client, pos);
|
||||||
Format(sTemp, sizeof(sTemp), "weapon_%s", wpnName);
|
Format(sTemp, sizeof(sTemp), "weapon_%s", wpnName);
|
||||||
|
@ -544,7 +544,7 @@ stock float GetNearestEntityDistance(int originEntity, char[] classname) {
|
||||||
{
|
{
|
||||||
GetEntPropVector(entity, Prop_Send, "m_vecOrigin", entityVecOrigin);
|
GetEntPropVector(entity, Prop_Send, "m_vecOrigin", entityVecOrigin);
|
||||||
distance = GetVectorDistance(compareVec, entityVecOrigin);
|
distance = GetVectorDistance(compareVec, entityVecOrigin);
|
||||||
PrintDebug(DEBUG_SPAWNLOGIC, "Comparing %s (id %d) (%.2f,%.2f,%.2f) distance to entity %d (%.2f,%.2f,%.2f) is %.4f", classname, entity, entityVecOrigin[0], entityVecOrigin[1], entityVecOrigin[2], originEntity, compareVec[0], compareVec[1], compareVec[2], distance);
|
// PrintDebug(DEBUG_SPAWNLOGIC, "Comparing %s (id %d) (%.2f,%.2f,%.2f) distance to entity %d (%.2f,%.2f,%.2f) is %.4f", classname, entity, entityVecOrigin[0], entityVecOrigin[1], entityVecOrigin[2], originEntity, compareVec[0], compareVec[1], compareVec[2], distance);
|
||||||
|
|
||||||
if (distance < nearestDistance || nearestDistance == -1.0)
|
if (distance < nearestDistance || nearestDistance == -1.0)
|
||||||
{
|
{
|
||||||
|
@ -568,7 +568,7 @@ stock int FindNearestEntityInRange(int originEntity, char[] classname, float ran
|
||||||
distance = GetVectorDistance(compareVec, entityVecOrigin);
|
distance = GetVectorDistance(compareVec, entityVecOrigin);
|
||||||
|
|
||||||
if (distance <= range && (distance < nearestDistance || nearestDistance == -1.0)) {
|
if (distance <= range && (distance < nearestDistance || nearestDistance == -1.0)) {
|
||||||
PrintDebug(DEBUG_SPAWNLOGIC, "Comparing %s (id %d) (%.2f,%.2f,%.2f) distance to entity %d (%.2f,%.2f,%.2f) is %.4f", classname, entity, entityVecOrigin[0], entityVecOrigin[1], entityVecOrigin[2], originEntity, compareVec[0], compareVec[1], compareVec[2], distance);
|
// PrintDebug(DEBUG_SPAWNLOGIC, "Comparing %s (id %d) (%.2f,%.2f,%.2f) distance to entity %d (%.2f,%.2f,%.2f) is %.4f", classname, entity, entityVecOrigin[0], entityVecOrigin[1], entityVecOrigin[2], originEntity, compareVec[0], compareVec[1], compareVec[2], distance);
|
||||||
nearestDistance = distance;
|
nearestDistance = distance;
|
||||||
closest = entity;
|
closest = entity;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,6 +98,8 @@ public void __pl_l4dh_SetNTVOptional()
|
||||||
MarkNativeAsOptional("L4D_IsInLastCheckpoint");
|
MarkNativeAsOptional("L4D_IsInLastCheckpoint");
|
||||||
MarkNativeAsOptional("L4D2_IsReachable");
|
MarkNativeAsOptional("L4D2_IsReachable");
|
||||||
MarkNativeAsOptional("L4D_HasPlayerControlledZombies");
|
MarkNativeAsOptional("L4D_HasPlayerControlledZombies");
|
||||||
|
MarkNativeAsOptional("L4D_DetonateProjectile");
|
||||||
|
MarkNativeAsOptional("L4D_TankRockPrj");
|
||||||
MarkNativeAsOptional("L4D_PipeBombPrj");
|
MarkNativeAsOptional("L4D_PipeBombPrj");
|
||||||
MarkNativeAsOptional("L4D_MolotovPrj");
|
MarkNativeAsOptional("L4D_MolotovPrj");
|
||||||
MarkNativeAsOptional("L4D2_VomitJarPrj");
|
MarkNativeAsOptional("L4D2_VomitJarPrj");
|
||||||
|
@ -117,6 +119,8 @@ public void __pl_l4dh_SetNTVOptional()
|
||||||
MarkNativeAsOptional("L4D2_IsTankInPlay");
|
MarkNativeAsOptional("L4D2_IsTankInPlay");
|
||||||
MarkNativeAsOptional("L4D2_GetScriptValueInt");
|
MarkNativeAsOptional("L4D2_GetScriptValueInt");
|
||||||
MarkNativeAsOptional("L4D2_NavAreaTravelDistance");
|
MarkNativeAsOptional("L4D2_NavAreaTravelDistance");
|
||||||
|
MarkNativeAsOptional("L4D2_GetSurvivorSetMod");
|
||||||
|
MarkNativeAsOptional("L4D2_GetSurvivorSetMap");
|
||||||
MarkNativeAsOptional("L4D2_HasConfigurableDifficultySetting");
|
MarkNativeAsOptional("L4D2_HasConfigurableDifficultySetting");
|
||||||
MarkNativeAsOptional("L4D2_IsGenericCooperativeMode");
|
MarkNativeAsOptional("L4D2_IsGenericCooperativeMode");
|
||||||
MarkNativeAsOptional("L4D_IsCoopMode");
|
MarkNativeAsOptional("L4D_IsCoopMode");
|
||||||
|
@ -169,6 +173,7 @@ public void __pl_l4dh_SetNTVOptional()
|
||||||
MarkNativeAsOptional("L4D2_SpawnWitchBride");
|
MarkNativeAsOptional("L4D2_SpawnWitchBride");
|
||||||
|
|
||||||
// l4d2weapons.inc
|
// l4d2weapons.inc
|
||||||
|
MarkNativeAsOptional("L4D_GetWeaponID");
|
||||||
MarkNativeAsOptional("L4D2_IsValidWeapon");
|
MarkNativeAsOptional("L4D2_IsValidWeapon");
|
||||||
MarkNativeAsOptional("L4D2_GetIntWeaponAttribute");
|
MarkNativeAsOptional("L4D2_GetIntWeaponAttribute");
|
||||||
MarkNativeAsOptional("L4D2_GetFloatWeaponAttribute");
|
MarkNativeAsOptional("L4D2_GetFloatWeaponAttribute");
|
||||||
|
@ -347,6 +352,30 @@ enum
|
||||||
STATE_INTRO_CAMERA
|
STATE_INTRO_CAMERA
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// From: https://developer.valvesoftware.com/wiki/L4D2_Director_Scripts
|
||||||
|
// For the "L4D2_ChangeFinaleStage" and "L4D2_GetCurrentFinaleStage" natives and "L4D2_OnChangeFinaleStage" forward.
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
FINALE_GAUNTLET_1 = 0,
|
||||||
|
FINALE_HORDE_ATTACK_1 = 1,
|
||||||
|
FINALE_HALFTIME_BOSS = 2,
|
||||||
|
FINALE_GAUNTLET_2 = 3,
|
||||||
|
FINALE_HORDE_ATTACK_2 = 4,
|
||||||
|
FINALE_FINAL_BOSS = 5,
|
||||||
|
FINALE_HORDE_ESCAPE = 6,
|
||||||
|
FINALE_CUSTOM_PANIC = 7,
|
||||||
|
FINALE_CUSTOM_TANK = 8,
|
||||||
|
FINALE_CUSTOM_SCRIPTED = 9,
|
||||||
|
FINALE_CUSTOM_DELAY = 10,
|
||||||
|
FINALE_CUSTOM_CLEAROUT = 11,
|
||||||
|
FINALE_GAUNTLET_START = 12,
|
||||||
|
FINALE_GAUNTLET_HORDE = 13,
|
||||||
|
FINALE_GAUNTLET_HORDE_BONUSTIME = 14,
|
||||||
|
FINALE_GAUNTLET_BOSS_INCOMING = 15,
|
||||||
|
FINALE_GAUNTLET_BOSS = 16,
|
||||||
|
FINALE_GAUNTLET_ESCAPE = 17
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -687,9 +716,108 @@ forward Action L4D_OnGetMissionVSBossSpawning(float &spawn_pos_min, float &spawn
|
||||||
*
|
*
|
||||||
* @param tank the player who was a tank
|
* @param tank the player who was a tank
|
||||||
* @param newtank a player who has become a new tank
|
* @param newtank a player who has become a new tank
|
||||||
|
*
|
||||||
|
* @noreturn
|
||||||
*/
|
*/
|
||||||
forward void L4D_OnReplaceTank(int tank, int newtank);
|
forward void L4D_OnReplaceTank(int tank, int newtank);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CTankClaw::DoSwing(CTankClaw *this) is invoked
|
||||||
|
* @remarks When a tank is swinging to punch.
|
||||||
|
*
|
||||||
|
* @param tank tank client index
|
||||||
|
* @param rock the claw entity index
|
||||||
|
*
|
||||||
|
* @noreturn
|
||||||
|
*/
|
||||||
|
forward void L4D_TankClaw_DoSwing_Pre(int tank, int claw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CTankClaw::DoSwing(CTankClaw *this) is invoked
|
||||||
|
* @remarks When a tank is swinging to punch.
|
||||||
|
*
|
||||||
|
* @param tank tank client index
|
||||||
|
* @param rock the claw entity index
|
||||||
|
*
|
||||||
|
* @noreturn
|
||||||
|
*/
|
||||||
|
forward void L4D_TankClaw_DoSwing_Post(int tank, int claw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CTankClaw::GroundPound() is invoked
|
||||||
|
* @remarks When hitting the ground (maybe only when hitting an incapped player)
|
||||||
|
* @remarks The forwards "L4D_TankClaw_OnPlayerHit_Pre" and "L4D_TankClaw_OnPlayerHit_Post" trigger after this, allowing identification of victim
|
||||||
|
* @remarks The forwards "L4D_TankClaw_DoSwing_Pre" and "L4D_TankClaw_DoSwing_Post" can trigger after this
|
||||||
|
*
|
||||||
|
* @param tank tank client index
|
||||||
|
* @param rock the claw entity index
|
||||||
|
*
|
||||||
|
* @noreturn
|
||||||
|
*/
|
||||||
|
forward void L4D_TankClaw_GroundPound_Pre(int tank, int claw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CTankClaw::GroundPound() is invoked
|
||||||
|
* @remarks When hitting the ground (maybe only when hitting an incapped player)
|
||||||
|
* @remarks The forwards "L4D_TankClaw_OnPlayerHit_Pre" and "L4D_TankClaw_OnPlayerHit_Post" trigger before this
|
||||||
|
* @remarks The forwards "L4D_TankClaw_DoSwing_Pre" and "L4D_TankClaw_DoSwing_Post" can trigger after this
|
||||||
|
*
|
||||||
|
* @param tank tank client index
|
||||||
|
* @param rock the claw entity index
|
||||||
|
*
|
||||||
|
* @noreturn
|
||||||
|
*/
|
||||||
|
forward void L4D_TankClaw_GroundPound_Post(int tank, int claw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CTankClaw::OnPlayerHit(CTerrorPlayer*, bool) is invoked
|
||||||
|
* @remarks When a tank swings and punches a player.
|
||||||
|
*
|
||||||
|
* @param tank tank client index
|
||||||
|
* @param rock the claw entity index
|
||||||
|
*
|
||||||
|
* @return Plugin_Handled to block the target player from being stumbled, Plugin_Continue otherwise.
|
||||||
|
*/
|
||||||
|
forward Action L4D_TankClaw_OnPlayerHit_Pre(int tank, int claw, int player);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CTankClaw::OnPlayerHit(CTerrorPlayer*, bool) is invoked
|
||||||
|
* @remarks When a tank swings and punches a player.
|
||||||
|
*
|
||||||
|
* @param tank tank client index
|
||||||
|
* @param rock the claw entity index
|
||||||
|
* @param player the player being hit
|
||||||
|
*
|
||||||
|
* @noreturn
|
||||||
|
*/
|
||||||
|
forward void L4D_TankClaw_OnPlayerHit_Post(int tank, int claw, int player);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CTankRock::Detonate() is invoked
|
||||||
|
* @remarks When a tank rock hits something and explodes.
|
||||||
|
*
|
||||||
|
* @param tank tank client index
|
||||||
|
* @param rock the rock entity index
|
||||||
|
*
|
||||||
|
* @noreturn
|
||||||
|
*/
|
||||||
|
forward void L4D_TankRock_OnDetonate(int tank, int rock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CTankRock::OnRelease(Vector const&, QAngle const&, Vector const&, Vector const&) is invoked
|
||||||
|
* @remarks When a tank rock is thrown.
|
||||||
|
*
|
||||||
|
* @param tank tank client index (can be -1 if the rock was created by the native "L4D_TankRockPrj" or the "env_rock_launcher" entity)
|
||||||
|
* @param rock the rock entity index
|
||||||
|
* @param vecPos the position vector of the rock
|
||||||
|
* @param vecAng the angle vector of the rock
|
||||||
|
* @param vecVel the velocity vector of the rock
|
||||||
|
* @param vecRot the rotation vector of the rock
|
||||||
|
*
|
||||||
|
* @return Plugin_Changed to modify the vector values, Plugin_Continue otherwise.
|
||||||
|
*/
|
||||||
|
forward Action L4D_TankRock_OnRelease(int tank, int rock, float vecPos[3], float vecAng[3], float vecVel[3], float vecRot[3]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Called whenever CDirector::TryOfferingTankBot is invoked
|
* @brief Called whenever CDirector::TryOfferingTankBot is invoked
|
||||||
* @remarks Is used for displaying the "X gets Tank" window and transferring Tank control
|
* @remarks Is used for displaying the "X gets Tank" window and transferring Tank control
|
||||||
|
@ -767,6 +895,22 @@ forward Action L4D2_OnSelectTankAttack(int client, int &sequence);
|
||||||
// L4D2 only.
|
// L4D2 only.
|
||||||
forward Action L4D_OnStartMeleeSwing(int client, bool boolean);
|
forward Action L4D_OnStartMeleeSwing(int client, bool boolean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CTerrorMeleeWeapon::GetDamageForVictim() is invoked
|
||||||
|
* @remarks Called to calculate the damage when a melee weapon hits something
|
||||||
|
* @remarks A headshot on Common Infected will still kill them.
|
||||||
|
* @remarks Could maybe set the weapon attribute "L4D2BoolMeleeWeapon_Decapitates" to avoid killing on headshot. Please report success if you try
|
||||||
|
*
|
||||||
|
* @param client the client swinging the melee weapon
|
||||||
|
* @param weapon the weapon entity index
|
||||||
|
* @param victim the victim being hit by the melee weapon
|
||||||
|
* @param damage the amount of damage to inflict on the victim
|
||||||
|
*
|
||||||
|
* @return Plugin_Handled to block, Plugin_Changed to change damage, Plugin_Continue otherwise
|
||||||
|
*/
|
||||||
|
// L4D2 only.
|
||||||
|
forward Action L4D2_MeleeGetDamageForVictim(int client, int weapon, int victim, float &damage);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Called whenever CDirectorScriptedEventManager::SendInRescueVehicle(void) is invoked
|
* @brief Called whenever CDirectorScriptedEventManager::SendInRescueVehicle(void) is invoked
|
||||||
* @remarks Called when the last Finale stage is reached and the Rescue means becomes 'available'.
|
* @remarks Called when the last Finale stage is reached and the Rescue means becomes 'available'.
|
||||||
|
@ -779,11 +923,12 @@ forward Action L4D2_OnSendInRescueVehicle();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Called whenever CDirectorScriptedEventManager::ChangeFinaleStage is invoked
|
* @brief Called whenever CDirectorScriptedEventManager::ChangeFinaleStage is invoked
|
||||||
*
|
|
||||||
* @param FinaleStageType integer value
|
|
||||||
* @remarks Called when the director stage changes
|
* @remarks Called when the director stage changes
|
||||||
* @remarks some values for FinaleStageType: 1 - Finale Started; 6 - Rescue Vehicle Ready; 7 - Zombie Hordes; 8 - Tank; 10 - Combat Respite (nothing spawns)
|
* @remarks some values for FinaleStageType: 1 - Finale Started; 6 - Rescue Vehicle Ready; 7 - Zombie Hordes; 8 - Tank; 10 - Combat Respite (nothing spawns)
|
||||||
* @remarks SendInRescueVehicle does not depend on Finale Stage being 6, that only signals endless Hordes/Tanks
|
* @remarks SendInRescueVehicle does not depend on Finale Stage being 6, that only signals endless Hordes/Tanks
|
||||||
|
* @remarks Can use the "FINALE_*" enums (search for them above) for the finaleType value.
|
||||||
|
*
|
||||||
|
* @param FinaleStageType integer value
|
||||||
*
|
*
|
||||||
* @return Plugin_Handled to block, Plugin_Changed to change finaleType, Plugin_Continue otherwise
|
* @return Plugin_Handled to block, Plugin_Changed to change finaleType, Plugin_Continue otherwise
|
||||||
*/
|
*/
|
||||||
|
@ -958,6 +1103,140 @@ forward Action L4D_OnMaterializeFromGhostPre(int client);
|
||||||
*/
|
*/
|
||||||
forward Action L4D_OnMaterializeFromGhost(int client);
|
forward Action L4D_OnMaterializeFromGhost(int client);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CPipeBombProjectile::Create is invoked
|
||||||
|
* @remarks Called when a PipeBomb projectile is being created
|
||||||
|
*
|
||||||
|
* @param client the client who is throwing the grenade (can be 0)
|
||||||
|
* @param vecPos the position vector of the projectile
|
||||||
|
* @param vecAng the angle vector of the projectile
|
||||||
|
* @param vecVel the velocity vector of the projectile
|
||||||
|
* @param vecRot the rotation vector of the projectile
|
||||||
|
*
|
||||||
|
* @return Plugin_Handled to block the grenade creation, Plugin_Changed to modify the vector values, Plugin_Continue otherwise.
|
||||||
|
*/
|
||||||
|
forward Action L4D_PipeBombProjectile_Pre(int client, float vecPos[3], float vecAng[3], float vecVel[3], float vecRot[3]);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CPipeBombProjectile::Create is invoked
|
||||||
|
* @remarks Called when a PipeBomb projectile has been created
|
||||||
|
*
|
||||||
|
* @param client the client who is throwing the grenade (can be 0)
|
||||||
|
* @param projectile the projectile entity index (can be 0 if blocked in the pre hook)
|
||||||
|
* @param vecPos the position vector of the projectile
|
||||||
|
* @param vecAng the angle vector of the projectile
|
||||||
|
* @param vecVel the velocity vector of the projectile
|
||||||
|
* @param vecRot the rotation vector of the projectile
|
||||||
|
*
|
||||||
|
* @noreturn
|
||||||
|
*/
|
||||||
|
forward void L4D_PipeBombProjectile_Post(int client, int projectile, float vecPos[3], float vecAng[3], float vecVel[3], float vecRot[3]);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CTerrorPlayer::Extinguish() is invoked
|
||||||
|
* @remarks Called when a player (Survivor or Special Infected) is about to be extinguished
|
||||||
|
*
|
||||||
|
* @param client the client who is about to be extinguished
|
||||||
|
*
|
||||||
|
* @return Plugin_Handled to block extinguishing, Plugin_Continue otherwise
|
||||||
|
*/
|
||||||
|
forward Action L4D_PlayerExtinguish(int client);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CBreakableProp::Break() is invoked
|
||||||
|
* @remarks Called when a physics prop is broken
|
||||||
|
* @note When a propanetank explodes, it will create and explode another prop_physics and the attacker entity will be 0. Maybe only L4D2 has this issue.
|
||||||
|
*
|
||||||
|
* @param prop the physics entity index which broke
|
||||||
|
* @param entity the client or entity who caused the prop to break (could be 0)
|
||||||
|
*
|
||||||
|
* @noreturn
|
||||||
|
*/
|
||||||
|
forward void L4D_CBreakableProp_Break(int prop, int entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CGasCan::Event_Killed() is invoked
|
||||||
|
* @remarks Called when a gascan is broken
|
||||||
|
*
|
||||||
|
* @param gascan the gascan entity index
|
||||||
|
*
|
||||||
|
* @noreturn
|
||||||
|
*/
|
||||||
|
// L4D2 only.
|
||||||
|
forward void L4D2_CGasCan_EventKilled(int gascan, int inflictor, int attacker);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CGasCan::OnActionComplete() is invoked
|
||||||
|
* @remarks Called when someone completes pouring a gascan into a nozzle
|
||||||
|
*
|
||||||
|
* @param client the client pouring
|
||||||
|
* @param gascan the gascan entity index that is being consumed
|
||||||
|
* @param nozzle the nozzle being poured into
|
||||||
|
*
|
||||||
|
* @return Plugin_Handled to block adding to Scavenge score (see "Scavenge Score Fix" plugin for more details), Plugin_Continue otherwise
|
||||||
|
*/
|
||||||
|
// L4D2 only.
|
||||||
|
forward Action L4D2_CGasCan_ActionComplete(int client, int gascan, int nozzle);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CInsectSwarm::CanHarm() is invoked
|
||||||
|
* @remarks Called when Spitter Acid is determining if a client or entity can be damaged
|
||||||
|
*
|
||||||
|
* @param acid the acid entity index causing the damage
|
||||||
|
* @param spitter the Spitter or client who created the acid (can be 0)
|
||||||
|
* @param entity the client or entity index being checked if it can be damaged
|
||||||
|
*
|
||||||
|
* @return Plugin_Handled to block allowing damage to an entity, Plugin_Continue otherwise
|
||||||
|
*/
|
||||||
|
// L4D2 only.
|
||||||
|
forward Action L4D2_CInsectSwarm_CanHarm(int acid, int spitter, int entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CTerrorPlayer::OnPouncedOnSurvivor() is invoked
|
||||||
|
* @remarks Called when a Survivor player is about to be pounced on by a Hunter
|
||||||
|
*
|
||||||
|
* @param victim the client who's being pounced
|
||||||
|
* @param attacker the Hunter pouncing on someone
|
||||||
|
*
|
||||||
|
* @return Plugin_Handled to block, Plugin_Continue otherwise
|
||||||
|
*/
|
||||||
|
forward Action L4D_OnPouncedOnSurvivor(int victim, int attacker);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CTerrorPlayer::GrabVictimWithTongue() is invoked
|
||||||
|
* @remarks Called when a Survivor player is about to be grabbed by a Smoker
|
||||||
|
*
|
||||||
|
* @param victim the client who's being grabbed
|
||||||
|
* @param attacker the Smoker grabbing someone
|
||||||
|
*
|
||||||
|
* @return Plugin_Handled to block, Plugin_Continue otherwise
|
||||||
|
*/
|
||||||
|
forward Action L4D_OnGrabWithTongue(int victim, int attacker);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CTerrorPlayer::OnLeptOnSurvivor() is invoked
|
||||||
|
* @remarks Called when a Survivor player is about to be ridden by a Jockey
|
||||||
|
*
|
||||||
|
* @param victim the client who's being grabbed
|
||||||
|
* @param attacker the Jockey grabbing someone
|
||||||
|
*
|
||||||
|
* @return Plugin_Handled to block, Plugin_Continue otherwise
|
||||||
|
*/
|
||||||
|
// L4D2 only.
|
||||||
|
forward Action L4D2_OnJockeyRide(int victim, int attacker);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called whenever CTerrorPlayer::OnStartCarryingVictim() is invoked
|
||||||
|
* @remarks Called when a Survivor player is about to be carried by a Charger
|
||||||
|
*
|
||||||
|
* @param victim the client who's being grabbed
|
||||||
|
* @param attacker the Charger picking up someone
|
||||||
|
*
|
||||||
|
* @return Plugin_Handled to block, Plugin_Continue otherwise
|
||||||
|
*/
|
||||||
|
// L4D2 only.
|
||||||
|
forward Action L4D2_OnStartCarryingVictim(int victim, int attacker);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Called whenever CTerrorPlayer::OnVomitedUpon is invoked
|
* @brief Called whenever CTerrorPlayer::OnVomitedUpon is invoked
|
||||||
* @remarks Called when a Survivor player is covered in Boomer bile, or when using "Bile the World" plugin by "AtomicStryker"
|
* @remarks Called when a Survivor player is covered in Boomer bile, or when using "Bile the World" plugin by "AtomicStryker"
|
||||||
|
@ -971,7 +1250,7 @@ forward Action L4D_OnVomitedUpon(int victim, int &attacker, bool &boomerExplosio
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Called whenever CTerrorPlayer::OnHitByVomitJar is invoked
|
* @brief Called whenever CTerrorPlayer::OnHitByVomitJar is invoked
|
||||||
* @remarks Called a Special Infected is hit from a Bilejar explosion
|
* @remarks Called when a Special Infected is hit from a Bilejar explosion
|
||||||
*
|
*
|
||||||
* @param victim the client who's now it
|
* @param victim the client who's now it
|
||||||
* @param attacker the attacker who caused the vomit
|
* @param attacker the attacker who caused the vomit
|
||||||
|
@ -1026,7 +1305,7 @@ forward void L4D2_OnWaterMove(int client);
|
||||||
*
|
*
|
||||||
* @return Current game mode.
|
* @return Current game mode.
|
||||||
*/
|
*/
|
||||||
forward Action L4D_OnGameModeChange(int gamemode);
|
forward void L4D_OnGameModeChange(int gamemode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Called when CTerrorPlayer::Fling(Vector const&, PlayerAnimEvent_t, CBaseCombatCharacter*, float) is invoked.
|
* @brief Called when CTerrorPlayer::Fling(Vector const&, PlayerAnimEvent_t, CBaseCombatCharacter*, float) is invoked.
|
||||||
|
@ -1339,12 +1618,36 @@ native bool L4D2_IsReachable(int client, const float vecPos[3]);
|
||||||
*/
|
*/
|
||||||
native bool L4D_HasPlayerControlledZombies();
|
native bool L4D_HasPlayerControlledZombies();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Detonates an active grenade projectile
|
||||||
|
* @remarks Can detonate in L4D1 & L4D2: "molotov_projectile", "pipebomb_projectile", "tank_rock"
|
||||||
|
* @remarks Can detonate in L4D2: "vomitjar_projectile", "grenadelauncher_projectile", "spitter_projectile"
|
||||||
|
*
|
||||||
|
* @param entity The projectile entity to detonate
|
||||||
|
*
|
||||||
|
* @noreturn
|
||||||
|
*/
|
||||||
|
native int L4D_DetonateProjectile(int entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Creates an activated Tank Rock projectile.
|
||||||
|
* @remarks It seems when using a Survivor for the client index and hitting another Survivor, the victim will take 1.0 damage (maybe due to friendly fire settings).
|
||||||
|
* @remarks Suggest using an OnTakeDamage hook if you want to apply more damage.
|
||||||
|
*
|
||||||
|
* @param client Client id to attribute the projectile to for damage credit. Passing 0 (world) is allowed
|
||||||
|
* @param vecPos Vector coordinate of the projectile on creation
|
||||||
|
* @param vecAng Vector direction of the projectile
|
||||||
|
*
|
||||||
|
* @return Entity index of the projectile
|
||||||
|
*/
|
||||||
|
native int L4D_TankRockPrj(int client, const float vecPos[3], const float vecAng[3]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creates an activated PipeBomb projectile.
|
* @brief Creates an activated PipeBomb projectile.
|
||||||
* @remarks Does not attach the "Fuse" or "Light" particles, see the "left4dhooks_test" plugin for example on attaching these
|
* @remarks Does not attach the "Fuse" or "Light" particles, see the "left4dhooks_test" plugin for example on attaching these
|
||||||
* @remarks Also used in the "PipeBomb Shove" plugin by Silvers
|
* @remarks Also used in the "PipeBomb Shove" plugin by Silvers
|
||||||
*
|
*
|
||||||
* @param client Client id to attribute the projectile to for damage credit
|
* @param client Client id to attribute the projectile to for damage credit. Passing 0 (world) is allowed
|
||||||
* @param vecPos Vector coordinate of the projectile on creation
|
* @param vecPos Vector coordinate of the projectile on creation
|
||||||
* @param vecAng Vector velocity and direction of the projectile
|
* @param vecAng Vector velocity and direction of the projectile
|
||||||
*
|
*
|
||||||
|
@ -1355,7 +1658,7 @@ native int L4D_PipeBombPrj(int client, const float vecPos[3], const float vecAng
|
||||||
/**
|
/**
|
||||||
* @brief Creates an activated Molotov projectile.
|
* @brief Creates an activated Molotov projectile.
|
||||||
*
|
*
|
||||||
* @param client Client id to attribute the projectile to for damage credit
|
* @param client Client id to attribute the projectile to for damage credit Passing 0 (world) is allowed
|
||||||
* @param vecPos Vector coordinate of the projectile on creation
|
* @param vecPos Vector coordinate of the projectile on creation
|
||||||
* @param vecAng Vector velocity and direction of the projectile
|
* @param vecAng Vector velocity and direction of the projectile
|
||||||
*
|
*
|
||||||
|
@ -1366,7 +1669,7 @@ native int L4D_MolotovPrj(int client, const float vecPos[3], const float vecAng[
|
||||||
/**
|
/**
|
||||||
* @brief Creates an activated VomitJar projectile.
|
* @brief Creates an activated VomitJar projectile.
|
||||||
*
|
*
|
||||||
* @param client Client id to attribute the projectile to for damage credit
|
* @param client Client id to attribute the projectile to for damage credit Passing 0 (world) is allowed
|
||||||
* @param vecPos Vector coordinate of the projectile on creation
|
* @param vecPos Vector coordinate of the projectile on creation
|
||||||
* @param vecAng Vector velocity and direction of the projectile
|
* @param vecAng Vector velocity and direction of the projectile
|
||||||
*
|
*
|
||||||
|
@ -1378,7 +1681,7 @@ native int L4D2_VomitJarPrj(int client, const float vecPos[3], const float vecAn
|
||||||
/**
|
/**
|
||||||
* @brief Creates an activated Grenade Launcher projectile.
|
* @brief Creates an activated Grenade Launcher projectile.
|
||||||
*
|
*
|
||||||
* @param client Client id to attribute the projectile to for damage credit
|
* @param client Client id to attribute the projectile to for damage credit Passing 0 (world) is allowed
|
||||||
* @param vecPos Vector coordinate of the projectile on creation
|
* @param vecPos Vector coordinate of the projectile on creation
|
||||||
* @param vecAng Vector velocity and direction of the projectile
|
* @param vecAng Vector velocity and direction of the projectile
|
||||||
*
|
*
|
||||||
|
@ -1390,7 +1693,7 @@ native int L4D2_GrenadeLauncherPrj(int client, const float vecPos[3], const floa
|
||||||
/**
|
/**
|
||||||
* @brief Creates a Spitter goo projectile.
|
* @brief Creates a Spitter goo projectile.
|
||||||
*
|
*
|
||||||
* @param client Client id to attribute the projectile to for damage credit
|
* @param client Client id to attribute the projectile to for damage credit Passing 0 (world) is allowed
|
||||||
* @param vecPos Vector coordinate of the projectile on creation
|
* @param vecPos Vector coordinate of the projectile on creation
|
||||||
* @param vecAng Vector velocity and direction of the projectile
|
* @param vecAng Vector velocity and direction of the projectile
|
||||||
*
|
*
|
||||||
|
@ -1462,6 +1765,7 @@ native bool L4D_IsFinaleEscapeInProgress();
|
||||||
* @brief Returns the current Finale stage type.
|
* @brief Returns the current Finale stage type.
|
||||||
* @remarks some values for FinaleStageType: 1 - Finale Started; 6 - Rescue Vehicle Ready; 7 - Zombie Hordes; 8 - Tank; 10 - Combat Respite (nothing spawns)
|
* @remarks some values for FinaleStageType: 1 - Finale Started; 6 - Rescue Vehicle Ready; 7 - Zombie Hordes; 8 - Tank; 10 - Combat Respite (nothing spawns)
|
||||||
* @remarks Seems to return 18 for non-finale maps
|
* @remarks Seems to return 18 for non-finale maps
|
||||||
|
* @remarks Can use the "FINALE_*" enums (search for them above) for the finaleType value.
|
||||||
*
|
*
|
||||||
* @return finaleType stage value
|
* @return finaleType stage value
|
||||||
*/
|
*/
|
||||||
|
@ -1516,6 +1820,24 @@ native float L4D2_NavAreaTravelDistance(float startPos[3], float endPos[3], bool
|
||||||
// L4D2 only.
|
// L4D2 only.
|
||||||
native bool L4D2_HasConfigurableDifficultySetting();
|
native bool L4D2_HasConfigurableDifficultySetting();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the maps default Survivor set
|
||||||
|
* @brief Does not return the overridden value when changed from the "L4D_OnGetSurvivorSet" or "L4D_OnFastGetSurvivorSet" forwards.
|
||||||
|
*
|
||||||
|
* @return Maps default survivor set
|
||||||
|
**/
|
||||||
|
// L4D2 only.
|
||||||
|
native int L4D2_GetSurvivorSetMap();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the current Survivor set
|
||||||
|
* @brief Return the current set which may have been overridden if changed in the "L4D_OnGetSurvivorSet" or "L4D_OnFastGetSurvivorSet" forwards.
|
||||||
|
*
|
||||||
|
* @return Maps default survivor set
|
||||||
|
**/
|
||||||
|
// L4D2 only.
|
||||||
|
native int L4D2_GetSurvivorSetMod();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns if the current game mode is Coop/Realism mode.
|
* @brief Returns if the current game mode is Coop/Realism mode.
|
||||||
*
|
*
|
||||||
|
@ -1807,6 +2129,7 @@ native void L4D2_SendInRescueVehicle();
|
||||||
* @remarks Changes the Finale stage
|
* @remarks Changes the Finale stage
|
||||||
* @remarks some values for FinaleStageType: 1 - Finale Started; 6 - Rescue Vehicle Ready; 7 - Zombie Hordes; 8 - Tank; 10 - Combat Respite (nothing spawns)
|
* @remarks some values for FinaleStageType: 1 - Finale Started; 6 - Rescue Vehicle Ready; 7 - Zombie Hordes; 8 - Tank; 10 - Combat Respite (nothing spawns)
|
||||||
* @remarks will fire the forward of the same function
|
* @remarks will fire the forward of the same function
|
||||||
|
* @remarks Can use the "FINALE_*" enums (search for them above) for the finaleType value.
|
||||||
*
|
*
|
||||||
* @param FinaleStageType integer value
|
* @param FinaleStageType integer value
|
||||||
*
|
*
|
||||||
|
@ -2206,7 +2529,7 @@ native float L4D2_ITimerGetElapsedTime(L4D2IntervalTimer timer);
|
||||||
* 2020 Update2: Now works in Left4DHooks. Glitchy animation bug when reloading an already full weapon.
|
* 2020 Update2: Now works in Left4DHooks. Glitchy animation bug when reloading an already full weapon.
|
||||||
* 2021 Update3: Fix plugin for modified ammo clips found here: https://forums.alliedmods.net/showthread.php?t=327105
|
* 2021 Update3: Fix plugin for modified ammo clips found here: https://forums.alliedmods.net/showthread.php?t=327105
|
||||||
|
|
||||||
A note regarding Clipsize: Any nonstandard value will NOT be in effect at weapon pickup, which means the client
|
A note regarding Clipsize: Any non-standard value will NOT be in effect at weapon pickup, which means the client
|
||||||
has to reload once to achieve the modified value. To fix this, add a weapon pickup hook in your plugin (eg "player_use")
|
has to reload once to achieve the modified value. To fix this, add a weapon pickup hook in your plugin (eg "player_use")
|
||||||
and use something like this with a small timer delay of 0.1 seconds or more (dont you love this engine).
|
and use something like this with a small timer delay of 0.1 seconds or more (dont you love this engine).
|
||||||
|
|
||||||
|
@ -2269,6 +2592,16 @@ enum L4D2FloatMeleeWeaponAttributes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the weapon ID for a specific classname
|
||||||
|
* @remarks Can specify either "rifle" or "weapon_rifle" for example
|
||||||
|
*
|
||||||
|
* @param weaponName Weapon classname to check up on
|
||||||
|
*
|
||||||
|
* @return -1 if not found, otherwise returns weaponID
|
||||||
|
*/
|
||||||
|
native int L4D_GetWeaponID(const char[] weaponName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks for a given weapon string to exist in the WeaponInformationDatabase
|
* @brief Checks for a given weapon string to exist in the WeaponInformationDatabase
|
||||||
* @remarks Throws an error if Database is unavailable
|
* @remarks Throws an error if Database is unavailable
|
||||||
|
@ -2277,7 +2610,6 @@ enum L4D2FloatMeleeWeaponAttributes
|
||||||
*
|
*
|
||||||
* @return True if weapon is found, false if not
|
* @return True if weapon is found, false if not
|
||||||
*/
|
*/
|
||||||
// L4D2 only.
|
|
||||||
native bool L4D2_IsValidWeapon(const char[] weaponName);
|
native bool L4D2_IsValidWeapon(const char[] weaponName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2289,7 +2621,6 @@ native bool L4D2_IsValidWeapon(const char[] weaponName);
|
||||||
*
|
*
|
||||||
* @return The value read.
|
* @return The value read.
|
||||||
*/
|
*/
|
||||||
// L4D2 only.
|
|
||||||
native int L4D2_GetIntWeaponAttribute(const char[] weaponName, L4D2IntWeaponAttributes attr);
|
native int L4D2_GetIntWeaponAttribute(const char[] weaponName, L4D2IntWeaponAttributes attr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2301,7 +2632,6 @@ native int L4D2_GetIntWeaponAttribute(const char[] weaponName, L4D2IntWeaponAttr
|
||||||
*
|
*
|
||||||
* @return The value read.
|
* @return The value read.
|
||||||
*/
|
*/
|
||||||
// L4D2 only.
|
|
||||||
native float L4D2_GetFloatWeaponAttribute(const char[] weaponName, L4D2FloatWeaponAttributes attr);
|
native float L4D2_GetFloatWeaponAttribute(const char[] weaponName, L4D2FloatWeaponAttributes attr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2314,7 +2644,6 @@ native float L4D2_GetFloatWeaponAttribute(const char[] weaponName, L4D2FloatWeap
|
||||||
*
|
*
|
||||||
* @noreturn
|
* @noreturn
|
||||||
*/
|
*/
|
||||||
// L4D2 only.
|
|
||||||
native void L4D2_SetIntWeaponAttribute(const char[] weaponName, L4D2IntWeaponAttributes attr, int value);
|
native void L4D2_SetIntWeaponAttribute(const char[] weaponName, L4D2IntWeaponAttributes attr, int value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2327,7 +2656,6 @@ native void L4D2_SetIntWeaponAttribute(const char[] weaponName, L4D2IntWeaponAtt
|
||||||
*
|
*
|
||||||
* @noreturn
|
* @noreturn
|
||||||
*/
|
*/
|
||||||
// L4D2 only.
|
|
||||||
native void L4D2_SetFloatWeaponAttribute(const char[] weaponName, L4D2FloatWeaponAttributes attr, float value);
|
native void L4D2_SetFloatWeaponAttribute(const char[] weaponName, L4D2FloatWeaponAttributes attr, float value);
|
||||||
|
|
||||||
|
|
||||||
|
@ -3319,6 +3647,7 @@ native bool L4D_BecomeGhost(int client);
|
||||||
/**
|
/**
|
||||||
* @brief Enter ghost/dead mode. Some state values may have different results. Unknown.
|
* @brief Enter ghost/dead mode. Some state values may have different results. Unknown.
|
||||||
* @remarks 6 and 8 are commonly used by the game.
|
* @remarks 6 and 8 are commonly used by the game.
|
||||||
|
* @remarks Can use the "STATE_*" enums (search for them above).
|
||||||
*
|
*
|
||||||
* @param client Client ID of the player to affect
|
* @param client Client ID of the player to affect
|
||||||
*
|
*
|
||||||
|
|
4061
scripting/include/left4dhooks_anim.inc
Normal file
4061
scripting/include/left4dhooks_anim.inc
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue