Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Creates a convar (console variable) to disable/enable the ui.
- local d3uiHUDEnable_Sbox = CreateClientConVar( "d3HUD_Enable_Sbox", "1", true, true )
- // This one is for numbers on the health orbs.
- local d3uiHUDHPNum_Sbox = CreateClientConVar( "d3HPNum_enable_Sbox", "0", true, true )
- -- Caches the textures in memory. It's bad to fetch the textures over and over again every single frame.
- -- VMT files have to be used for images that have ditherd, smooth edges that fade to transparency.
- -- PNGs will have some white spots instead of transparent on the edges. Don't know why but they do.
- local healthOverlayTex = Material( "d3hb/d3health", "nocull smooth" ) -- VMT
- local OverlayGoop = Material( "d3hb/d3healthgoop.png", "nocull smooth" ) -- PNG
- local armorOverlayTex = Material( "d3hb/d3armor", "nocull smooth" )
- local armorGoop = Material( "d3hb/d3armorgoop.png", "nocull smooth" )
- local infoOverlay = Material( "d3hb/d3info", "nocull smooth" )
- local infoRadar = Material( "d3hb/d3radar.png", "nocull smooth" )
- local infoHunger = Material( "d3hb/d3hunger.png", "nocull smooth" )
- surface.CreateFont( "MoneyFont_14", {
- font = "Exocet Light",
- size = 14,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- } )
- surface.CreateFont( "MoneyFont_12", {
- font = "Exocet Light",
- size = 10,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- } )
- surface.CreateFont( "WeaponFont", {
- font = "Exocet Light",
- size = 14,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- } )
- surface.CreateFont( "WeaponFont_Small", {
- font = "Exocet Light",
- size = 10,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- } )
- surface.CreateFont( "WeaponFont_Extra_Small", {
- font = "Exocet Light",
- size = 8,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- } )
- surface.CreateFont( "AmmoFont", {
- font = "Exocet Light",
- size = 25,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- } )
- surface.CreateFont( "JobFont_24", {
- font = "Exocet Light",
- size = 24,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- } )
- surface.CreateFont( "JobFont_18", {
- font = "Exocet Light",
- size = 18,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- } )
- surface.CreateFont( "JobFont_14", {
- font = "Exocet Light",
- size = 14,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- } )
- surface.CreateFont( "JobFont_10", {
- font = "Exocet Light",
- size = 10,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- } )
- surface.CreateFont( "JobFont_8", {
- font = "Exocet Light",
- size = 8,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- } )
- /*-------------------------------------------------------------------
- This hook draws Health and Armor.
- -------------------------------------------------------------------*/
- -- These have to be set outside the hook so they don't override everytime.
- local hpsmoothing = 0
- local arsmoothing = 0
- hook.Add( "HUDPaint", "!HUDDiablo", function()
- if GetConVar( "d3HUD_Enable_Sbox" ):GetBool() == false then return end
- local ply = LocalPlayer()
- local w = 512
- local h = 256
- local g = ScrW() / 2
- local y = ScrH() - h + 100
- local z = ScrW() - 620 - g
- -- gets and draws the players job
- darkrpJob = ply:GetUserGroup()
- JobFont = "JobFont_24"
- if string.len( darkrpJob ) > 18 then JobFont = "JobFont_8" elseif string.len( darkrpJob ) > 15 then JobFont = "JobFont_10" elseif string.len( darkrpJob ) > 10 then JobFont = "JobFont_14" elseif string.len( darkrpJob ) > 8 then JobFont = "JobFont_18" end
- -- Number of props spawned and the max.
- -- the # takes the returned table and makes it a number
- -- GetConVar( "sbox_maxprops" ):GetInt()
- -- ply:GetCount( "props" )
- end )
- // I added _Conf to the end of these just incase some other addon messes just happens
- // to have the same variable.
- // Enable this if you use a special hunger mod that has it's own special meter
- // or you want have the default DarkRP hunger mod on but don't want your players
- // to see the UI for it for whaterver reason.
- SpecialHungerMod_Conf = false
- // Set this to 1 (the default) for the players model, 2 for player's steam avatar,
- // 3 for a custom png, 0 for nothing (ugly, but supported).
- ShowHUDModel_Conf = 2
- // Either overwrite the .png in the material/custom folder or change this to
- // your new one. The new one should be 56x56 pixels.
- ShowHUDModelCustomPNG_Conf = "custom/customimage.png" -- default image
- // Incase you think the defaul font (Exocet Light) is unreadable here is a way to
- // change it.
- // Default is "JobFont_14"
- // Options you can choose from by default are here: https://wiki.garrysmod.com/page/Default_Fonts
- AgendaFont_Conf = "JobFont_14"
- local hide = {
- CHudHealth = true,
- CHudBattery = true,
- CHudAmmo = true,
- CHudSecondaryAmmo = true,
- //CHudWeaponSelection = true,
- CHudDeathNotice = true
- //CHudWeapon = true
- }
- surface.CreateFont("ImpactBig", {font = "Impact",
- size = 45,
- weight = 700})
- surface.CreateFont("ImpactSmall", {font = "Impact",
- size = 30,
- weight = 700})
- surface.CreateFont( "RadioFont", {
- font = "Impact",
- extended = false,
- size = 26,
- weight = 7000,
- blursize = 0,
- scanlines = 0,
- antialias = true,
- underline = false,
- italic = false,
- strikeout = false,
- symbol = false,
- rotary = false,
- shadow = false,
- additive = false,
- outline = false,
- } )
- function GM:DrawDeathNotice( x, y )
- end
- hook.Add( "HUDShouldDraw", "HideHUD", function( name )
- if ( hide[ name ] ) then return false end
- end )
- endmessages = {
- {
- main = clang.lang_end1,
- txt = clang.lang_end2,
- clr = gteams.GetColor(TEAM_SCP)
- },
- {
- main = clang.lang_end1,
- txt = clang.lang_end3,
- clr = gteams.GetColor(TEAM_SCP)
- }
- }
- function DrawInfo(pos, txt, clr)
- pos = pos:ToScreen()
- draw.TextShadow( {
- text = txt,
- pos = { pos.x, pos.y },
- font = "HealthAmmo",
- color = clr,
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- end
- hook.Add( "Tick", "966check", function()
- local hide = true
- if LocalPlayer().GTeam == nil then return end
- if LocalPlayer():GTeam() == TEAM_SCP then
- hide = false
- end
- if IsValid(LocalPlayer():GetActiveWeapon()) then
- if LocalPlayer():GetActiveWeapon():GetClass() == "item_nvg" then
- hide = false
- end
- end
- for k,v in pairs(player.GetAll()) do
- if not v.GetNClass then
- player_manager.RunClass( v, "SetupDataTables" )
- end
- if v.GetNClass == nil then return end
- if v:GetNClass() == ROLES.ROLE_SCP966 then
- v:SetNoDraw(hide)
- end
- end
- end )
- local info1 = Material( "breach/info_mtf.png")
- hook.Add( "HUDPaint", "Breach_DrawHUD", function()
- //cam.Start3D()
- // for id, ply in pairs( player.GetAll() ) do
- // if ply:GetNClass() == ROLES.ROLE_SCP966 then
- // ply:DrawModel()
- // end
- // end
- //cam.End3D()
- if disablehud == true then return end
- if POS_914B_BUTTON != nil and isstring(buttonstatus) then
- if LocalPlayer():GetPos():Distance(POS_914B_BUTTON) < 200 then
- DrawInfo(POS_914B_BUTTON, buttonstatus, Color(255,255,255))
- end
- end
- /*
- for k,v in pairs(SPAWN_ARMORS) do
- DrawInfo(v, "Kamizelka", Color(255,255,255))
- end
- for k,v in pairs(SPAWN_FIREPROOFARMOR) do
- DrawInfo(v, "OKamizelka", Color(255,255,255))
- end
- if BUTTONS != nil then
- for k,v in pairs(BUTTONS) do
- DrawInfo(v.pos, v.name, Color(0,255,50))
- end
- for k,v in pairs(SPAWN_KEYCARD2) do
- for _,v2 in pairs(v) do
- DrawInfo(v2, "Karta2", Color(255,255,0))
- end
- end
- for k,v in pairs(SPAWN_KEYCARD3) do
- for _,v2 in pairs(v) do
- DrawInfo(v2, "Karta3", Color(255,120,0))
- end
- end
- for k,v in pairs(SPAWN_KEYCARD4) do
- for _,v2 in pairs(v) do
- DrawInfo(v2, "Karta4", Color(255,0,0))
- end
- end
- for k,v in pairs(SPAWN_SMGS) do
- DrawInfo(v, "SMG", Color(255,255,255))
- end
- for k,v in pairs(SPAWN_RIFLES) do
- DrawInfo(v, "KARABIN", Color(0,255,255))
- end
- end
- */
- /*
- if #player.GetAll() < MINPLAYERS then
- draw.TextShadow( {
- text = "Brak wystarczającej ilości Graczy aby rozpocząć rundę",
- pos = { ScrW() / 2, ScrH() / 15 },
- font = "ImpactBig",
- color = Color(255,255,255),
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- draw.TextShadow( {
- text = "Brak wystarczającej ilości Graczy na serwerze aby rozpocząć rundę",
- pos = { ScrW() / 2, ScrH() / 15 + 45 },
- font = "ImpactSmall",
- color = Color(255,255,255),
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- return
- elseif gamestarted == false then
- draw.TextShadow( {
- text = "Gra rozpoczyna siÄ™",
- pos = { ScrW() / 2, ScrH() / 15 },
- font = "ImpactBig",
- color = Color(255,128,70),
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- draw.TextShadow( {
- text = "Oczekiwanie na start rundy",
- pos = { ScrW() / 2, ScrH() / 15 + 45 },
- font = "ImpactSmall",
- color = Color(255,255,255),
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- return
- end
- */
- if shoulddrawinfo == true then
- local getrl = LocalPlayer():GetNClass()
- for k,v in pairs(ROLES) do
- if v == getrl then
- getrl = k
- end
- end
- for k,v in pairs(clang.starttexts) do
- if k == getrl then
- getrl = v
- break
- end
- end
- local align = 32
- local tcolor = gteams.GetColor(LocalPlayer():GTeam())
- if LocalPlayer():GTeam() == TEAM_CHAOS then
- tcolor = Color(29, 81, 56)
- end
- if getrl[1] != nil then
- draw.TextShadow( {
- text = getrl[1],
- pos = { ScrW() / 2, ScrH() / 15 },
- font = "ImpactBig",
- color = tcolor,
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- end
- for i,txt in ipairs(getrl[2]) do
- draw.TextShadow( {
- text = txt,
- pos = { ScrW() / 2, ScrH() / 15 + 10 + (align * i) },
- font = "ImpactSmall",
- color = Color(255,255,255),
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- end
- /*
- if roundtype != nil then
- draw.TextShadow( {
- text = string.Replace( clang.roundtype, "{type}", roundtype ),
- pos = { ScrW() / 2, ScrH() - 25 },
- font = "ImpactSmall",
- color = Color(255, 130, 0),
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- end
- */
- end
- if isnumber(drawendmsg) then
- local ndtext = clang.lang_end2
- if drawendmsg == 2 then
- ndtext = clang.lang_end3
- end
- //if clang.endmessages[drawendmsg] then
- shoulddrawinfo = false
- draw.TextShadow( {
- text = clang.lang_end1,
- pos = { ScrW() / 2, ScrH() / 15 },
- font = "ImpactBig",
- color = Color(0,255,0),
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- draw.TextShadow( {
- text = ndtext,
- pos = { ScrW() / 2, ScrH() / 15 + 45 },
- font = "ImpactSmall",
- color = Color(255,255,255),
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- for i,txt in ipairs(endinformation) do
- draw.TextShadow( {
- text = txt,
- pos = { ScrW() / 2, ScrH() / 8 + (35 * i)},
- font = "ImpactSmall",
- color = color_white,
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- end
- //else
- // drawendmsg = nil
- //end
- else
- if isnumber(shoulddrawescape) then
- if CurTime() > lastescapegot then
- shoulddrawescape = nil
- end
- if clang.escapemessages[shoulddrawescape] then
- local tab = clang.escapemessages[shoulddrawescape]
- draw.TextShadow( {
- text = tab.main,
- pos = { ScrW() / 2, ScrH() / 15 },
- font = "ImpactBig",
- color = tab.clr,
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- draw.TextShadow( {
- text = string.Replace( tab.txt, "{t}", string.ToMinutesSecondsMilliseconds(esctime) ),
- pos = { ScrW() / 2, ScrH() / 15 + 45 },
- font = "ImpactSmall",
- color = Color(255,255,255),
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- draw.TextShadow( {
- text = tab.txt2,
- pos = { ScrW() / 2, ScrH() / 15 + 75 },
- font = "ImpactSmall",
- color = Color(255,255,255),
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- end
- end
- end
- local ply = LocalPlayer()
- if ply:Alive() == false then return end
- if ply:GTeam() == TEAM_SPEC then
- local ent = ply:GetObserverTarget()
- if IsValid(ent) then
- if ent:IsPlayer() then
- local sw = 350
- local sh = 35
- local sx = ScrW() / 2 - (sw / 2)
- local sy = 0
- draw.RoundedBox(0, sx, sy, sw, sh, Color(50,50,50,255))
- draw.TextShadow( {
- text = string.sub(ent:Nick(), 1, 17),
- pos = { sx + sw / 2, 15 },
- font = "HealthAmmo",
- color = Color(255,255,255),
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- end
- end
- //return
- end
- local wep = nil
- local ammo = -1
- local ammo2 = -1
- local width = 400
- local height = 130
- local role_width = width - 30
- local x,y
- x = 245
- y = ScrH() - height - 15
- local hl = math.Clamp(LocalPlayer():Health(), 1, LocalPlayer():GetMaxHealth()) / LocalPlayer():GetMaxHealth()
- if hl < 0.06 then hl = 0.06 end
- local r,e
- r = 16
- e = ScrH() - height - 60
- local a,q
- a = 266
- q = ScrH() - height - 65
- local widthh = 75
- local heightt = 40
- local name = "Nikt"
- if not ply.GetNClass then
- player_manager.RunClass( ply, "SetupDataTables" )
- elseif LocalPlayer():GTeam() != TEAM_SPEC then
- name = GetLangRole(ply:GetNClass())
- /*
- if ply:GTeam() == TEAM_CHAOS then
- name = GetLangRole(ROLES.ROLE_CHAOS)
- //if ply:GetNClass() == ROLE_MTFNTF then
- // name = "MTF NTF (SPY)"
- //end
- end
- */
- else
- local obs = ply:GetObserverTarget()
- if IsValid(obs) then
- if obs.GetNClass != nil then
- name = GetLangRole(obs:GetNClass())
- ply = obs
- else
- name = GetLangRole(ply:GetNClass())
- end
- else
- name = GetLangRole(ply:GetNClass())
- end
- end
- local color = gteams.GetColor( ply:GTeam() )
- if ply:GTeam() == TEAM_CHAOS then
- color = Color(29, 81, 56)
- end
- draw.RoundedBox(0, a, q, widthh, heightt, Color(64,64,64,200))
- draw.RoundedBox(0, r, e, role_width - 120, 30, color )
- draw.TextShadow( {
- text = name,
- pos = { role_width / 1 - 250, y - 30.5 },
- font = "HealthAmmo",
- color = Color(255,255,255),
- xalign = TEXT_ALIGN_CENTER,
- yalign = TEXT_ALIGN_CENTER,
- }, 2, 255 )
- local tclr = Color(255,255,204)
- draw.TextShadow( {
- text = tostring(string.ToMinutesSeconds( cltime )),
- pos = { width - 128, y - 43 },
- font = "TimeLeft",
- color = tclr,
- xalign = TEXT_ALIGN_TOP,
- yalign = TEXT_ALIGN_TOP,
- }, 2, 255 )
- // ping
- draw.TextShadow( {
- text = "Ping: " .. ply:Ping() , Color( 255, 255, 255, 255 ),
- pos = { width - 307, y + 2 },
- font = "MoneyFont_14",
- color = Color(255,255,255),
- xalign = TEXT_ALIGN_RIGHT,
- yalign = TEXT_ALIGN_RIGHT,
- }, 2, 255 )
- // fps
- draw.TextShadow( {
- text = "FPS: " .. ( math.floor(1/FrameTime()) ) , MoneyFont_14, Color( 255, 255, 255, 255 ),
- pos = { width - 300, y - 12 },
- font = "MoneyFont_14",
- color = Color(255,255,255),
- xalign = TEXT_ALIGN_RIGHT,
- yalign = TEXT_ALIGN_RIGHT,
- }, 2, 255 )
- local w = 512
- local h = 256
- // ranga
- draw.TextShadow( {
- text = darkrpJob, JobFont, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER,
- pos = { width - 180, y - 5 },
- font = "MoneyFont_14",
- color = Color(255,255,255),
- xalign = TEXT_ALIGN_RIGHT,
- yalign = TEXT_ALIGN_RIGHT,
- }, 2, 255 )
- // Health bar
- draw.TextShadow( {
- text = ply:Health(),
- pos = { width - 205, y + 100 },
- font = "HealthAmmo",
- color = Color(255,255,255),
- xalign = TEXT_ALIGN_RIGHT,
- yalign = TEXT_ALIGN_RIGHT,
- }, 2, 255 )
- local ammotext = nil
- local wep = nil
- if ply:GetActiveWeapon() != nil and #ply:GetWeapons() > 0 then
- wep = ply:GetActiveWeapon()
- if wep then
- if wep.Clip1 == nil then return end
- if wep:Clip1() > -1 then
- ammo1 = wep:Clip1()
- ammo2 = ply:GetAmmoCount( wep:GetPrimaryAmmoType() )
- ammotext = ammo1 .. " + ".. ammo2
- end
- end
- end
- if not ammotext then return end
- local am = math.Clamp(wep:Clip1(), 0, wep:GetMaxClip1()) / wep:GetMaxClip1()
- // Ammo
- draw.RoundedBox(0, 18, y + 18, (width - 80) * am, 27, Color(205, 155, 0, 255))
- draw.TextShadow( {
- text = ammotext,
- pos = { width - 286, y + 18 },
- font = "HealthAmmo",
- color = Color(255,255,255),
- xalign = TEXT_ALIGN_RIGHT,
- yalign = TEXT_ALIGN_RIGHT,
- }, 2, 255 )
- end )
- //
- // LOADING MATERIALS
- //
- local ekg_background = Material( "ekg_hud/ekg_hud.png", "nocull" )
- local ekg_stencil = Material( "ekg_hud/ekg_hud_stencil.png", "nocull" )
- local ekg_ammo = Material( "ekg_hud/ekg_ammo.png", "nocull" )
- local ekg_beep = Material( "ekg_hud/beep.png", "nocull")
- local ekg_agenda = Material ( "ekg_hud/ekg_agenda.png", "nocull")
- local ekg_armor_full = Material ( "ekg_hud/ekg_armor_full.png", "nocull")
- local ekg_armor_mid = Material ( "ekg_hud/ekg_armor_mid.png", "nocull")
- local ekg_armor_low = Material ( "ekg_hud/ekg_armor_low.png", "nocull")
- local ekg_hunger_low = Material ( "ekg_hud/ekg_hunger_low.png", "nocull")
- local ekg_hunger_mid = Material ( "ekg_hud/ekg_hunger_mid.png", "nocull")
- local ekg_hunger_high = Material ( "ekg_hud/ekg_hunger_high.png", "nocull")
- //
- // FONTS SETUP
- //
- local ekg_size = 1
- local ekg_height = (ScrH()/4.29)*ekg_size
- local ekg_width = (ScrW()/4.29)*ekg_size
- local beepXsize = 40*ekg_size
- if ScrW() >= 1920 then
- ekg_size = 0.9
- ekg_height = (ScrH()/4.29)*0.75
- ekg_width = (ScrW()/4.29)*0.75
- beepXsize = 40*ekg_size
- elseif ScrW() >= 1600 then
- ekg_size = 0.95
- ekg_height = (ScrH()/4.29)*ekg_size
- ekg_width = (ScrW()/4.29)*ekg_size
- beepXsize = 40*ekg_size
- elseif ScrW() >= 1280 && ScrW() < 1600 then
- ekg_size = 0.8
- ekg_height = (ScrH()/4.29)
- ekg_width = (ScrW()/4.29)
- beepXsize = 35*ekg_size
- end
- local ekg_scale = 1.75
- local ekg_scale_global = ScrW()/(367*ekg_scale)
- surface.CreateFont( "ekg_font_ammo",
- {
- font = "8BIT WONDER",
- size = 18/ekg_scale,
- weight = 250,
- antialias = true,
- strikeout = true,
- additive = false,
- blursize = 0,
- } )
- surface.CreateFont( "ekg_font",
- {
- font = "8BIT WONDER",
- size = (26/ekg_scale)*ekg_size,
- weight = 250,
- antialias = true,
- strikeout = true,
- additive = true,
- blursize = 0,
- } )
- surface.CreateFont( "ekg_font_primary_ammo",
- {
- font = "8BIT WONDER",
- size = 64/ekg_scale,
- weight = 100,
- antialias = true,
- strikeout = true,
- additive = true,
- blursize = 1,
- } )
- surface.CreateFont( "ekg_agenda_font",
- {
- font = "8BIT WONDER",
- size = 20/ekg_scale,
- weight = 250,
- antialias = true,
- strikeout = true,
- additive = true,
- blursize = 0,
- } )
- local currentHealth = 0
- local blur = Material( "pp/blurscreen" )
- local function blur_kek( x, y, w, h, layers, density, alpha )
- surface.SetDrawColor( 255, 255, 255, alpha )
- surface.SetMaterial( blur )
- for i = 1, layers do
- blur:SetFloat( "$blur", ( i / layers ) * density )
- blur:Recompute()
- render.UpdateScreenEffectTexture()
- render.SetScissorRect( x, y, x + w, y + h, true )
- surface.DrawTexturedRect( 0, 0, ScrW(), ScrH() )
- render.SetScissorRect( 0, 0, 0, 0, false )
- end
- end
- local function getClip()
- if IsValid(LocalPlayer():GetActiveWeapon()) then
- if LocalPlayer():GetActiveWeapon():Clip1() >= 0 then
- return LocalPlayer():GetActiveWeapon():Clip1() or ""
- end
- end
- return ""
- end
- local beepStartPosX = (ScrW() - ScrW() + 15)
- local beepEndPosX = (ekg_width-beepXsize)+10*ekg_size
- local beepCurPosX = (ScrW() - ScrW() + 15)
- local beepStartPosY = ScrH() - ekg_height/2.75
- //local beepStartPosY = ScrH() - ekg_height/2.75
- local beepEndPosY = ScrH() - ekg_height/1.75
- local beepCurPosY = ScrH() - ekg_height/2.75
- local testBeepX = 1
- local testBeepY = 1
- //
- // BEEP POSITION
- //
- local function beepPositionX()
- beepCurPosX = math.Approach( beepCurPosX, beepEndPosX, 0.155 * ( 100 / LocalPlayer():Health() ))
- if beepCurPosX >= beepEndPosX then
- beepCurPosX = beepStartPosX
- end
- return beepCurPosX
- end
- hook.Add( "HUDPaint", "ekg_hud", function()
- if !LocalPlayer():Alive() then return end
- LocalPlayer().DarkRPVars = LocalPlayer().DarkRPVars or {}
- LocalPlayer().DarkRPVars.money = LocalPlayer().DarkRPVars.money or 0
- LocalPlayer().DarkRPVars.salary = LocalPlayer().DarkRPVars.salary or 0
- //if ekgEnergy then
- LocalPlayer().DarkRPVars.Energy = LocalPlayer().DarkRPVars.Energy or 0
- //return end
- // ekgSize()
- //gui.MouseX()
- //draw.SimpleText( "X- " .. gui.MouseX(), "ekg_font", 25, 25, Color(57, 255, 66, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM )
- //draw.SimpleText( "Y- " .. gui.MouseY(), "ekg_font", 25, 45, Color(57, 255, 66, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM )
- //HUD GRAPHICS
- //
- surface.SetDrawColor( 255, 255, 255, 255 )
- surface.SetMaterial( ekg_background )
- surface.DrawTexturedRect( ScrW() - ScrW() +10, ScrH() - ekg_height -10, ekg_width, ekg_height )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement