BananasTheKing

nigger item

Oct 24th, 2017
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. --[[
  2. © 2015 CloudSixteen.com do not share, re-distribute or modify
  3. without permission of its author ([email protected]).
  4.  
  5. Clockwork was created by Conna Wiles (also known as kurozael.)
  6. http://cloudsixteen.com/license/clockwork.html
  7. --]]
  8.  
  9. include("shared.lua")
  10.  
  11. -- Called when the target ID HUD should be painted.
  12. function ENT:HUDPaintTargetID(x, y, alpha)
  13. if (Clockwork.entity:HasFetchedItemData(self)) then
  14. local itemTable = Clockwork.entity:FetchItemTable(self);
  15.  
  16. if (Clockwork.plugin:Call("PaintItemTargetID", x, y, alpha, itemTable)) then
  17. local colorTargetID = Clockwork.option:GetColor("target_id");
  18. local colorWhite = Clockwork.option:GetColor("white");
  19. local color = itemTable("color") or colorTargetID;
  20.  
  21. y = Clockwork.kernel:DrawInfo(itemTable("name"), x, y, color, alpha);
  22.  
  23. if (itemTable.OnHUDPaintTargetID) then
  24. local newY = itemTable:OnHUDPaintTargetID(self, x, y, alpha);
  25.  
  26. if (newY == false) then
  27. return;
  28. end;
  29.  
  30. if (type(newY) == "number") then
  31. y = newY;
  32. end;
  33. end;
  34.  
  35. y = Clockwork.kernel:DrawInfo(itemTable("weightText", itemTable("weight").."kg"), x, y, colorWhite, alpha);
  36.  
  37. local spaceUsed = itemTable("space");
  38. if (Clockwork.inventory:UseSpaceSystem() and spaceUsed > 0) then
  39. y = Clockwork.kernel:DrawInfo(itemTable("spaceText", spaceUsed.."l"), x, y, colorWhite, alpha);
  40. end
  41. end;
  42. end;
  43. end;
  44.  
  45. -- Called each frame.
  46. function ENT:Think()
  47. if (!Clockwork.entity:HasFetchedItemData(self)) then
  48. Clockwork.entity:FetchItemData(self);
  49. return;
  50. end;
  51.  
  52. local itemTable = Clockwork.entity:FetchItemTable(self);
  53.  
  54. if (itemTable.OnEntityThink) then
  55. local nextThink = itemTable:OnEntityThink(self);
  56.  
  57. if (type(nextThink) == "number") then
  58. self:NextThink(CurTime() + nextThink);
  59. end;
  60. end;
  61.  
  62. Clockwork.plugin:Call("ItemEntityThink", itemTable, self);
  63. end;
  64.  
  65. -- Called when the entity should draw.
  66. function ENT:Draw()
  67. if (!Clockwork.entity:HasFetchedItemData(self)) then
  68. return;
  69. end;
  70.  
  71. local drawModel = true;
  72. local itemTable = Clockwork.entity:FetchItemTable(self);
  73. local shouldDrawItemEntity = Clockwork.plugin:Call("ItemEntityDraw", itemTable, self);
  74.  
  75. if (shouldDrawItemEntity == false
  76. or (itemTable.OnDrawModel and itemTable:OnDrawModel(self) == false)) then
  77. drawModel = false;
  78. end;
  79.  
  80. if (drawModel) then
  81. self:DrawModel();
  82. end;
  83. end;
Advertisement
Add Comment
Please, Sign In to add comment