Advertisement
PredaCarbon

Untitled

Sep 21st, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.82 KB | None | 0 0
  1. // Made by Alexander Preda
  2.  
  3. local config = {}
  4. local AvatarLag = 0
  5.  
  6. surface.CreateFont("Time", {
  7. font = "Roboto",
  8. size = 21,
  9. weight = 500,
  10. antialias = false,
  11. shadow = false,
  12. outline = false,
  13. extended = true,
  14. })
  15. surface.CreateFont("MN", {
  16.  
  17. font = "Roboto",
  18. size = 19,
  19. weight = 1000,
  20. antialias = false,
  21. shadow = false,
  22. outline = true,
  23. extended = true,
  24. })
  25. surface.CreateFont("hparmor", {
  26.  
  27. font = "Roboto",
  28. size = 16,
  29. weight = 600,
  30. antialias = false,
  31. shadow = false,
  32. outline = true,
  33. extended = true,
  34. })
  35. surface.CreateFont("Other", {
  36. font = "Roboto",
  37. size = 16,
  38. weight = 600,
  39. extended = true,
  40. })
  41. surface.CreateFont("Agenda", {
  42.  
  43. font = "Roboto",
  44. size = 21,
  45. weight = 600,
  46. antialias = false,
  47. shadow = false,
  48. outline = true,
  49.  
  50. })
  51. surface.CreateFont("Agendas", {
  52. font = "Roboto",
  53. size = 16,
  54. weight = 600,
  55. antialias = false,
  56. shadow = false,
  57. outline = true,
  58. extended = true,
  59. })
  60. surface.CreateFont("Up", {
  61. font = "Roboto",
  62. size = 29,
  63. weight = 600,
  64. extended = true,
  65. })
  66. surface.CreateFont( "namef", {
  67. font = "Roboto",
  68. size = 21,
  69. weight = 700,
  70. blursize = 0,
  71. scanlines = 0,
  72. extended = true,
  73. antialias = true
  74. })
  75. surface.CreateFont( "namefsmall", {
  76. font = "Roboto",
  77. size = 16,
  78. weight = 600,
  79. blursize = 0,
  80. scanlines = 0,
  81. extended = true,
  82. antialias = true
  83. } )
  84. surface.CreateFont( "walletf", {
  85. font = "Roboto",
  86. size = 16,
  87. weight = 600,
  88. blursize = 0,
  89. scanlines = 0,
  90. extended = true,
  91. antialias = true
  92. })
  93. surface.CreateFont( "hpf", {
  94. font = "Roboto", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
  95. size = 14,
  96. weight = 600,
  97. blursize = 0,
  98. scanlines = 0,
  99. additive = false,
  100. extended = true,
  101. outline = false,
  102. })
  103.  
  104. local bgc = Color( 15, 15, 15, 200 )
  105. local bgcha = Color( 2, 37, 74, 255 )
  106. local lc = Color( 0, 0, 0, 250 )
  107. local tc = Color( 250, 250, 250 )
  108. local hc = Color( 240, 0, 0 )
  109. local ac = Color( 0, 0, 240 )
  110. local greypart = Color(21, 22, 23, 220)
  111. local redpart = Color(244, 42, 43, 180)
  112. local hc = Color( 240, 0, 0 )
  113. local ac = Color( 0, 0, 240 )
  114. local mainchangable = Color(math.sin( CurTime() * 7 ) * 255,0,0,245)
  115. local jobchangable = Color(math.sin( CurTime() * 7 ) * 200,220,225)
  116. local GunIc = Material("icon16/page_white_text.png")
  117. local scrwhalf = ScrW() / 2
  118. local scrhhalf = ScrH() / 2
  119. local ply = LocalPlayer()
  120. local string = string
  121. local tostring = tostring
  122. local scrh20 = ScrH() -20
  123. local scrw20 = ScrW() -20
  124. local scrh26 = ScrH() -26
  125. local scrh110 = ScrH() -110
  126. local scrw = ScrW()
  127. local scrh83 = ScrH() -83
  128. local scrw10 = ScrW() -10
  129. local scrh75 = ScrH() -75
  130. local scrh77 = ScrH() -77
  131. local scrh775 = ScrH() -77.5
  132. local scrh45 = ScrH() -45
  133. local scrh27 = ScrH() -27
  134. local scrh35 = ScrH() -35
  135. local scrh36 = ScrH() -36
  136. local scrh32 = ScrH() -32
  137. local scrh50 = ScrH() -50
  138. local scrh62 = ScrH() -62
  139. local scrw140 = ScrW() -140
  140. local scrw120 = ScrW() -120
  141. local scrh140 = ScrH() -140
  142. local scrh109 = ScrH() -109
  143. local scrh105 = ScrH() -105
  144. local scrh98 = ScrH() -98
  145. local scrw356 = ScrW() -356
  146. local scrwhalf = ScrW() / 2
  147.  
  148. // Худ к профам
  149. local function SJobHud()
  150. local ply = LocalPlayer()
  151.  
  152. if team.GetName(ply:Team()) == "Дворняга" or team.GetName(ply:Team()) == "Полицейский пёс" then
  153. draw.DrawText( "ВНИМАНИЕ, ВАМ ЗАПРЕЩЕНО РАЗГОВАРИВАТЬ ЛЮДСКОЙ РЕЧЬЮ, Т.К ВЫ ЯВЛЯЕТЕСЬ ЖИВОТНЫМ !!", "Other", 400, scrh20, jobchangable, TEXT_ALIGN_LEFT )
  154. end
  155.  
  156. end
  157.  
  158. function MyCalcView(ply, pos, angles, fov)
  159.  
  160. local ply = LocalPlayer()
  161.  
  162. if team.GetName(ply:Team()) == "Дворняга" or team.GetName(ply:Team()) == "Полицейский пёс" then
  163.  
  164. local view = {}
  165. view.origin = pos-(angles:Forward() * 50)
  166. view.angles = angles
  167. view.fov = fov
  168.  
  169. return view
  170.  
  171. else return
  172. end
  173.  
  174. end
  175.  
  176.  
  177. hook.Add("CalcView", "MyCalcView", MyCalcView)
  178.  
  179. hook.Add("ShouldDrawLocalPlayer", "MyHax ShouldDrawLocalPlayer", function(ply) if team.GetName(ply:Team()) == "Дворняга" or team.GetName(ply:Team()) == "Полицейский пёс" then
  180. return true
  181. end end)
  182.  
  183.  
  184. local function HealthArmor()
  185. local ply = LocalPlayer()
  186.  
  187. local teampartc = team.GetColor(ply:Team())
  188.  
  189. draw.RoundedBox(0, 12, scrh110, 311, 25, greypart) -- behind hp
  190. draw.RoundedBox(0, 75, scrh83, 248, 76, greypart) -- main box
  191. draw.RoundedBox(0, 12, scrh83, 60, 76, greypart) -- model box
  192. draw.RoundedBox(0, 15, scrh75, 55, 60, redpart)
  193. draw.RoundedBox(0, 80 + 5, scrh45, 200, 2, redpart) -- line 1
  194. draw.RoundedBox(0, 80 + 5, scrh27, 165, 2, redpart) -- line 2
  195. draw.RoundedBox(0, scrw140, scrh32, 120, 2, redpart) -- ammo line 1
  196.  
  197.  
  198. local hp = ply:Health()
  199. local armor = ply:Armor()
  200.  
  201. if hp > 0 and hp < 100 then
  202. draw.RoundedBox( 0, 85, scrh77, 110 * hp / 100, 14, hc)
  203. draw.SimpleText( hp.."", "hpf", 95, scrh775, tc, TEXT_ALIGN_LEFT)
  204. end
  205.  
  206. if hp >= 100 then
  207. draw.RoundedBox( 0, 85, scrh77, 110, 14, hc)
  208. end
  209.  
  210. if armor > 0 then
  211. draw.RoundedBox( 0, 210, scrh77, 110 * armor / 100, 14, ac)
  212. draw.SimpleText( armor.."", "hpf", 220, scrh775, tc, TEXT_ALIGN_LEFT)
  213. end
  214.  
  215. if armor >= 100 then
  216. draw.RoundedBox( 0, 210, scrh77, 110, 14, ac)
  217. end
  218.  
  219.  
  220.  
  221. local PlayerName = ply:Nick()
  222.  
  223. draw.RoundedBox(0, 10 + 3, scrh109, 309, 23, teampartc)
  224. draw.SimpleText( PlayerName, "namef", 50 + 115 , scrh98, tc, 1, 1)
  225.  
  226. -- player model
  227.  
  228. if !DermaShown then
  229. PlayerIcon = vgui.Create("SpawnIcon")
  230. PlayerIcon:SetPos( 15, scrh75 )
  231. PlayerIcon:SetSize(60, 60)
  232. PlayerIcon:SetToolTip("")
  233. PlayerIcon:SetModel(ply:GetModel())
  234.  
  235. DermaShown = true
  236.  
  237. end
  238. PlayerIcon:SetModel(ply:GetModel() or "models/props_junk/watermelon01.mdl")
  239.  
  240. -- money
  241.  
  242. local Money = ply:getDarkRPVar("money") or 0
  243.  
  244. local Salary = ply:getDarkRPVar("salary") or 0
  245.  
  246.  
  247. draw.SimpleText("Кошелёк: "..Money.." руб.", "walletf", 80 + 5, scrh36, tc,TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)
  248. draw.SimpleText("Зарплата: "..Salary.." руб.","walletf", 80 + 5, scrh26, tc, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
  249.  
  250.  
  251. local job = ply:getDarkRPVar("job") or ""
  252. draw.SimpleText("Работа: "..job,"walletf", 80 + 5, scrh62, tc, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
  253. end
  254.  
  255.  
  256.  
  257. // Время
  258. local function Time()
  259.  
  260. draw.DrawText(os.date( "%H:%M - %d/%m/%Y"), "Time", scrw10, scrh75, tc, TEXT_ALIGN_RIGHT )
  261.  
  262. end
  263.  
  264.  
  265.  
  266. // Ком. час и розыск
  267. local function Other()
  268. local ply = LocalPlayer()
  269.  
  270. if ply:getDarkRPVar("HasGunlicense")
  271. then surface.SetDrawColor(255, 255, 255)
  272. surface.SetMaterial(GunIc)
  273. surface.DrawTexturedRect(15, scrh105, 16, 16)
  274. end
  275.  
  276. if ply:isWanted() then
  277. draw.DrawText("Вы находитесь в розыске!", "namef", 16, scrh140, mainchangable, TEXT_ALIGN_LEFT)
  278. end
  279.  
  280. if GetGlobalBool("DarkRP_LockDown") then
  281. draw.DrawText("Объявлен комендантский час. Пройдите по домам!", "namef", scrwhalf, 10, mainchangable, TEXT_ALIGN_CENTER)
  282. end
  283.  
  284.  
  285. end
  286.  
  287. // Патроны
  288. local function Ammo()
  289. local ply = LocalPlayer()
  290. if IsValid(LocalPlayer():GetActiveWeapon()) then
  291. local mag_extra = LocalPlayer():GetAmmoCount(LocalPlayer():GetActiveWeapon():GetPrimaryAmmoType())
  292. local ammo = (math.max((LocalPlayer():GetActiveWeapon():Clip1()), 0)) .. " / " .. mag_extra
  293.  
  294. if IsValid(LocalPlayer():GetActiveWeapon()) then
  295. draw.SimpleText(ply:GetActiveWeapon():GetPrintName(), "namef", scrw20, scrh50, tc, TEXT_ALIGN_RIGHT, 0)
  296. end
  297. if ammo != "0 / 0" then
  298. draw.SimpleText(ammo, "namef", scrw120, scrh35, tc, TEXT_ALIGN_LEFT)
  299. end
  300. end
  301. end
  302.  
  303. // Агенда
  304. local function Agenda()
  305. ply = LocalPlayer()
  306. if !agenda then return end
  307.  
  308. agendatext = ply:getDarkRPVar("agenda") or ""
  309. atext = DarkRP.textWrap((agendatext),"Agenda", 395)
  310.  
  311. draw.SimpleText(agenda.Title,"Agenda",15,17.5,tc,TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER)
  312. draw.DrawText(atext,"Agendas",15,35,tc)
  313.  
  314.  
  315. end
  316.  
  317.  
  318. // Панельки над игроком
  319. local function DrawPlayerInfo(ply)
  320. local pos = ply:EyePos()
  321.  
  322. pos.z = pos.z + 10
  323. pos = pos:ToScreen()
  324. pos.y = pos.y - 50
  325.  
  326. if ply == LocalPlayer()
  327. then return end
  328.  
  329. draw.DrawText(ply:Nick(), "Up", pos.x, pos.y - 40, tc, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  330. 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)
  331.  
  332. if ply:getDarkRPVar("wanted") then
  333. draw.DrawText("Игрок в розыске!", "Up", pos.x, pos.y + 15, tc, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  334. end
  335.  
  336. if ply:getDarkRPVar("HasGunlicense") then
  337. surface.SetMaterial(GunIc)
  338. surface.SetDrawColor(tc)
  339. surface.DrawTexturedRect(pos.x, pos.y - 65, 20, 20)
  340. end
  341. end
  342.  
  343.  
  344. local function DrawEntityDisplay()
  345. local ply = LocalPlayer()
  346. local shootPos = LocalPlayer():GetShootPos()
  347. local aimVec = LocalPlayer():GetAimVector()
  348.  
  349. for k, ply in pairs(players or player.GetAll()) do
  350. if not ply:Alive() or ply == LocalPlayer() then continue end
  351. local hisPos = ply:GetShootPos()
  352.  
  353. if GAMEMODE.Config.globalshow then
  354. DrawPlayerInfo(ply)
  355. -- Прорисовыается,когда вы смотрите на него
  356. elseif not GAMEMODE.Config.globalshow and hisPos:DistToSqr(shootPos) < 260000 then
  357. local pos = hisPos - shootPos
  358. local unitPos = pos:GetNormalized()
  359. if unitPos:Dot(aimVec) > 0.8 then
  360. local trace = util.QuickTrace(shootPos, pos, LocalPlayer())
  361. if trace.Hit and trace.Entity ~= ply then return end
  362. DrawPlayerInfo(ply)
  363. end
  364. end
  365. end
  366.  
  367. local tr = LocalPlayer():GetEyeTrace()
  368.  
  369. if IsValid(tr.Entity) and tr.Entity:isKeysOwnable() and tr.Entity:GetPos():Distance(LocalPlayer():GetPos()) < 380 then
  370. tr.Entity:drawOwnableInfo()
  371. end
  372. end
  373. // Сообщение при аресте
  374. usermessage.Hook("GotArrested", function(msg)
  375. local StartArrested = CurTime()
  376. local ArrestedUntil = msg:ReadFloat()
  377.  
  378. Arrested = function()
  379. if (CurTime() - StartArrested <= ArrestedUntil and LocalPlayer():getDarkRPVar("Arrested")) then
  380. SimpleShadowText("Вы были арестованы на "..string.ToMinutesSeconds(math.ceil(ArrestedUntil - (CurTime() - StartArrested))).."!", "Other", x / 2, 150, colour.pure_white, 100, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  381. elseif !LocalPlayer():getDarkRPVar("Arrested") then
  382. Arrested = function() end
  383. end
  384. end
  385. end)
  386.  
  387. //Отображение нотификаций
  388. local function DisplayNotify(msg)
  389. local text = msg:ReadString()
  390.  
  391. GAMEMODE:AddNotify(text, msg:ReadShort(), msg:ReadLong())
  392.  
  393. print(text)
  394. end
  395.  
  396. usermessage.Hook("_Notify", DisplayNotify)
  397.  
  398.  
  399. local function DrawHUD()
  400. SJobHud()
  401. HealthArmor()
  402. Time()
  403. Other()
  404. Agenda()
  405. Ammo()
  406. DrawEntityDisplay()
  407. DrawPlayerInfo(ply)
  408.  
  409. end
  410.  
  411. function GM:HUDDrawTargetID()
  412. return false
  413. end
  414.  
  415. local hideHUDElements = {
  416. ["DarkRP_HUD"] = true,
  417. ["DarkRP_EntityDisplay"] = true,
  418. ["DarkRP_ZombieInfo"] = false,
  419. ["DarkRP_LocalPlayerHUD"] = true,
  420. ["DarkRP_Hungermod"] = true,
  421. ["DarkRP_Agenda"] = true,
  422. ["CHudHealth"] = true,
  423. ["CHudBattery"] = true,
  424. ["CHudAmmo"] = true,
  425. ["CHudSecondaryAmmo"] = true
  426. }
  427.  
  428. function PaintHUD()
  429.  
  430. DrawHUD()
  431.  
  432. end
  433.  
  434. hook.Add("HUDPaint","PaintHUD",PaintHUD)
  435.  
  436. hook.Add("HUDShouldDraw", "HideDefaultElements", function(name)
  437. if hideHUDElements[name] then return false end
  438. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement