Advertisement
Guest User

aa

a guest
Feb 25th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.59 KB | None | 0 0
  1. --[[---------------------------------------------------------
  2. Icons
  3. -----------------------------------------------------------]]
  4. local IconHexagon = Material("overwatchhud/hexagon.png", "smooth unlitgeneric")
  5. local IconHexagon2 = Material("overwatchhud/filledhexagon.png", "smooth unlitgeneric")
  6. local IconHealth = Material ("overwatchhud/health.png", "smooth unlitgeneric")
  7. local IconArmor = Material ("overwatchhud/armor.png", "smooth unlitgeneric")
  8. local IconWeapon = Material ("overwatchhud/weapon.png", "smooth unlitgeneric")
  9. local IconAmmo = Material ("overwatchhud/ammo.png", "smooth unlitgeneric")
  10. local IconSalary = Material ("overwatchhud/salary.png", "smooth unlitgeneric")
  11. local IconMoney = Material ("overwatchhud/money.png", "smooth unlitgeneric")
  12. local IconJob = Material ("overwatchhud/job.png", "smooth unlitgeneric")
  13. local IconLockdown = Material ("overwatchhud/lockdown.png", "smooth unlitgeneric")
  14.  
  15.  
  16. --[[---------------------------------------------------------
  17. Noget jeg ikke ved hvad hedder
  18. -----------------------------------------------------------]]
  19. local fisse = {
  20. "weapon_physcannon",
  21. ""
  22. }
  23.  
  24. hook.Add("HUDPaint", "Pik", function(ply)
  25.  
  26. Agenda()
  27. --[[---------------------------------------------------------
  28. Top Middle Bar
  29. -----------------------------------------------------------]]
  30.  
  31. draw.RoundedBox (3, ScrW()*0.5-170, ScrH()*0, 340, 70, Color ( 0, 170, 255, 125) )
  32. draw.RoundedBox (3, ScrW()*0.5-160, ScrH()*0, 320, 60, Color ( 0, 180, 255, 150) )
  33. draw.RoundedBox (3, ScrW()*0.5-150, ScrH()*0, 300, 50, Color ( 0, 190, 255, 255) )
  34. draw.RoundedBox (3, ScrW()*0.5-140, ScrH()*0, 280, 40, Color ( 0, 0, 0, 255) )
  35. draw.DrawText ("Logo/Community Name ", "HudSelectionText", ScrW()*0.5, ScrH()*0.01, Color ( 255, 255, 255, 255), TEXT_ALIGN_CENTER)
  36.  
  37.  
  38. --[[---------------------------------------------------------
  39. Hexagons around the Playermodel
  40. -----------------------------------------------------------]]
  41.  
  42. --> Outside Hexagon
  43. surface.SetDrawColor (0, 130, 178, 125)
  44. surface.SetMaterial (IconHexagon)
  45. surface.DrawTexturedRect(ScrW()*0.0135, ScrH()*0.774, 190, 200)
  46.  
  47. --> Middle Hexagon
  48. surface.SetDrawColor (0, 130, 178, 150)
  49. surface.SetMaterial (IconHexagon)
  50. surface.DrawTexturedRect(ScrW()*0.0215, ScrH()*0.7875, 160, 170)
  51.  
  52. --> First Hexagon
  53. surface.SetDrawColor (0, 155, 255, 255)
  54. surface.SetMaterial (IconHexagon)
  55. surface.DrawTexturedRect(ScrW()*0.027, ScrH()*0.797, 140, 150)
  56.  
  57. -- Black Hexagon
  58. surface.SetDrawColor (119, 87, 0, 255)
  59. surface.SetMaterial (IconHexagon2)
  60. surface.DrawTexturedRect(ScrW()*0.035, ScrH()*0.811, 110, 120)
  61.  
  62. --[[---------------------------------------------------------
  63. Health, Armor, Salary, Money, Job & Weapon/Ammo
  64. -----------------------------------------------------------]]
  65.  
  66. --> Health
  67. local HealthValue = LocalPlayer():Health()*1.464 or 0
  68. draw.RoundedBox(5, ScrW()*0.117, ScrH()-209, 150, 20, Color( 0, 0, 0, 200 ) )
  69. if (HealthValue > 0) then
  70. draw.RoundedBox(5, ScrW()*0.118, ScrH()-207, HealthValue, 16, Color( 255, 0, 0, 150 ) )
  71. end
  72.  
  73. --> Armor
  74. local ArmorValue = LocalPlayer():Armor()*1.464 or 0
  75. draw.RoundedBox(5, ScrW()*0.125, ScrH()-184, 150, 20, Color( 0, 0, 0, 200 ) )
  76. if (ArmorValue > 0) then
  77. draw.RoundedBox(5, ScrW()*0.126, ScrH()-182, ArmorValue, 16, Color( 0, 0, 255, 150 ) )
  78. end
  79.  
  80. --> Salary
  81. draw.RoundedBox(5, ScrW()*0.134, ScrH()-158, 150, 20, Color( 0, 0, 0, 200 ) )
  82. draw.DrawText("$"..(LocalPlayer():getDarkRPVar("salary") or 0), "HudSelectionText", ScrW()*0.136, ScrH()-157, Color ( 255, 255, 255, 255), TEXT_ALIGN_LEFT)
  83.  
  84. --> Money
  85. draw.RoundedBox(5, ScrW()*0.125, ScrH()-132, 150, 20, Color( 0, 0, 0, 200 ) )
  86. draw.DrawText("$"..(LocalPlayer():getDarkRPVar("money") or 0), "HudSelectionText", ScrW()*0.128, ScrH()-131, Color ( 255, 255, 255, 255), TEXT_ALIGN_LEFT)
  87.  
  88. --> Job
  89. draw.RoundedBox(5, ScrW()*0.117, ScrH()-103, 150, 20, Color( 0, 0, 0, 200 ) )
  90. draw.DrawText(""..(LocalPlayer():getDarkRPVar("job") or ""), "HudSelectionText", ScrW()*0.12, ScrH()-102, Color ( 255, 255, 255, 255), TEXT_ALIGN_LEFT)
  91.  
  92. --> Weapon & Ammo
  93. if ( IsValid( LocalPlayer():GetActiveWeapon() ) ) then
  94. draw.RoundedBox(4, ScrW()*0.9, ScrH()-145, 150, 35, Color( 0, 0, 0, 200 ) )
  95. draw.DrawText(""..LocalPlayer():GetActiveWeapon():GetPrintName(), "HudSelectionText", ScrW()*0.937, ScrH()-136, Color( 255, 255, 255, 255), TEXT_ALIGN_CENTER)
  96.  
  97. if not (LocalPlayer():GetActiveWeapon():Clip1() == -1 or LocalPlayer():GetActiveWeapon():GetClass() == "weapon_physcannon") then
  98. draw.RoundedBox(4, ScrW()*0.9, ScrH()-100, 150, 35, Color( 0, 0, 0, 200 ) )
  99. if(LocalPlayer():GetActiveWeapon():Clip1() == -1 or LocalPlayer():GetActiveWeapon():GetClass() == "weapon_physcannon") then
  100. surface.SetDrawColor(255, 255, 255, 255)
  101.  
  102. else
  103.  
  104. draw.DrawText( ""..LocalPlayer():GetActiveWeapon():Clip1().."/"..LocalPlayer():GetAmmoCount(LocalPlayer():GetActiveWeapon():GetPrimaryAmmoType()), "HudSelectionText", ScrW()*0.94, ScrH()-90, Color( 255, 255, 255, 255), TEXT_ALIGN_CENTER)
  105. end
  106. end
  107. end
  108.  
  109. --[[---------------------------------------------------------
  110. Lockdown
  111. -----------------------------------------------------------]]
  112.  
  113. if GetGlobalBool("DarkRP_LockDown") then
  114.  
  115. draw.RoundedBox (5, ScrW()*0.038, ScrH()-260, 95, 20, Color (0, 0, 0, 200))
  116. draw.DrawText ("LOCKDOWN", "HudSelectionText", ScrW()*0.0625, ScrH()-259, Color (255, 255, 255, 255), TEXT_ALIGN_CENTER)
  117.  
  118. --> Lockdown Icon
  119. surface.SetDrawColor (0, 0, 0, 255)
  120. surface.SetMaterial (IconLockdown)
  121. surface.DrawTexturedRect(ScrW()*0.024, ScrH()-263, 25, 25)
  122.  
  123. end
  124.  
  125. --[[---------------------------------------------------------
  126. Icons
  127. -----------------------------------------------------------]]
  128.  
  129. --> Health Icon
  130. surface.SetDrawColor (150, 150, 150, 255)
  131. surface.SetMaterial (IconHealth)
  132. surface.DrawTexturedRect(ScrW()*0.102, ScrH()-211, 24, 24)
  133.  
  134. --> Armor Icon
  135. surface.SetDrawColor (150, 150, 150, 255)
  136. surface.SetMaterial (IconArmor)
  137. surface.DrawTexturedRect(ScrW()*0.110, ScrH()-187, 25, 25)
  138.  
  139. -- Salary Icon
  140. surface.SetDrawColor (0, 0, 0, 255)
  141. surface.SetMaterial (IconSalary)
  142. surface.DrawTexturedRect(ScrW()*0.118, ScrH()-161, 25, 25)
  143.  
  144. --> Money Icon
  145. surface.SetDrawColor (0, 0, 0, 255)
  146. surface.SetMaterial (IconMoney)
  147. surface.DrawTexturedRect(ScrW()*0.110, ScrH()-135, 25, 25)
  148.  
  149. --> Job Icon
  150. surface.SetDrawColor (0, 0, 0, 255)
  151. surface.SetMaterial (IconJob)
  152. surface.DrawTexturedRect(ScrW()*0.102, ScrH()-107, 25, 25)
  153.  
  154. --> Weapon Icon
  155. if ( IsValid( LocalPlayer():GetActiveWeapon() ) ) then
  156. surface.SetDrawColor (255, 255, 255, 255)
  157. surface.SetMaterial (IconWeapon)
  158. surface.DrawTexturedRect(ScrW()*0.885, ScrH()-143, 25, 25)
  159.  
  160. --> Ammo Icon
  161. if not (LocalPlayer():GetActiveWeapon():Clip1() == -1 or LocalPlayer():GetActiveWeapon():GetClass() == "weapon_physcannon") then
  162. surface.SetDrawColor (255, 255, 255, 255)
  163. surface.SetMaterial (IconAmmo)
  164. surface.DrawTexturedRect(ScrW()*0.886, ScrH()-92, 20, 20)
  165. end
  166. end
  167. end)
  168.  
  169. --[[---------------------------------------------------------
  170. Agenda - Andreas Lugter af sæd
  171. -----------------------------------------------------------]]
  172.  
  173. local agendaText
  174. local function Agenda()
  175. local shouldDraw = hook.Call("HUDShouldDraw", GAMEMODE, "DarkRP_Agenda")
  176. if shouldDraw == false then return end
  177.  
  178. local agenda = localplayer:getAgendaTable()
  179. if not agenda then return end
  180. agendaText = agendaText or DarkRP.textWrap((localplayer:getDarkRPVar("agenda") or ""):gsub("//", "\n"):gsub("\\n", "\n"), "DarkRPHUD1", 440)
  181.  
  182. draw.RoundedBox(10, 10, 10, 460, 110, colors.gray1)
  183. draw.RoundedBox(10, 12, 12, 456, 106, colors.gray2)
  184. draw.RoundedBox(10, 12, 12, 456, 20, colors.darkred)
  185.  
  186. draw.DrawNonParsedText(agenda.Title, "DarkRPHUD1", 30, 12, colors.red, 0)
  187. draw.DrawNonParsedText(agendaText, "DarkRPHUD1", 30, 35, colors.white, 0)
  188. end
  189.  
  190. hook.Add("DarkRPVarChanged", "agendaHUD", function(ply, var, _, new)
  191. if ply ~= localplayer then return end
  192. if var == "agenda" and new then
  193. agendaText = DarkRP.textWrap(new:gsub("//", "\n"):gsub("\\n", "\n"), "DarkRPHUD1", 440)
  194. else
  195. agendaText = nil
  196. end
  197.  
  198. if var == "salary" then
  199. salaryText = DarkRP.getPhrase("salary", DarkRP.formatMoney(new), "")
  200. end
  201.  
  202. if var == "job" or var == "money" then
  203. JobWalletText = string.format("%s\n%s",
  204. DarkRP.getPhrase("job", var == "job" and new or localplayer:getDarkRPVar("job") or ""),
  205. DarkRP.getPhrase("wallet", var == "money" and DarkRP.formatMoney(new) or DarkRP.formatMoney(localplayer:getDarkRPVar("money")), "")
  206. )
  207. end
  208. end)
  209.  
  210. --[[---------------------------------------------------------
  211. Playermodel
  212. -----------------------------------------------------------]]
  213.  
  214. hook.Add("HUDPaint", "PlayerModel", function( )
  215. local _p = LocalPlayer( );
  216.  
  217. if ( !IsValid( _p ) ) then return; end
  218.  
  219. local _model = _p:GetModel( );
  220.  
  221. if ( !PlayerModel || !ispanel( PlayerModel ) ) then
  222. PlayerModel = vgui.Create( "DModelPanel" );
  223. PlayerModel:SetModel( _model );
  224. PlayerModel.__Model = _model;
  225. PlayerModel:SetPos( 88, ScrH()-225 );
  226. PlayerModel:SetAnimated( false );
  227. PlayerModel.bAnimated = false;
  228. PlayerModel:SetSize( 66, 120 )
  229. PlayerModel:SetCamPos( Vector( 16, 0, 65 ) );
  230. PlayerModel:SetLookAt( Vector( 0, 0, 65 ) );
  231. PlayerModel:ParentToHUD( );
  232. end
  233.  
  234. function PlayerModel:LayoutEntity(_model)
  235.  
  236. end
  237.  
  238.  
  239.  
  240. if ( _p:GetModel( ) != PlayerModel.__Model ) then
  241. PlayerModel:SetModel( _model );
  242. PlayerModel.__Model = _model;
  243. end
  244.  
  245. end );
  246.  
  247.  
  248. --[[---------------------------------------------------------
  249. Hiding the default scoreboard
  250. -----------------------------------------------------------]]
  251. local hide = {
  252. CHudHealth = true,
  253. CHudBattery = true,
  254. CHudAmmo = true,
  255. CHudSecondaryAmmo = true,
  256. }
  257.  
  258.  
  259. --[[---------------------------------------------------------
  260. Noget jeg ikke ved hvad hedder2.0
  261. -----------------------------------------------------------]]
  262. hook.Add("HUDShouldDraw", "Lort", function(ply)
  263. if (hide[ ply ]) then return false end
  264. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement