#include <sourcemod>
#include <sdktools>
public OnPluginStart()
{
HookEvent("weapon_fire", Fire); //Ловим событие
}
public Action:Fire(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (client && IsClientInGame(client))
{
decl String:stuff[30];
GetEventString(event, "weapon", stuff, 30);
if (StrEq, stuff, "awp")) Pussh(client);
}
}
Pussh(client)
{
decl Float:EyeAngles[3];
GetClientEyeAngles(client, EyeAngles);
decl Float:Push[3];
Push[0] = (FloatMul(50.0, Cosine(DegToRad(EyeAngles[1]))));
Push[1] = (FloatMul(50.0, Sine(DegToRad(EyeAngles[1]))));
Push[2] = (FloatMul(50.0, Sine(DegToRad(EyeAngles[0]))));
ScaleVector(Push, -20.0); //20.0 Сила отталкивания
TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, Push);
}