Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define PAUSE_HOP 0.5
- public Plugin:myinfo =
- {
- name = "Anti Bunny Hop",
- author = "AlmazON",
- description = "Анти Банни-Хоп",
- version = "0.1.0-Zombi",
- url = " http://www.hlmod.ru"
- }
- new Float:fJumpTime[MAXPLAYERS + 1];
- new g_StaminaOffset = -1;
- public OnPluginStart()
- {
- HookEvent("player_team", Event_PlayerTeam);
- g_StaminaOffset = FindSendPropInfo("CCSPlayer", "m_flStamina");
- if (g_StaminaOffset == -1)
- {
- LogError("\"CCSPlayer::m_flStamina\" could not be found.");
- SetFailState("\"CCSPlayer::m_flStamina\" could not be found.");
- }
- for (new i = 1; i <= MaxClients; ++i) if (IsClientInGame(i) && GetClientTeam(i) == 2) fJumpTime[i] = 1.0;
- }
- public Event_PlayerTeam(Handle:event, String:name[], bool:dontBroadcast)
- {
- fJumpTime[GetClientOfUserId(GetEventInt(event, "userid"))] = (GetEventInt(event, "team") != 2) ? 0.0 : 1.0;
- }
- public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
- {
- if(buttons & IN_JUMP && fJumpTime[client] && fJumpTime[client] + PAUSE_HOP > (fJumpTime[client] = GetEngineTime()))
- {
- //buttons &= ~IN_JUMP;
- SetEntDataFloat(client, g_StaminaOffset, 100, true);
- return Plugin_Changed;
- }
- return Plugin_Continue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement