Code:
#include <amxmodx>
#include <fakemeta>
new bool:g_up[33];
public plugin_init()
{
register_plugin("PreThink Velocity Test", "0.1", "Exolent");
register_forward(FM_PlayerPreThink, "FwdPlayerPreThink");
}
public client_connect(client)
{
g_up[client] = false;
}
public FwdPlayerPreThink(client)
{
if( !is_user_alive(client) ) return;
new Float:velocity[3];
pev(client, pev_velocity, velocity);
if( velocity[2] <= 0.0 && g_up[client] )
{
// client just now starts to fall after rising
g_up[client] = false;
}
else if( velocity[2] > 0.0 && !g_up[client] )
{
// client just now starts to rise
g_up[client] = true;
if( pev(client, pev_flags) & FL_ONGROUND )
{
client_print(client, print_chat, "You are moving up while on the ground");
}
else
{
client_print(client, print_chat, "You are moving up and not on the ground");
}
}
}
__________________