Advertisement
raizo21

strafe

Nov 30th, 2019
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.91 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <xs>
  4.  
  5.  
  6. const ButtonBits = ( IN_DUCK );
  7.  
  8. new anti_strafes, vlc_1, vlc_2, vlc_3;
  9.  
  10. public plugin_init()
  11. {
  12.     anti_strafes = register_cvar( "str_sp", "0.120" );
  13.     vlc_1 = register_cvar( "sp_str_1", "200.0" );
  14.     vlc_2 = register_cvar( "sp_str_2", "200.0" );
  15.     vlc_3 = register_cvar( "sp_str_3", "200.0" );
  16.  
  17.     register_forward( FM_CmdStart , "fw_FMCmdStart" );
  18. }
  19.  
  20. public fw_FMCmdStart( id , handle , seed )
  21. {
  22.     if ( get_uc( handle , UC_Buttons ) & ButtonBits )
  23.     {
  24.         static Float:Velocity[3]
  25.    
  26.         pev(id, pev_velocity, Velocity)
  27.  
  28.         if (Velocity[0] > get_pcvar_float(vlc_1) || Velocity[1] > get_pcvar_float(vlc_2) || Velocity[2] > get_pcvar_float(vlc_3))  
  29.         {
  30.         xs_vec_mul_scalar( Velocity, get_pcvar_float(anti_strafes), Velocity)
  31.         set_pev(id, pev_velocity, Velocity)
  32.         }
  33.     }
  34.     return FMRES_IGNORED
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement