Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Made by Alexander Preda
- local config = {}
- local AvatarLag = 0
- surface.CreateFont("Time", {
- font = "Roboto",
- size = 21,
- weight = 500,
- antialias = false,
- shadow = false,
- outline = false,
- extended = true,
- })
- surface.CreateFont("MN", {
- font = "Roboto",
- size = 19,
- weight = 1000,
- antialias = false,
- shadow = false,
- outline = true,
- extended = true,
- })
- surface.CreateFont("hparmor", {
- font = "Roboto",
- size = 16,
- weight = 600,
- antialias = false,
- shadow = false,
- outline = true,
- extended = true,
- })
- surface.CreateFont("Other", {
- font = "Roboto",
- size = 16,
- weight = 600,
- extended = true,
- })
- surface.CreateFont("Agenda", {
- font = "Roboto",
- size = 21,
- weight = 600,
- antialias = false,
- shadow = false,
- outline = true,
- })
- surface.CreateFont("Agendas", {
- font = "Roboto",
- size = 16,
- weight = 600,
- antialias = false,
- shadow = false,
- outline = true,
- extended = true,
- })
- surface.CreateFont("Up", {
- font = "Roboto",
- size = 29,
- weight = 600,
- extended = true,
- })
- surface.CreateFont( "namef", {
- font = "Roboto",
- size = 21,
- weight = 700,
- blursize = 0,
- scanlines = 0,
- extended = true,
- antialias = true
- })
- surface.CreateFont( "namefsmall", {
- font = "Roboto",
- size = 16,
- weight = 600,
- blursize = 0,
- scanlines = 0,
- extended = true,
- antialias = true
- } )
- surface.CreateFont( "walletf", {
- font = "Roboto",
- size = 16,
- weight = 600,
- blursize = 0,
- scanlines = 0,
- extended = true,
- antialias = true
- })
- surface.CreateFont( "hpf", {
- font = "Roboto", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
- size = 14,
- weight = 600,
- blursize = 0,
- scanlines = 0,
- additive = false,
- extended = true,
- outline = false,
- })
- local bgc = Color( 15, 15, 15, 200 )
- local bgcha = Color( 2, 37, 74, 255 )
- local lc = Color( 0, 0, 0, 250 )
- local tc = Color( 250, 250, 250 )
- local hc = Color( 240, 0, 0 )
- local ac = Color( 0, 0, 240 )
- local greypart = Color(21, 22, 23, 220)
- local redpart = Color(244, 42, 43, 180)
- local hc = Color( 240, 0, 0 )
- local ac = Color( 0, 0, 240 )
- local mainchangable = Color(math.sin( CurTime() * 7 ) * 255,0,0,245)
- local jobchangable = Color(math.sin( CurTime() * 7 ) * 200,220,225)
- local GunIc = Material("icon16/page_white_text.png")
- local scrwhalf = ScrW() / 2
- local scrhhalf = ScrH() / 2
- local ply = LocalPlayer()
- local string = string
- local tostring = tostring
- local scrh20 = ScrH() -20
- local scrw20 = ScrW() -20
- local scrh26 = ScrH() -26
- local scrh110 = ScrH() -110
- local scrw = ScrW()
- local scrh83 = ScrH() -83
- local scrw10 = ScrW() -10
- local scrh75 = ScrH() -75
- local scrh77 = ScrH() -77
- local scrh775 = ScrH() -77.5
- local scrh45 = ScrH() -45
- local scrh27 = ScrH() -27
- local scrh35 = ScrH() -35
- local scrh36 = ScrH() -36
- local scrh32 = ScrH() -32
- local scrh50 = ScrH() -50
- local scrh62 = ScrH() -62
- local scrw140 = ScrW() -140
- local scrw120 = ScrW() -120
- local scrh140 = ScrH() -140
- local scrh109 = ScrH() -109
- local scrh105 = ScrH() -105
- local scrh98 = ScrH() -98
- local scrw356 = ScrW() -356
- local scrwhalf = ScrW() / 2
- // Худ к профам
- local function SJobHud()
- local ply = LocalPlayer()
- if team.GetName(ply:Team()) == "Дворняга" or team.GetName(ply:Team()) == "Полицейский пёс" then
- draw.DrawText( "ВНИМАНИЕ, ВАМ ЗАПРЕЩЕНО РАЗГОВАРИВАТЬ ЛЮДСКОЙ РЕЧЬЮ, Т.К ВЫ ЯВЛЯЕТЕСЬ ЖИВОТНЫМ !!", "Other", 400, scrh20, jobchangable, TEXT_ALIGN_LEFT )
- end
- end
- function MyCalcView(ply, pos, angles, fov)
- local ply = LocalPlayer()
- if team.GetName(ply:Team()) == "Дворняга" or team.GetName(ply:Team()) == "Полицейский пёс" then
- local view = {}
- view.origin = pos-(angles:Forward() * 50)
- view.angles = angles
- view.fov = fov
- return view
- else return
- end
- end
- hook.Add("CalcView", "MyCalcView", MyCalcView)
- hook.Add("ShouldDrawLocalPlayer", "MyHax ShouldDrawLocalPlayer", function(ply) if team.GetName(ply:Team()) == "Дворняга" or team.GetName(ply:Team()) == "Полицейский пёс" then
- return true
- end end)
- local function HealthArmor()
- local ply = LocalPlayer()
- local teampartc = team.GetColor(ply:Team())
- draw.RoundedBox(0, 12, scrh110, 311, 25, greypart) -- behind hp
- draw.RoundedBox(0, 75, scrh83, 248, 76, greypart) -- main box
- draw.RoundedBox(0, 12, scrh83, 60, 76, greypart) -- model box
- draw.RoundedBox(0, 15, scrh75, 55, 60, redpart)
- draw.RoundedBox(0, 80 + 5, scrh45, 200, 2, redpart) -- line 1
- draw.RoundedBox(0, 80 + 5, scrh27, 165, 2, redpart) -- line 2
- draw.RoundedBox(0, scrw140, scrh32, 120, 2, redpart) -- ammo line 1
- local hp = ply:Health()
- local armor = ply:Armor()
- if hp > 0 and hp < 100 then
- draw.RoundedBox( 0, 85, scrh77, 110 * hp / 100, 14, hc)
- draw.SimpleText( hp.."", "hpf", 95, scrh775, tc, TEXT_ALIGN_LEFT)
- end
- if hp >= 100 then
- draw.RoundedBox( 0, 85, scrh77, 110, 14, hc)
- end
- if armor > 0 then
- draw.RoundedBox( 0, 210, scrh77, 110 * armor / 100, 14, ac)
- draw.SimpleText( armor.."", "hpf", 220, scrh775, tc, TEXT_ALIGN_LEFT)
- end
- if armor >= 100 then
- draw.RoundedBox( 0, 210, scrh77, 110, 14, ac)
- end
- local PlayerName = ply:Nick()
- draw.RoundedBox(0, 10 + 3, scrh109, 309, 23, teampartc)
- draw.SimpleText( PlayerName, "namef", 50 + 115 , scrh98, tc, 1, 1)
- -- player model
- if !DermaShown then
- PlayerIcon = vgui.Create("SpawnIcon")
- PlayerIcon:SetPos( 15, scrh75 )
- PlayerIcon:SetSize(60, 60)
- PlayerIcon:SetToolTip("")
- PlayerIcon:SetModel(ply:GetModel())
- DermaShown = true
- end
- PlayerIcon:SetModel(ply:GetModel() or "models/props_junk/watermelon01.mdl")
- -- money
- local Money = ply:getDarkRPVar("money") or 0
- local Salary = ply:getDarkRPVar("salary") or 0
- draw.SimpleText("Кошелёк: "..Money.." руб.", "walletf", 80 + 5, scrh36, tc,TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)
- draw.SimpleText("Зарплата: "..Salary.." руб.","walletf", 80 + 5, scrh26, tc, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
- local job = ply:getDarkRPVar("job") or ""
- draw.SimpleText("Работа: "..job,"walletf", 80 + 5, scrh62, tc, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
- end
- // Время
- local function Time()
- draw.DrawText(os.date( "%H:%M - %d/%m/%Y"), "Time", scrw10, scrh75, tc, TEXT_ALIGN_RIGHT )
- end
- // Ком. час и розыск
- local function Other()
- local ply = LocalPlayer()
- if ply:getDarkRPVar("HasGunlicense")
- then surface.SetDrawColor(255, 255, 255)
- surface.SetMaterial(GunIc)
- surface.DrawTexturedRect(15, scrh105, 16, 16)
- end
- if ply:isWanted() then
- draw.DrawText("Вы находитесь в розыске!", "namef", 16, scrh140, mainchangable, TEXT_ALIGN_LEFT)
- end
- if GetGlobalBool("DarkRP_LockDown") then
- draw.DrawText("Объявлен комендантский час. Пройдите по домам!", "namef", scrwhalf, 10, mainchangable, TEXT_ALIGN_CENTER)
- end
- end
- // Патроны
- local function Ammo()
- local ply = LocalPlayer()
- if IsValid(LocalPlayer():GetActiveWeapon()) then
- local mag_extra = LocalPlayer():GetAmmoCount(LocalPlayer():GetActiveWeapon():GetPrimaryAmmoType())
- local ammo = (math.max((LocalPlayer():GetActiveWeapon():Clip1()), 0)) .. " / " .. mag_extra
- if IsValid(LocalPlayer():GetActiveWeapon()) then
- draw.SimpleText(ply:GetActiveWeapon():GetPrintName(), "namef", scrw20, scrh50, tc, TEXT_ALIGN_RIGHT, 0)
- end
- if ammo != "0 / 0" then
- draw.SimpleText(ammo, "namef", scrw120, scrh35, tc, TEXT_ALIGN_LEFT)
- end
- end
- end
- // Агенда
- local function Agenda()
- ply = LocalPlayer()
- if !agenda then return end
- agendatext = ply:getDarkRPVar("agenda") or ""
- atext = DarkRP.textWrap((agendatext),"Agenda", 395)
- draw.SimpleText(agenda.Title,"Agenda",15,17.5,tc,TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER)
- draw.DrawText(atext,"Agendas",15,35,tc)
- end
- // Панельки над игроком
- local function DrawPlayerInfo(ply)
- local pos = ply:EyePos()
- pos.z = pos.z + 10
- pos = pos:ToScreen()
- pos.y = pos.y - 50
- if ply == LocalPlayer()
- then return end
- draw.DrawText(ply:Nick(), "Up", pos.x, pos.y - 40, tc, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- draw.DrawText(ply:getDarkRPVar("job") or team.GetName(ply:Team()), "Up", pos.x, pos.y - 5, team.GetColor(ply:Team()), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- if ply:getDarkRPVar("wanted") then
- draw.DrawText("Игрок в розыске!", "Up", pos.x, pos.y + 15, tc, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- end
- if ply:getDarkRPVar("HasGunlicense") then
- surface.SetMaterial(GunIc)
- surface.SetDrawColor(tc)
- surface.DrawTexturedRect(pos.x, pos.y - 65, 20, 20)
- end
- end
- local function DrawEntityDisplay()
- local ply = LocalPlayer()
- local shootPos = LocalPlayer():GetShootPos()
- local aimVec = LocalPlayer():GetAimVector()
- for k, ply in pairs(players or player.GetAll()) do
- if not ply:Alive() or ply == LocalPlayer() then continue end
- local hisPos = ply:GetShootPos()
- if GAMEMODE.Config.globalshow then
- DrawPlayerInfo(ply)
- -- Прорисовыается,когда вы смотрите на него
- elseif not GAMEMODE.Config.globalshow and hisPos:DistToSqr(shootPos) < 260000 then
- local pos = hisPos - shootPos
- local unitPos = pos:GetNormalized()
- if unitPos:Dot(aimVec) > 0.8 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:isKeysOwnable() and tr.Entity:GetPos():Distance(LocalPlayer():GetPos()) < 380 then
- tr.Entity:drawOwnableInfo()
- end
- end
- // Сообщение при аресте
- usermessage.Hook("GotArrested", function(msg)
- local StartArrested = CurTime()
- local ArrestedUntil = msg:ReadFloat()
- Arrested = function()
- if (CurTime() - StartArrested <= ArrestedUntil and LocalPlayer():getDarkRPVar("Arrested")) then
- SimpleShadowText("Вы были арестованы на "..string.ToMinutesSeconds(math.ceil(ArrestedUntil - (CurTime() - StartArrested))).."!", "Other", x / 2, 150, colour.pure_white, 100, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
- elseif !LocalPlayer():getDarkRPVar("Arrested") then
- Arrested = function() end
- end
- end
- end)
- //Отображение нотификаций
- local function DisplayNotify(msg)
- local text = msg:ReadString()
- GAMEMODE:AddNotify(text, msg:ReadShort(), msg:ReadLong())
- print(text)
- end
- usermessage.Hook("_Notify", DisplayNotify)
- local function DrawHUD()
- SJobHud()
- HealthArmor()
- Time()
- Other()
- Agenda()
- Ammo()
- DrawEntityDisplay()
- DrawPlayerInfo(ply)
- end
- function GM:HUDDrawTargetID()
- return false
- end
- local hideHUDElements = {
- ["DarkRP_HUD"] = true,
- ["DarkRP_EntityDisplay"] = true,
- ["DarkRP_ZombieInfo"] = false,
- ["DarkRP_LocalPlayerHUD"] = true,
- ["DarkRP_Hungermod"] = true,
- ["DarkRP_Agenda"] = true,
- ["CHudHealth"] = true,
- ["CHudBattery"] = true,
- ["CHudAmmo"] = true,
- ["CHudSecondaryAmmo"] = true
- }
- function PaintHUD()
- DrawHUD()
- end
- hook.Add("HUDPaint","PaintHUD",PaintHUD)
- hook.Add("HUDShouldDraw", "HideDefaultElements", function(name)
- if hideHUDElements[name] then return false end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement