#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
new g_iVelocity = -1;
public OnPluginStart() g_iVelocity = FindSendPropOffs("CBasePlayer", "m_vecVelocity[0]");
public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
if (IsPlayerAlive(client))
{
static bool:g_InUse[MAXPLAYERS+1], Float:fVelocity[MAXPLAYERS+1][3];
GetEntDataVector(client, g_iVelocity, fVelocity[client]); //Что в этом страшного? (сама функция передает Velocity столько же раз, только в другой плоскости)
if(!g_InUse[client] && (buttons & IN_USE) && !(GetEntityFlags(client) & FL_ONGROUND))
{
if(fVelocity[client][2] < 0.0)
{
fVelocity[client][2] = (fVelocity[client][2] >= -100.0) ? -100.0:(fVelocity[client][2] +50.0);
TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fVelocity[client]);
SetEntDataVector(client, g_iVelocity, fVelocity[client]);
SetEntityGravity(client, 0.1);
g_InUse[client] = true;
}
}
else if (!(buttons & IN_USE) && g_InUse[client])
{
SetEntityGravity(client, 1.0);
g_InUse[client] = false;
}
else if(fVelocity[client][2] >= 0.0) SetEntityGravity(client, 1.0);
}
return Plugin_Continue;
}