• Old Swep base?
    1 replies, posted
i cannot seem to remember, but a while back there was a swep base, or even just a swep, but when you turned, it swayed the gun and the crosshair, i thought this was in fretta but i couldn't remember, anyone have a link? or know what i'm talking about?
[lua] local WalkTimer = 0 local VelSmooth = 0 local LastStrafeRoll = 0 function GM:CalcView( ply, origin, angle, fov ) if !LocalPlayer():InVehicle() then local vel = ply:GetVelocity() local ang = ply:EyeAngles() VelSmooth = math.Clamp( VelSmooth * 0.9 + vel:Length() * 0.1, 0, 700 ) WalkTimer = WalkTimer + VelSmooth * FrameTime() * 0.05 // Roll on strafe (smoothed) LastStrafeRoll = (LastStrafeRoll * 3) + (ang:Right():DotProduct( vel ) * 0.0001 * VelSmooth * 0.3) LastStrafeRoll = LastStrafeRoll * 0.25 angle.roll = angle.roll + LastStrafeRoll // Roll on steps if ( ply:GetGroundEntity() != NULL ) then angle.roll = angle.roll + math.sin( WalkTimer ) * VelSmooth * 0.000002 * VelSmooth angle.pitch = angle.pitch + math.cos( WalkTimer * 0.5 ) * VelSmooth * 0.000002 * VelSmooth angle.yaw = angle.yaw + math.cos( WalkTimer ) * VelSmooth * 0.000002 * VelSmooth end angle = angle fov = fov return self.BaseClass:CalcView( ply, origin, angle, fov ) end end [/lua]
Sorry, you need to Log In to post a reply to this thread.