2007-02-04 01:16:06 +00:00
|
|
|
|
|
|
|
ENT.Spawnable = false
|
|
|
|
ENT.AdminSpawnable = false
|
|
|
|
|
|
|
|
include('shared.lua')
|
2007-04-30 21:07:03 +00:00
|
|
|
|
2007-05-05 01:54:41 +00:00
|
|
|
--handle overlay text client side instead (TAD2020)
|
2007-04-30 21:07:03 +00:00
|
|
|
function ENT:Think()
|
|
|
|
self.BaseClass.Think(self)
|
|
|
|
|
2007-06-28 06:02:32 +00:00
|
|
|
if (self:GetXYZMode()) then
|
2007-04-30 21:07:03 +00:00
|
|
|
local vel = self.Entity:WorldToLocal(self.Entity:GetVelocity()+self.Entity:GetPos())
|
|
|
|
self:ShowOutput(-vel.y, vel.x, vel.z)
|
|
|
|
else
|
|
|
|
local vel = self.Entity:GetVelocity():Length()
|
|
|
|
self:ShowOutput(vel)
|
|
|
|
end
|
|
|
|
|
|
|
|
self.Entity:NextThink(CurTime()+0.04)
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
|
|
|
function ENT:ShowOutput(x, y, z)
|
|
|
|
local txt
|
|
|
|
if (self:GetXYZMode()) then
|
|
|
|
txt = "Velocity = " .. math.Round((x or 0)*1000)/1000 .. "," .. math.Round((y or 0)*1000)/1000 .. "," .. math.Round((z or 0)*1000)/1000
|
|
|
|
else
|
|
|
|
txt = "Speed = " .. math.Round((x or 0)*1000)/1000
|
|
|
|
end
|
|
|
|
self.Entity:SetNetworkedBeamString( "GModOverlayText", txt )
|
2007-05-16 19:38:34 +00:00
|
|
|
//self.Entity:SetNetworkedString( "GModOverlayText", txt )
|
|
|
|
//self.BaseClass.BaseClass.SetOverlayText( self, txt )
|
2007-04-30 21:07:03 +00:00
|
|
|
end
|