Advertisement
SHUFEN

Untitled

Mar 13th, 2016
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. #define PAUSE_HOP 0.5
  2.  
  3. public Plugin:myinfo =
  4. {
  5. name = "Anti Bunny Hop",
  6. author = "AlmazON",
  7. description = "Анти Банни-Хоп",
  8. version = "0.1.0-Zombi",
  9. url = " http://www.hlmod.ru"
  10. }
  11.  
  12. new Float:fJumpTime[MAXPLAYERS + 1];
  13. new g_StaminaOffset = -1;
  14.  
  15. public OnPluginStart()
  16. {
  17. HookEvent("player_team", Event_PlayerTeam);
  18. g_StaminaOffset = FindSendPropInfo("CCSPlayer", "m_flStamina");
  19. if (g_StaminaOffset == -1)
  20. {
  21. LogError("\"CCSPlayer::m_flStamina\" could not be found.");
  22. SetFailState("\"CCSPlayer::m_flStamina\" could not be found.");
  23. }
  24. for (new i = 1; i <= MaxClients; ++i) if (IsClientInGame(i) && GetClientTeam(i) == 2) fJumpTime[i] = 1.0;
  25. }
  26.  
  27. public Event_PlayerTeam(Handle:event, String:name[], bool:dontBroadcast)
  28. {
  29. fJumpTime[GetClientOfUserId(GetEventInt(event, "userid"))] = (GetEventInt(event, "team") != 2) ? 0.0 : 1.0;
  30. }
  31.  
  32. public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
  33. {
  34. if(buttons & IN_JUMP && fJumpTime[client] && fJumpTime[client] + PAUSE_HOP > (fJumpTime[client] = GetEngineTime()))
  35. {
  36. //buttons &= ~IN_JUMP;
  37. SetEntDataFloat(client, g_StaminaOffset, 100, true);
  38. return Plugin_Changed;
  39. }
  40. return Plugin_Continue;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement