HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <sdkhooks>
  4.  
  5. #pragma newdecls required
  6. #define PLUGIN_VERSION "2.0"
  7.  
  8. Handle hBhop;
  9. Handle hAutoBhop;
  10. bool CSGO;
  11. int WATER_LIMIT;
  12.  
  13. public Plugin myinfo =
  14. {
  15. name = "[CSS/CS:GO] AbNeR Bunny Hoping",
  16. author = "AbNeR_CSS",
  17. description = "Auto BHOP",
  18. version = PLUGIN_VERSION,
  19. url = "www.tecnohardclan.com"
  20. }
  21.  
  22. public void OnPluginStart()
  23. {
  24. AutoExecConfig(true, "abnerbhop");
  25. CreateConVar("abnerbhop_version", PLUGIN_VERSION, "Bhop Version", FCVAR_NOTIFY|FCVAR_REPLICATED);
  26. hBhop = CreateConVar("abner_bhop", "1", "Enable/disable Plugin", FCVAR_NOTIFY|FCVAR_REPLICATED);
  27. hAutoBhop = CreateConVar("abner_autobhop", "1", "Enable/Disable AutoBhop", FCVAR_NOTIFY|FCVAR_REPLICATED);
  28.  
  29. char theFolder[40];
  30. GetGameFolderName(theFolder, sizeof(theFolder));
  31. CSGO = StrEqual(theFolder, "csgo");
  32. (CSGO) ? (WATER_LIMIT = 2) : (WATER_LIMIT = 1);
  33. }
  34.  
  35. public void OnConfigsExecuted()
  36. {
  37. if(GetConVarInt(hBhop) == 1) BhopOn();
  38. }
  39.  
  40. public void OnClientPutInServer(int client)
  41. {
  42. if(!CSGO)
  43. SDKHook(client, SDKHook_PreThink, PreThink);
  44. }
  45.  
  46. public Action PreThink(int client)
  47. {
  48. if(IsValidClient(client) && IsPlayerAlive(client) && GetConVarInt(hBhop) == 1)
  49. {
  50. SetEntPropFloat(client, Prop_Send, "m_flStamina", 0.0);
  51. }
  52. }
  53.  
  54. void BhopOn()
  55. {
  56. if(!CSGO)
  57. {
  58. SetCvar("sv_enablebunnyhopping", "1");
  59. SetCvar("sv_airaccelerate", "2000");
  60. }
  61. else
  62. {
  63. SetCvar("sv_enablebunnyhopping", "1");
  64. SetCvar("sv_staminamax", "0");
  65. SetCvar("sv_airaccelerate", "2000");
  66. SetCvar("sv_staminajumpcost", "0");
  67. SetCvar("sv_staminalandcost", "0");
  68. }
  69. }
  70.  
  71. stock void SetCvar(char[] scvar, char[] svalue)
  72. {
  73. Handle cvar = FindConVar(scvar);
  74. SetConVarString(cvar, svalue, true);
  75. }
  76.  
  77. public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon)
  78. {
  79. if(GetConVarInt(hBhop) == 1 && GetConVarInt(hAutoBhop) == 1)
  80. if (IsPlayerAlive(client) && buttons & IN_JUMP)
  81. if(!(GetEntityMoveType(client) & MOVETYPE_LADDER) && !(GetEntityFlags(client) & FL_ONGROUND))
  82. if(waterCheck(client) < WATER_LIMIT)
  83. buttons &= ~IN_JUMP;
  84. return Plugin_Continue;
  85. }
  86.  
  87. int waterCheck(int client)
  88. {
  89. return GetEntProp(client, Prop_Data, "m_nWaterLevel");
  90. }
  91.  
  92. stock bool IsValidClient(int client)
  93. {
  94. if(client <= 0 ) return false;
  95. if(client > MaxClients) return false;
  96. if(!IsClientConnected(client)) return false;
  97. return IsClientInGame(client);
  98. }
  99.  
  100.  
  101.  
  102.  
  103.  
  104.