Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include("shared.lua")
- function ENT:Draw()
- self:DrawModel()
- local ply = LocalPlayer()
- if ply:GetEyeTrace().Entity == self and (self:GetPos():Distance(ply:GetPos())) < 120 then
- local perk = tostring(self:GetNWString("MachineID"))
- local data = ZARP.PerkData[perk] or {}
- local points = data.cost or "Unknown"
- local str = string.format("Press E to buy %s (%s Points)",perk,tostring(points))
- ply.ViewingPerk = true
- ply.ViewingText = str
- else
- ply.ViewingPerk = false
- end
- end
- hook.Add("HUDPaint", "DrawPlayerHUDPerk", function()
- local ply = LocalPlayer()
- if ply.ViewingPerk then
- surface.SetFont("OpenSans24Font")
- local width, height = surface.GetTextSize(ply.ViewingText)
- draw.SimpleTextOutlined(ply.ViewingText, "OpenSans24Font", ScrW()/2-width/2, ScrH()/2-height/2, color_white, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP,1.5,Color(0,0,0))
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment