Advertisement
Guest User

Untitled

a guest
Nov 16th, 2014
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.62 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #pragma semicolon 1
  4.  
  5. #define PLUGIN_VERSION "1.4fix"
  6.  
  7. new Handle:hBhop;
  8. new bool:BhopEnabled;
  9.  
  10. new Handle:hAutoBhop;
  11. new bool:AutoBhopEnabled;
  12.  
  13. new bool:CSS = false;
  14. new bool:CSGO = false;
  15.  
  16. #define WATER_LEVEL_FEET_IN_WATER 1
  17.  
  18. public Plugin:myinfo =
  19. {
  20. name = "[CSS/CS:GO] AbNeR Bunny Hoping",
  21. author = "AbNeR_CSS",
  22. description = "Plugin to bunny in css or csgo",
  23. version = PLUGIN_VERSION,
  24. url = "www.tecnohardclan.com"
  25. }
  26.  
  27. stock Client_GetWaterLevel(client){
  28.  
  29. return GetEntProp(client, Prop_Send, "m_nWaterLevel");
  30. }
  31.  
  32. public OnPluginStart()
  33. {
  34. AutoExecConfig(true, "abnerbhop");
  35. CreateConVar("abnerbhop_version", PLUGIN_VERSION, "Bhop Version", FCVAR_PLUGIN|FCVAR_NOTIFY|FCVAR_REPLICATED);
  36. hBhop = CreateConVar("abner_bhop", "1", "Enable/disable the bunny hopping");
  37. hAutoBhop = CreateConVar("abner_autobhop", "1", "Enable/Disable the auto bunny hopping");
  38.  
  39. HookConVarChange(hBhop, BhopChange);
  40. HookConVarChange(hAutoBhop, AutoBhopChange);
  41.  
  42. BhopEnabled = GetConVarBool(hBhop);
  43. AutoBhopEnabled = GetConVarBool(hAutoBhop);
  44.  
  45. decl String:theFolder[40];
  46. GetGameFolderName(theFolder, sizeof(theFolder));
  47. if(StrEqual(theFolder, "cstrike"))
  48. {
  49. CSS = true;
  50. CSGO = false;
  51. }
  52. else if(StrEqual(theFolder, "csgo"))
  53. {
  54. CSS = false;
  55. CSGO = true;
  56. }
  57.  
  58. if (BhopEnabled)
  59. {
  60. BhopOn();
  61. }
  62. else
  63. {
  64. BhopOff();
  65. }
  66.  
  67. }
  68.  
  69. BhopOff()
  70. {
  71. if(CSS)
  72. {
  73. SetCvar("sv_enablebunnyhopping", "0");
  74. SetCvar("sv_airaccelerate", "10");
  75. BhopEnabled = GetConVarBool(hBhop);
  76. PrintToServer("Bunny Hopping OFF");
  77. }
  78.  
  79. else if(CSGO)
  80. {
  81. SetCvar("sv_enablebunnyhopping", "0");
  82. SetCvar("sv_staminamax", "80");
  83. SetCvar("sv_airaccelerate", "10");
  84. SetCvar("sv_staminajumpcost", ".1");
  85. SetCvar("sv_staminalandcost", ".1");
  86. BhopEnabled = GetConVarBool(hBhop);
  87. PrintToServer("Bunny Hopping OFF");
  88. }
  89. }
  90.  
  91. BhopOn()
  92. {
  93. if(CSS)
  94. {
  95. SetCvar("sv_enablebunnyhopping", "1");
  96. SetCvar("sv_airaccelerate", "2000");
  97. BhopEnabled = GetConVarBool(hBhop);
  98. PrintToServer("Bunny Hopping ON");
  99. }
  100.  
  101. else if(CSGO)
  102. {
  103. SetCvar("sv_enablebunnyhopping", "1");
  104. SetCvar("sv_staminamax", "0");
  105. SetCvar("sv_airaccelerate", "2000");
  106. SetCvar("sv_staminajumpcost", "0");
  107. SetCvar("sv_staminalandcost", "0");
  108. BhopEnabled = GetConVarBool(hBhop);
  109. PrintToServer("Bunny Hopping ON");
  110. }
  111. }
  112.  
  113.  
  114. stock SetCvar(String:scvar[], String:svalue[])
  115. {
  116. new Handle:cvar = FindConVar(scvar);
  117. SetConVarString(cvar, svalue, true);
  118. }
  119.  
  120.  
  121. public BhopChange(Handle:cvar, const String:oldVal[], const String:newVal[])
  122. {
  123. if (StringToInt(oldVal) == 1 && StringToInt(newVal) == 0)
  124. {
  125. BhopOff();
  126. }
  127.  
  128. if (StringToInt(oldVal) == 0 && StringToInt(newVal) == 1)
  129. {
  130. BhopOn();
  131. }
  132. }
  133.  
  134. public AutoBhopChange(Handle:cvar, const String:oldVal[], const String:newVal[])
  135. {
  136. AutoBhopEnabled = GetConVarBool(hAutoBhop);
  137. }
  138.  
  139. public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
  140. {
  141. new index = GetEntProp(client, Prop_Data, "m_nWaterLevel");
  142. new water = EntIndexToEntRef(index);
  143. if (water != INVALID_ENT_REFERENCE)
  144. {
  145. if (IsPlayerAlive(client))
  146. {
  147. if (buttons & IN_JUMP)
  148. {
  149. if (!(Client_GetWaterLevel(client) > WATER_LEVEL_FEET_IN_WATER))
  150. {
  151. if (!(GetEntityMoveType(client) & MOVETYPE_LADDER))
  152. {
  153. SetEntPropFloat(client, Prop_Send, "m_flStamina", 0.0);
  154. if (!(GetEntityFlags(client) & FL_ONGROUND))
  155. {
  156. if(BhopEnabled && AutoBhopEnabled)
  157. {
  158. buttons &= ~IN_JUMP;
  159. }
  160. }
  161. }
  162. }
  163. }
  164. }
  165. }
  166. return Plugin_Continue;
  167. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement