Quote:
Originally Posted by xbatista
Thanks guys, but I think the best way is to use engine function: get_speed(id) > 0
|
PHP Code:
#include <amxmodx>
#include <fakemeta>
new const Version[] = "0.1";
const ButtonBits = ( IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT );
const Float:SlowestRun = 210.0; //vector_length(velocity) returns 210 when running with AWP
public plugin_init()
{
register_plugin( "Detect Moving" , Version , "bugsy" );
register_forward( FM_CmdStart , "fw_FMCmdStart" );
}
public fw_FMCmdStart( id , handle , seed )
{
if ( get_uc( handle , UC_Buttons ) & ButtonBits )
{
static Float:fVelocity[ 3 ];
pev( id , pev_velocity , fVelocity );
client_print( id , print_chat , "You are %s" , ( vector_length( fVelocity ) >= SlowestRun ) ? "running" : "walking" );
}
}
__________________