Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SWEP.Offset = {
- Pos = {
- Up = 0,
- Right = 1,
- Forward = -3,
- },
- Ang = {
- Up = 0,
- Right = 0,
- Forward = 0,
- }
- }
- function SWEP:DrawWorldModel( )
- local hand, offset, rotate
- if not IsValid( self.Owner ) then
- self:SetRenderOrigin(self:GetNetworkOrigin())
- self:SetRenderAngles(self:GetNetworkAngles())
- self:DrawModel( )
- return
- end
- if not self.Hand then
- self.Hand = self.Owner:LookupAttachment( "anim_attachment_rh" )
- end
- hand = self.Owner:GetAttachment( self.Hand )
- if not hand then
- self:DrawModel( )
- return
- end
- offset = hand.Ang:Right( ) * self.Offset.Pos.Right + hand.Ang:Forward( ) * self.Offset.Pos.Forward + hand.Ang:Up( ) * self.Offset.Pos.Up
- hand.Ang:RotateAroundAxis( hand.Ang:Right( ), self.Offset.Ang.Right )
- hand.Ang:RotateAroundAxis( hand.Ang:Forward( ), self.Offset.Ang.Forward )
- hand.Ang:RotateAroundAxis( hand.Ang:Up( ), self.Offset.Ang.Up )
- self:SetRenderOrigin( hand.Pos + offset )
- self:SetRenderAngles( hand.Ang )
- self:DrawModel( )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement