Senior Member
|

06-13-2022
, 05:01
[L4D2] Killing Special Infected Will Boost Your Speed
|
#1
|
Hello Everyone
I was trying to make a plugin by holding shift button, your speed will be boosted, but since shift is meant to slower your speed, the movement was awkward
So, I made a different idea, which is by killing special infected your speed will be boosted for a while then reset
Its kinda still has the same concept of the HEV Suit in Half Life, I tried to make it in a way as if you are wearing the suit and killing the special infected will give you the fuel for it

Features:
- Killing SI Will Boost Your Speed For a Period of Time
- You Can Adjust Your Speed, and Duration
To Do:
- Adding more abilities to the suit > Adjustable (Jump Velocity, Fast Shooting, Fast Reloading, Fast Reviving, Adding +HP After Each kill)
- Cumulative Effect > Ex: Killing 1 SI will give you boost duration for 5 sec, while killing 3 infected at same time will give you 5+5+5 boost duration > I have no idea how to do it
PHP Code:
// This file was auto-generated by SourceMod (v1.11.0.6884) // ConVars for plugin "L4D2_Hazard_Suit.smx"
// Enable/Disable The Hazard Suit Plugin [ 0 = Disable - 1 = Enable ] // - // Default: "1" // Minimum: "0.000000" // Maximum: "1.000000" l4d2_survivor_boost_allowed "1"
// Set the maximum survivor boost speed [ Normal Game Value = 1 ] // - // Default: "1.45" // Minimum: "0.000000" // Maximum: "2.000000" l4d2_survivor_boost_speed "1.45"
// Set the survivor boost speed duration // - // Default: "6.0" l4d2_survivor_boost_duration "6.0"
PHP Code:
#pragma semicolon 1 #pragma newdecls required #include <sdktools> #include <sourcemod>
#define PLUGIN_VERSION "1.0" #define TEAM_SURVIVOR 2 #define TEAM_INFECTED 3
Handle SurvivorBoostAllowed = INVALID_HANDLE; Handle SurvivorSpeed = INVALID_HANDLE; Handle BoostDuration = INVALID_HANDLE;
public Plugin myinfo = { name = "L4D2 Survivor Booster", author = "alasfourom", description = "Boosting Survivors Speed When Killing Special Infected For Specific Duration", version = PLUGIN_VERSION, url = "https://forums.alliedmods.net/" }
public void OnPluginStart() { CreateConVar ("l4d2_hazard_suit_version", PLUGIN_VERSION, "L4D2 Hazard Suit" ,FCVAR_SPONLY|FCVAR_NOTIFY|FCVAR_DONTRECORD); SurvivorBoostAllowed = CreateConVar ("l4d2_survivor_boost_allowed", "1", "Enable/Disable The Hazard Suit Plugin [ 0 = Disable - 1 = Enable ]" ,FCVAR_NOTIFY, true, 0.0, true, 1.0); SurvivorSpeed = CreateConVar ("l4d2_survivor_boost_speed", "1.45", "Set the maximum survivor boost speed [ Normal Game Value = 1 ]" ,FCVAR_NOTIFY, true, 0.0, true, 2.0); BoostDuration = CreateConVar("l4d2_survivor_boost_duration", "6.0", "Set the survivor boost speed duration" ,FCVAR_NOTIFY); AutoExecConfig (true, "L4D2_Hazard_Suit");
HookEvent("player_death", Event_InfectedDeath); }
public void Event_InfectedDeath (Event event, const char[] name, bool dontBroadcast) { int victim = GetClientOfUserId (event.GetInt("userid")); if (IsClient (victim)) { int team = GetClientTeam (victim); if (team == TEAM_INFECTED) if (GetConVarBool(SurvivorBoostAllowed)) { int attacker = GetClientOfUserId (event.GetInt("attacker")); if (IsValidClient (attacker, TEAM_SURVIVOR)) if (!IsFakeClient (attacker)) StartClientEngine (attacker, GetConVarFloat(SurvivorSpeed)); CreateTimer (GetConVarFloat(BoostDuration), StopClientEngine, attacker); } } return; }
stock bool IsClient (int client) { return client > 0 && client <= MaxClients && IsClientInGame (client); }
stock bool IsValidClient(int client, int team) { return client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == team; }
stock int StartClientEngine (int client, float ammount) { SetEntPropFloat (client, Prop_Data, "m_flLaggedMovementValue", ammount); PrintHintText(client, "Your Suit Engine Started"); return true; } public Action StopClientEngine (Handle timer, any client) { SetEntPropFloat (client, Prop_Data, "m_flLaggedMovementValue", 1.0); PrintHintText(client, "Your Suit Engine Stopped"); return Plugin_Handled; }
Last edited by Sillium; 07-20-2022 at 14:20.
Reason: Restore to previous version.
|
|