Advertisement
Guest User

Untitled

a guest
May 26th, 2022
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <reapi>
  3.  
  4. new last_stand[33],Float:duck_start_time[33]
  5.  
  6. public plugin_init() {
  7. register_plugin("Anti DD Scroll", "Test", "Test");
  8. RegisterHookChain(RG_CBasePlayer_Duck, "RG_Duck");
  9.  
  10. register_cvar("adds_version", "1.0", FCVAR_SERVER | FCVAR_SPONLY);
  11. }
  12.  
  13. public RG_Duck(id)
  14. {
  15. new button = get_entvar(id, EntVars:var_button); // get_user_button(id)
  16. new oldbutton = get_entvar(id, EntVars:var_oldbuttons); // get_user_oldbutton(id)
  17. if(button & IN_DUCK)
  18. {
  19. if(last_stand[id])
  20. {
  21. duck_start_time[id] = get_gametime();
  22. last_stand[id] = false;
  23. }
  24.  
  25. }
  26. else if(oldbutton & IN_DUCK)
  27. {
  28. if(!last_stand[id])
  29. {
  30. new Float:fGameTime = get_gametime()
  31.  
  32. // So low time, this is scroll for sure, block duck.
  33. if((fGameTime-duck_start_time[id])<0.018)
  34. {
  35. new Float:vVeloc[3];
  36. get_entvar(id, var_velocity, vVeloc);
  37. vVeloc[0] = vVeloc[0]/2;
  38. vVeloc[1] = vVeloc[1]/2;
  39. set_entvar(id, var_velocity, vVeloc);
  40. }
  41. }
  42. last_stand[id] = true;
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement