I had something similar done already. This works on any Infected ghost, yet i dont see that as disadvantage ^^
EDIT
This is the SM 1.3 Version by the way. Ill put the SM 1.2 Version one post below
For better control, this works so: It amplifies whatever speed you have when pressing ATTACK2 and also jolts you upwards. So you can do minor jumps or huge pounces depending on your running speed.
PHP Code:
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "1.0"
new propinfoghost;
new bool:jumpdelay[MAXPLAYERS+1];
public Plugin:myinfo =
{
name = "L4D_Ghostpounce",
author = " AtomicStryker",
description = "Left 4 Dead Ghost Pounce",
version = PLUGIN_VERSION,
url = ""
}
public OnPluginStart()
{
propinfoghost = FindSendPropInfo("CTerrorPlayer", "m_isGhost");
CreateConVar("l4d_ghostpounce_version", PLUGIN_VERSION, " Ghost Pounce Plugin Version ", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_NOTIFY|FCVAR_DONTRECORD);
}
public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
if (buttons & IN_ATTACK2 && jumpdelay[client] == false)
{
if (!IsClientConnected(client)) return Plugin_Continue;
if (!IsClientInGame(client)) return Plugin_Continue;
if (GetClientTeam(client)!=3) return Plugin_Continue;
if (!IsPlayerSpawnGhost(client)) return Plugin_Continue;
jumpdelay[client] = true;
CreateTimer(1.0, ResetJumpDelay, client);
DoPounce(client);
}
return Plugin_Continue;
}
public Action:DoPounce(any:client)
{
new Float:vec[3];
GetEntPropVector(client, Prop_Data, "m_vecVelocity", vec);
if (vec[2] != 0)
{
PrintCenterText(client, "You must be on even ground to ghost pounce");
return Plugin_Handled;
}
if (vec[0] == 0)
{
PrintCenterText(client, "You must be on the move to ghost pounce");
return Plugin_Handled;
}
if (vec[1] == 0)
{
PrintCenterText(client, "You must be on the move to ghost pounce");
return Plugin_Handled;
}
vec[0] *= 3;
vec[1] *= 3;
vec[2] = 750.0;
TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vec);
return Plugin_Continue;
}
bool:IsPlayerSpawnGhost(client)
{
new isghost = GetEntData(client, propinfoghost, 1);
if (isghost == 1) return true;
else return false;
}
public Action:ResetJumpDelay(Handle:timer, Handle:client)
{
jumpdelay[client] = false;
}