pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

Lua paste-bin - collaborative debugging tool View Help


Posted by Anonymous on Fri 19th Jan 13:54
download | new post

  1. function ENT:TrackEntity( ent ) //Andyvincents code for top view
  2.  
  3.         if ( !ent || !ent:IsValid() ) then return end
  4.        
  5.         local WPos = ent:GetPos()
  6.         WPos = WPos + Vector( 0, 0, 520 )
  7.  
  8.         if (self.Entity:GetPos() - WPos):Length() > 200 then       
  9.         self.Entity:SetPos(WPos)       
  10.         Msg("to far away!\n")   
  11.         end
  12.        
  13.         local v = ent:GetVelocity()
  14.        
  15.         local adjustVec = Vector(self.Entity:GetPos().x, self.Entity:GetPos().y, self.Entity:GetPos().z)
  16.  
  17. //      if (v.z == 0) then
  18. //            self.Entity:SetPos( adjustVec )
  19. //      end
  20.        
  21.         if (SERVER) then
  22.                 self.Entity:SetLocalVelocity( v )
  23.         end
  24.        
  25.         local Ang = ent:GetPos() - WPos
  26.         Ang = Ang:Angle()
  27.         Ang.Pitch = 45
  28.         self.Entity:SetAngles(Ang)
  29.  
  30. end

Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Use syntax highlighting

To highlight particular lines, prefix each line with @@


Remember my settings