HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <reapi>
  3.  
  4. #define MAXJUMPS 2 // maximum jumps
  5.  
  6.  
  7. new const PLUGIN[] = "Multijump"
  8. new const VERSION[] = "1.0"
  9. new const AUTHOR[] = "serfreeman1337" // Reapi modification by mforce
  10.  
  11.  
  12. enum _:jdata {
  13. bool:DOJUMP,
  14. JUMPCOUNT
  15. }
  16.  
  17. new player_jumps[33][jdata]
  18.  
  19. public plugin_init() {
  20. register_plugin(PLUGIN, VERSION, AUTHOR);
  21. RegisterHookChain(RG_CBasePlayer_Jump, "Hook_PlayerJump", false);
  22. }
  23.  
  24. public Hook_PlayerJump(id) {
  25. static bitFlags; bitFlags = get_entvar(id, var_flags)
  26.  
  27. if(~bitFlags & FL_ONGROUND && ~get_entvar(id, var_oldbuttons) & IN_JUMP) {
  28. if(player_jumps[id][JUMPCOUNT] < MAXJUMPS - 1) {
  29. player_jumps[id][DOJUMP] = true
  30. player_jumps[id][JUMPCOUNT] ++
  31. }
  32. }
  33. else if(bitFlags & FL_ONGROUND) {
  34. player_jumps[id][JUMPCOUNT] = 0
  35. }
  36.  
  37. if(player_jumps[id][DOJUMP]) {
  38. static Float:velocity[3]
  39. get_entvar(id, var_velocity, velocity)
  40. velocity[2] = random_float(265.0,285.0)
  41. set_entvar(id, var_velocity, velocity)
  42.  
  43. player_jumps[id][DOJUMP] = false
  44. }
  45. }
  46.  
  47. public client_disconnect(id) {
  48. arrayset(player_jumps[id], 0, jdata)
  49. }