Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function PredictSpread(pCmd, ang)
- // engine nospread (previously posted somewhere)
- if (wep.Base && string.StartWith(wep.Base, "tfa_")) then // remove view punch angles on tfa, this impacts our shoot pos
- local viewPAngles = me:GetViewPunchAngles()
- spreadAngles = spreadAngles - viewPAngles
- end
- spreadAngles:Normalize()
- return spreadAngles:Forward()
- end
- hook.Add("CreateMove", "nospread", function(pCmd)
- if(pCmd:CommandNumber() == 0 or pCmd == nil) then
- return
- end
- local wep = ply:GetActiveWeapon()
- if (IsValid(wep) && wep.Base && string.StartWith(wep.Base, "tfa_")) then
- local cone, recoil = wep:CalculateConeRecoil()
- if (!cone) then return end
- spread[wep:GetClass()] = {
- x = cone,
- y = cone
- }
- end
- if (IsValid(wep) && spread[wep:GetClass()]) then // constant nospread
- local ang = PredictSpread(pCmd, fa):Angle()
- pCmd:SetViewAngles(ang)
- end
- end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement