Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*---------------------------------------------------------------------------
- The Entity display: draw HUD information about entities
- ---------------------------------------------------------------------------*/
- local function DrawEntityDisplay()
- local shouldDraw = hook.Call("HUDShouldDraw", GAMEMODE, "DarkRP_EntityDisplay")
- if shouldDraw == false then
- return
- end
- local shootPos = localplayer:GetShootPos()
- local aimVec = localplayer:GetAimVector()
- for k, ply in pairs(player.GetAll()) do
- if not ply:Alive() then
- continue
- end
- local hisPos = ply:GetShootPos()
- --ply.DarkRPVars = ply.DarkRPVars or {}
- --if ply.DarkRPVars.wanted then DrawWantedInfo(ply) end
- if GAMEMODE.Config.globalshow and ply ~= localplayer then
- DrawPlayerInfo(ply)
- elseif not GAMEMODE.Config.globalshow and hisPos:Distance(shootPos) < 400 then
- -- Draw when you're (almost) looking at him
- local pos = hisPos - shootPos
- local unitPos = pos:GetNormalized()
- if unitPos:Dot(aimVec) > 0.95 then
- local trace = util.QuickTrace(shootPos, pos, localplayer)
- if trace.Hit and trace.Entity ~= ply then
- return
- end
- DrawPlayerInfo(ply)
- end
- end
- end
- local tr = localplayer:GetEyeTrace()
- if IsValid(tr.Entity) and tr.Entity:IsOwnable() and tr.Entity:GetPos():Distance(localplayer:GetPos()) < 200 then
- tr.Entity:DrawOwnableInfo()
- end
- end
- /*---------------------------------------------------------------------------
- Actual HUDPaint hook
- ---------------------------------------------------------------------------*/
- function GM:HUDPaint()
- DrawHUD()
- DrawEntityDisplay()
- self.BaseClass:HUDPaint()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement