PHP Code:
new g_MaxPlayers;
public plugin_init()
{
g_MaxPlayers = get_maxplayers();
set_task( 1.0 , "CheckMoving" , 1029 , _, _, "b" );
}
public CheckMoving()
{
static iStillCounter[33];
static Float: fVelocity[3];
static id;
for ( id = 1 ; id <= g_MaxPlayers ; id++ )
{
if ( is_user_alive( id ) )
{
pev( id , pev_velocity , fVelocity );
if ( fVelocity[0] || fVelocity[1] || fVelocity[2] )
{
client_print( id , print_chat , "You are moving" );
iStillCounter[id] = 0;
}
else
{
client_print( id , print_chat , "You are standing still" );
if ( ++iStillCounter[id] >= 3 )
{
client_print( id , print_chat , "Give health" );
}
}
}
}
}
__________________