|
Author
|
Message
|
|
Senior Member
|

07-24-2011
, 17:43
Re: get_user_buttom
|
#1
|
Quote:
Originally Posted by Bugsy
Try this. I added extra conditions so if a user is walking\running and collides with a wall to stop him from moving while still holding the move buttons he will become visible again. Remove the client_prints after you test it.
PHP Code:
#include <amxmodx> #include <fakemeta> #include <fun>
new const Version[] = "0.1";
const ButtonBits = ( IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT ); new bool: g_bIsInvisible[ 33 ]; new const Float:g_fSlowestWalk = 108.0;
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 ); if ( vector_length( fVelocity ) >= g_fSlowestWalk ) { if ( !g_bIsInvisible[ id ] ) make_invisble(id) } else { if ( g_bIsInvisible[ id ] ) make_visble(id) } } else { if ( g_bIsInvisible[ id ] ) make_visble(id) } }
public make_invisble(id) { set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0) g_bIsInvisible[ id ] = true; client_print(id,print_chat,"visible=false"); }
public make_visble(id) { set_user_rendering(id, kRenderFxNone, 0,0,0, kRenderNormal, 255) g_bIsInvisible[ id ] = false; client_print(id,print_chat,"visible=true"); }
|
It make Him Invisble When hes moving and visble when hes not xD
|
|
|
|