CapsAdmin

Untitled

May 29th, 2011
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.74 KB | None | 0 0
  1. local default = 1.5
  2.  
  3. -- meta
  4.     local META = FindMetaTable("Player")
  5.  
  6.     function META:SetSuperJumpMultiplier(mult, dont_update_client)
  7.         check(mult, "number")
  8.         check(dont_update_client, "nil", "boolean")
  9.        
  10.         self.super_jump_multiplier = mult
  11.        
  12.         if SERVER and not dont_update_client then
  13.             umsg.Start("bhop", ply)
  14.                 umsg.Float(mult)
  15.             umsg.End()
  16.         end
  17.        
  18.         self:SetDuckSpeed(0.05)
  19.         self:SetUnDuckSpeed(0.05)
  20.     end
  21.    
  22.     function META:GetSuperJumpMultiplier()
  23.         return self.super_jump_multiplier or default
  24.     end
  25. --
  26.  
  27. --[[ hm = hm or "striderbuster_break"
  28. function B(s)
  29.     s = s or hm
  30.     hm = s
  31.     PrecacheParticleSystem(s)
  32.     return hm
  33. end ]]
  34.  
  35. -- hook
  36.     local function Move(ply, data)
  37.         local mult = ply:GetSuperJumpMultiplier()
  38.  
  39.         if mult ~= 1 and ply:IsOnGround() and ply:KeyPressed(IN_JUMP) then
  40.             data:SetVelocity(data:GetVelocity() * mult)
  41.            
  42.             --if not ply:KeyDown(IN_SPEED) then
  43.                 local eye = math.Clamp(ply:EyeAngles().p/89, 0, 1) ^ 3
  44.                 if eye > 0.3 then
  45.                     data:SetVelocity(LerpVector(eye, data:GetVelocity(), Vector(0.5, 0.5, 1) * data:GetVelocity() + Vector(0,0,data:GetVelocity():Length()*0.3)))
  46.                 end
  47.                 --print(B(), B)
  48.                 --if SERVER then ParticleEffect("ExplosionFlash", ply:GetPos(), Angle(0)) end
  49.             --end
  50.         end
  51.        
  52.     end
  53.  
  54.     if SERVER then
  55.         hook.Add("SetupMove", "bhop", Move)
  56.        
  57.         hook.Add("GetFallDamage", "bhop", function(ply)
  58.             if ply:KeyDown(IN_JUMP) then
  59.                 return 0
  60.             end
  61.         end)
  62.     end
  63.    
  64.     if CLIENT then
  65.         hook.Add("Move", "bhop", Move)
  66.        
  67.         usermessage.Hook("bhop", function(u)
  68.             LocalPlayer():SetSuperJumpMultiplier(u:ReadFloat())
  69.         end)
  70.     end
  71. --
  72.  
  73. if SERVER then
  74.     RunConsoleCommand("sv_airaccelerate", "1000000")
  75.     RunConsoleCommand("sv_maxvelocity", "20000")
  76. end
Advertisement
Add Comment
Please, Sign In to add comment