Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local up=Vector(0,0,1)
- function GM:UpdateAnimation( ply, velocity, maxseqgroundspeed )
- local len = velocity:Length()
- local movement = 1.0
- if ( len > 0.2 ) then
- movement = ( len / maxseqgroundspeed )
- end
- rate = math.min( movement, 2 )
- // if we're under water we want to constantly be swimming..
- if ( ply:WaterLevel() >= 2 ) then
- rate = math.max( rate * 0.1, 0.1 )
- elseif ( ply:GetMoveType() == MOVETYPE_NOCLIP ) then
- rate = len * 0.00001;
- elseif ( !ply:IsOnGround() && len >= 1000 ) then
- rate = 0.1;
- end
- ply:SetPlaybackRate( rate )
- if ( ply:InVehicle() ) then
- local Vehicle = ply:GetVehicle()
- // We only need to do this clientside..
- if ( CLIENT ) then
- //
- // This is used for the 'rollercoaster' arms
- //
- local Velocity = Vehicle:GetVelocity()
- local fwd=Vehicle:GetUp()
- local dp= fwd:Dot(up)
- local dp2=fwd:Dot(Velocity)
- ply:SetPoseParameter( "vertical_velocity", (dp<0 and dp or 0)+dp2*0.005 )
- // Pass the vehicles steer param down to the player
- local steer = Vehicle:GetPoseParameter( "vehicle_steer" )
- steer = steer * 2 - 1 // convert from 0..1 to -1..1
- ply:SetPoseParameter( "vehicle_steer", steer )
- end
- end
- if ( CLIENT ) then
- GAMEMODE:GrabEarAnimation( ply )
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment