I've found this:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new g_bSlomo
#define SetUserSlomo(%1) g_bSlomo |= 1<<( %1 & 31 )
#define ClearUserSlomo(%1) g_bSlomo &= ~( 1<<( %1 & 31 ) )
#define HasUserSlomo(%1) g_bSlomo & 1<<( %1 & 31 )
new g_SlowMotionRate
new g_iPlayerPreThink
public plugin_init()
{
register_plugin( "Death Slow Motion", "2.1.0", "ConnorMcLeod" )
RegisterHam( Ham_Spawn, "player", "Player_Spawn_Post", 1 )
RegisterHam( Ham_Killed, "player", "Player_Killed_Post", 1 )
g_SlowMotionRate = register_cvar( "hs_slowmo_rate", "1.0" )
}
public client_putinserver( id )
{
PlayerClear( id )
}
public client_disconnect( id )
{
PlayerClear( id )
}
public Player_Spawn_Post( id )
{
PlayerClear( id )
}
public Player_Killed_Post( id )
{
SetUserSlomo( id )
set_pev( id, pev_gravity, 0.3 )
new Float:fVecVelocity[ 3 ], Float:flRate = get_pcvar_float( g_SlowMotionRate )
pev( id, pev_velocity, fVecVelocity )
fVecVelocity[ 0 ] /= flRate
fVecVelocity[ 1 ] /= flRate
set_pev( id, pev_velocity, fVecVelocity )
if( !g_iPlayerPreThink )
{
g_iPlayerPreThink = register_forward( FM_PlayerPreThink, "PlayerPreThink" )
}
}
PlayerClear( id )
{
ClearUserSlomo( id )
if( !g_bSlomo && g_iPlayerPreThink )
{
unregister_forward( FM_PlayerPreThink, g_iPlayerPreThink )
g_iPlayerPreThink = 0
}
}
public PlayerPreThink( id )
{
if( ~HasUserSlomo( id ) )
{
return
}
if( pev( id, pev_deadflag ) == DEAD_DEAD )
{
PlayerClear( id )
return
}
set_pev( id, pev_framerate, get_pcvar_float( g_SlowMotionRate ) )
}
But in falling sometimes it's getting bugged, for example, it pulls you to one side and you fall after this and if it's possible can someone make it only for headshots?