Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddCSLuaFile()
- ENT.Base = "bw_base_moneyprinter"
- ENT.Model = "models/freeman/compact_printer.mdl"
- ENT.Skin = 0
- ENT.Capacity = 7806509929
- ENT.PrintInterval = 1
- ENT.PrintAmount = 7806509
- ENT.Health = 2500
- ENT.PrintName = "ВИП-Принтер T1"
- ENT.FontColor = color_white
- ENT.BackColor = color_black
- function ENT:Draw()
- if CLIENT then
- if self:GetPos():Distance( LocalPlayer():GetPos() ) > 1200 then return end
- self:DrawModel()
- local pos = self:GetPos()
- local ang = self:GetAngles()
- local Pw = self:IsPowered()
- pos = pos + ang:Up() * 6
- pos = pos + ang:Forward() * 2.4
- pos = pos + ang:Right() * 3
- ang:RotateAroundAxis(ang:Up(), 90)
- local ang = self:GetAngles()
- ang:RotateAroundAxis(ang:Up(), 90)
- local Cp = self:GetCapacity()
- local money = tonumber(self:GetMoney()) or 0
- local cap = tonumber(Cp) or 0
- local Lv = self:GetLevel() or 0
- local money = tonumber(self:GetMoney()) or 0
- local cap = tonumber(Cp) or 0
- local currentMoney = string.format(BaseWars.LANG.CURFORMER, BaseWars.NumberFormat(money))
- local maxMoney = string.format(BaseWars.LANG.CURFORMER, BaseWars.NumberFormat(cap))
- local paper = math.floor(self:GetPaper())
- local moneyPercentage = math.Round( money / cap * 100 ,1)
- local EntityName = self.PrintName
- local PrinterOwner = "Уровень: ".. self:GetLevel()
- local MoneyAmount
- if Pw then
- MoneyAmount = currentMoney
- else
- MoneyAmount = "Нет энергии!"
- end
- local UpgCost = "/upg : $" .. BaseWars.NumberFormat(self:GetNWInt("UpgradeCost") * self:GetLevel())
- cam.Start3D2D(pos + ang:Up() * 3.09,ang,0.1/2)
- draw.RoundedBox(4, -216, -170, 165*2, 62*2, Color(0,0,0))
- draw.DrawText(string.format(BaseWars.LANG.LevelText, Lv):upper(), "InfoSidePrinter", -50,-150, self.FontColor,TEXT_ALIGN_CENTER)
- draw.DrawText(string.format(BaseWars.LANG.Paper, paper), "InfoSidePrinter", -50,-125, self.FontColor,TEXT_ALIGN_CENTER)
- draw.DrawText("Объем: " .. BaseWars.NumberFormat(self.Capacity) .. "$", "InfoSidePrinter", -50,-100, self.FontColor, TEXT_ALIGN_CENTER)
- cam.End3D2D()
- cam.Start3D2D(pos + ang:Up() * 3.1,ang,0.1/2)
- self.FontColor = HSVToColor(CurTime()/2 % 6 * 60, 1, 1)
- draw.RoundedBox(5,-215, -48, 325 ,1, self.FontColor)
- draw.RoundedBox(5,-215, -171, 325 ,1, self.FontColor)
- draw.RoundedBox(5,-214.4,-171,1,125, self.FontColor)
- draw.RoundedBox(5,109,-171,1,125, self.FontColor)
- cam.End3D2D()
- local UpgradeAng = self:GetAngles()
- UpgradeAng:RotateAroundAxis(UpgradeAng:Forward(),90)
- UpgradeAng:RotateAroundAxis(UpgradeAng:Right(),270)
- cam.Start3D2D(pos + UpgradeAng:Up() * 6.99, UpgradeAng, 0.1/2)
- local backmoney = self:GetMoney() / self:GetCapacity() * 69*4 .. "%"
- local currentMoney = string.format(BaseWars.LANG.CURFORMER, BaseWars.NumberFormat(money))
- local maxMoney = string.format(BaseWars.LANG.CURFORMER, BaseWars.NumberFormat(cap))
- self.FontColor = HSVToColor(CurTime()/2 % 6 * 60, 1, 1)
- draw.DrawText("Заполнено на "..moneyPercentage.."%", "PrinterName", -15*4+5 , 1*4, self.FontColor, TEXT_ALIGN_CENTER)
- surface.SetDrawColor( self.FontColor)
- surface.DrawOutlinedRect( -49*4, 8*5.4, 36*2*4 , 3*5 )
- if self:GetMoney() > 0 then
- draw.RoundedBox(0, -49*3.93, 8*5.8, self:GetMoney() / self:GetCapacity() * 36*2*3.90 , 3*3.2, self.FontColor )
- end
- draw.DrawText(BaseWars.LANG.Cash..currentMoney, "PrinterName", -15*4+5 , 18*4, self.FontColor, TEXT_ALIGN_CENTER)
- cam.End3D2D()
- cam.Start3D2D(pos + UpgradeAng:Up() * 6.9, UpgradeAng, 0.1/2)
- self.FontColor = HSVToColor(CurTime()/2 % 6 * 60, 1, 1)
- draw.RoundedBox(5,-207, 107, 323 ,1, self.FontColor)
- draw.RoundedBox(5,-207, -17, 323 ,1,self.FontColor)
- draw.RoundedBox(5, 115, -15, 1 ,125, self.FontColor)
- draw.RoundedBox(5, -207, -15, 1 ,125, self.FontColor)
- cam.End3D2D()
- end
- end
- ENT.IsValidRaidable = true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement