Guest User

Untitled

a guest
Jun 23rd, 2013
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.21 KB | None | 0 0
  1. MB.AddHook("CreateMove",function(cmd) --Thanks Tyler Wearing!
  2. local lp = MB.lp()
  3. if not MB.shooteveryone then
  4. local trace = util.GetPlayerTrace(lp)
  5. local traceRes = util.TraceLine(trace)
  6. if traceRes.HitNonWorld then
  7. local target = traceRes.Entity
  8. if target:Health() > 0 and IsValid(target) and v ~= lp then
  9. MB.temptarg = target
  10. end
  11. end
  12. if MB.aim and IsValid(MB.targ) and MB.targ:Health() > 0 and table.HasValue(player.GetAll(), MB.targ) then
  13.  
  14. local absVel = MB.targ:GetAbsVelocity() * 0.012
  15. local targpos = MB.targ:EyePos() - absVel + absVel
  16. local angle = Angle(0,0,0)
  17.  
  18. if MB.TTT and IsValid(lp:GetActiveWeapon()) and lp:GetActiveWeapon().Primary then
  19. local Cone = MB.lp():GetActiveWeapon().Primary.Cone
  20. local vecCone = Vector(-1 * Cone, -1 * Cone, 0)
  21. angle = DS_manipulateShot(DS_md5PseudoRandom(DS_getUCMDCommandNumber(cmd)), targpos - lp:EyePos(), vecCone):Angle()
  22. else
  23. angle = (targpos - lp:EyePos()):Angle()
  24. end
  25.  
  26. cmd:SetViewAngles(angle) --Thanks Tyler Wearing!
  27. local tracedata = {}
  28. tracedata.start = lp:EyePos()
  29. tracedata.endpos = MB.targ:EyePos()
  30. tracedata.filter = lp
  31. local traceRes = util.TraceLine(tracedata)
  32. if traceRes.HitNonWorld and traceRes.Entity and IsValid(traceRes.Entity) and MB.shootwhileaim then
  33. cmd:SetButtons(bit.bor(cmd:GetButtons(), IN_ATTACK)) --Thanks Tyler Wearing!
  34. end
  35. else
  36. MB.aim = false
  37. MB.targ = MB.temptarg
  38. end
  39. elseif MB.aim then
  40. for k, v in pairs(player.GetAll()) do
  41. if MB.MESPCheck(v) then
  42. local tracedata = {}
  43. tracedata.start = lp:EyePos()
  44. tracedata.endpos = v:EyePos()
  45. tracedata.filter = lp
  46. local trace = util.TraceLine(tracedata)
  47. if trace.HitNonWorld and trace.Entity == v then
  48. local absVel = v:GetAbsVelocity() * 0.012
  49. local angle = Angle(0,0,0)
  50.  
  51. if MB.TTT and IsValid(lp:GetActiveWeapon()) and lp:GetActiveWeapon().Primary then
  52. local Cone = MB.lp():GetActiveWeapon().Primary.Cone
  53. local vecCone = Vector(-1 * Cone, -1 * Cone, 0)
  54. angle = DS_manipulateShot(DS_md5PseudoRandom(DS_getUCMDCommandNumber(cmd)), (v:EyePos() - absVel + absVel) - lp:EyePos(), vecCone):Angle()
  55. else
  56. angle = ((v:EyePos() - absVel + absVel) - lp:EyePos()):Angle()
  57. end
  58.  
  59. cmd:SetViewAngles(angle)
  60. if trace.HitNonWorld and trace.Entity and IsValid(trace.Entity) and MB.shootwhileaim then
  61. cmd:SetButtons(bit.bor(cmd:GetButtons(), IN_ATTACK)) --Thanks Tyler Wearing!
  62. end
  63. return
  64. end
  65. end
  66. end
  67. end
  68. end)
Advertisement
Add Comment
Please, Sign In to add comment