surface.CreateFont("CB_F1", { font = "Poppins", extended = true, size = 33, weight = 500, }) surface.CreateFont("CB_F2", { font = "Poppins", extended = true, size = 23, weight = 500, }) local RandomLabels = {} RandomLabels[1] = "Merhaba,size nasıl yardımcı olabilirim?" RandomLabels[2] = "Merhaba, Çiftlik Bank'a Hoşgeldiniz!" RandomLabels[3] = "Kazanmanın En Kolay Yoluna Hoşgeldiniz!" local CB_Colors = { ["white"] = Color(255, 255, 255, 255), ["black"] = Color(0, 0, 0, 255), ["fade_black"] = Color(0, 0, 0, 200), ["fade_white"] = Color(255, 255, 255, 200), ["green"] = Color(0, 255, 0, 255), ["darkgreen"] = Color(0, 100, 0, 255) } local cb_logo = Material("cb_logo.png") local tosuncuk_img = Material("tosuncuk.png") local tavuk = Material("tavuk.png") local inek = Material("inek.png") local koyun = Material("koyun.png") --Renkleri önceden 1 kere çağırmak daha optimizeli kod akışı sağlıyormuş.Her network receive olduğunda değilde dosya yüklendiğinde çağırttım. net.Receive("CB_OpenCiftlikUI", function(ply) local UI_Type = net.ReadString() --local CustomerData = net.ReadTable() local tavuk_count = "x0" local inek_count = "x0" local koyun_count = "x0" local total_earnings = "0 TL ( +0TL/DK )" if UI_Type == "CustomerUI" then local SelectedRandomLabel = RandomLabels[math.random(1, 3)] local MainCBMenu = vgui.Create("DFrame") MainCBMenu:SetSize(ScrW() / 2.5, ScrH() / 1.3) MainCBMenu:MakePopup() MainCBMenu:Center() MainCBMenu:SetTitle("") MainCBMenu.Paint = function(self, w, h) surface.SetDrawColor(CB_Colors["fade_white"]) surface.DrawRect(0, 0, w, h) surface.SetDrawColor(CB_Colors["fade_black"]) surface.DrawRect(ScrW() * 0.03, ScrH() * 0.18, w / 7.5, h / 8) surface.SetMaterial(tosuncuk_img) surface.SetDrawColor(CB_Colors["white"]) surface.DrawTexturedRect(ScrW() * 0.03, ScrH() * 0.18, w / 7.5, h / 8) surface.SetDrawColor(CB_Colors["fade_black"]) surface.DrawOutlinedRect(ScrW() * 0.03, ScrH() * 0.18, w / 7.5, h / 8, 1) surface.SetMaterial(cb_logo) surface.SetDrawColor(CB_Colors["white"]) surface.DrawTexturedRect(ScrW() * 0.16, ScrH() * 0.03, w / 4.5, h / 5) surface.SetMaterial(tavuk) surface.SetDrawColor(CB_Colors["white"]) surface.DrawTexturedRect(ScrW() * 0.03, ScrH() * 0.3, w / 4.5, h / 5) surface.SetMaterial(inek) surface.SetDrawColor(CB_Colors["white"]) surface.DrawTexturedRect(ScrW() * 0.16, ScrH() * 0.3, w / 4.5, h / 5) surface.SetMaterial(koyun) surface.SetDrawColor(CB_Colors["white"]) surface.DrawTexturedRect(ScrW() * 0.28, ScrH() * 0.3, w / 4.5, h / 5) surface.SetDrawColor(CB_Colors["black"]) surface.DrawRect(0, ScrH() - 200, w, h / 12) draw.SimpleText("Çiftlikbank, ödemeleri tarafınıza uygun gün ve saatte iletecektir", "CB_F2", ScrW() * 0.2, ScrH() - 190, CB_Colors["white"], 1, 1) end local WelcomeLabel = vgui.Create("DLabel", MainCBMenu) WelcomeLabel:SetSize(MainCBMenu:GetWide() / 1.25, 30) WelcomeLabel:CenterHorizontal(0.65) WelcomeLabel:CenterVertical(0.3) WelcomeLabel:SetText(SelectedRandomLabel) WelcomeLabel:SetColor(CB_Colors["black"]) WelcomeLabel:SetFont("CB_F1") local TavukCount = vgui.Create("DLabel", MainCBMenu) TavukCount:SetSize(MainCBMenu:GetWide() / 1.25, 30) TavukCount:CenterHorizontal(0.57) TavukCount:CenterVertical(0.63) TavukCount:SetText(tavuk_count) TavukCount:SetColor(CB_Colors["black"]) TavukCount:SetFont("CB_F1") local InekCount = vgui.Create("DLabel", MainCBMenu) InekCount:SetSize(MainCBMenu:GetWide() / 1.25, 30) InekCount:CenterHorizontal(0.92) InekCount:CenterVertical(0.63) InekCount:SetText(inek_count) InekCount:SetColor(CB_Colors["black"]) InekCount:SetFont("CB_F1") local KoyunCount = vgui.Create("DLabel", MainCBMenu) KoyunCount:SetSize(MainCBMenu:GetWide() / 1.25, 30) KoyunCount:CenterHorizontal(1.23) KoyunCount:CenterVertical(0.63) KoyunCount:SetText(koyun_count) KoyunCount:SetColor(CB_Colors["black"]) KoyunCount:SetFont("CB_F1") local SelectAnimal = vgui.Create("DComboBox", MainCBMenu) SelectAnimal:SetSize(100, 30) SelectAnimal:CenterHorizontal(0.5) SelectAnimal:CenterVertical(0.7) SelectAnimal:SetText(" Hayvan Seç") SelectAnimal:AddChoice("Tavuk") SelectAnimal:AddChoice("İnek") SelectAnimal:AddChoice("Koyun") local WriteAnimalCount = vgui.Create("DTextEntry", MainCBMenu) WriteAnimalCount:SetSize(100, 30) WriteAnimalCount:SetPlaceholderText(" Hayvan Miktarı") WriteAnimalCount:CenterHorizontal(0.3) WriteAnimalCount:CenterVertical(0.7) local BuyAnimal = vgui.Create("DButton", MainCBMenu) BuyAnimal:SetSize(100, 30) BuyAnimal:CenterHorizontal(0.7) BuyAnimal:CenterVertical(0.7) BuyAnimal:SetText("Satın Al") BuyAnimal:SetFont("CB_F2") BuyAnimal:SetColor(CB_Colors["white"]) BuyAnimal.Paint = function(self, w, h) if self:IsHovered() then self:SetColor(CB_Colors["green"]) surface.SetDrawColor(CB_Colors["darkgreen"]) surface.DrawRect(0, 0, w, h) surface.SetDrawColor(CB_Colors["fade_black"]) surface.DrawOutlinedRect(0, 0, w, h) else self:SetColor(CB_Colors["white"]) surface.SetDrawColor(CB_Colors["fade_black"]) surface.DrawRect(0, 0, w, h) surface.SetDrawColor(CB_Colors["fade_black"]) surface.DrawOutlinedRect(0, 0, w, h) end end local TotalEarnings = vgui.Create("DLabel", MainCBMenu) TotalEarnings:SetSize(MainCBMenu:GetWide() / 1.25, 30) TotalEarnings:CenterHorizontal(0.75) TotalEarnings:CenterVertical(0.8) TotalEarnings:SetText(total_earnings) TotalEarnings:SetColor(CB_Colors["black"]) TotalEarnings:SetFont("CB_F1") local TotalInput = vgui.Create("DTextEntry", MainCBMenu) TotalInput:SetSize(100, 30) TotalInput:SetPlaceholderText(" Para Miktarı") TotalInput:CenterHorizontal(0.35) TotalInput:CenterVertical(0.9) local WithdrawEarnings = vgui.Create("DButton", MainCBMenu) WithdrawEarnings:SetSize(150, 30) WithdrawEarnings:CenterHorizontal(0.65) WithdrawEarnings:CenterVertical(0.9) WithdrawEarnings:SetText("Ödeme İsteği Gönder") WithdrawEarnings:SetFont("CB_F2") WithdrawEarnings:SetColor(CB_Colors["white"]) WithdrawEarnings.Paint = function(self, w, h) if self:IsHovered() then self:SetColor(CB_Colors["green"]) surface.SetDrawColor(CB_Colors["darkgreen"]) surface.DrawRect(0, 0, w, h) surface.SetDrawColor(CB_Colors["fade_black"]) surface.DrawOutlinedRect(0, 0, w, h) else self:SetColor(CB_Colors["white"]) surface.SetDrawColor(CB_Colors["fade_black"]) surface.DrawRect(0, 0, w, h) surface.SetDrawColor(CB_Colors["fade_black"]) surface.DrawOutlinedRect(0, 0, w, h) end end elseif UI_Type == "ListUI" then local MainCBListMenu = vgui.Create("DFrame") MainCBListMenu:SetSize(ScrW() / 2, ScrH() / 2) MainCBListMenu:Center() MainCBListMenu:SetTitle("Müşteriler") MainCBListMenu:MakePopup() MainCBListMenu.Paint = function(self, w, h) surface.SetDrawColor(0, 0, 0, 200) surface.DrawRect(0, 0, w, h) end local List = vgui.Create("DListView", MainCBListMenu) List:Dock(FILL) List:SetMultiSelect(false) List:AddColumn("Müşteri Adı") List:AddColumn("Tavuk Sayısı") List:AddColumn("İnek Sayısı") List:AddColumn("Koyun Sayısı") List:AddColumn("Dakika Başı Kazanç") List:AddColumn("Toplam Kazanç") for k, v in pairs(player.GetAll()) do List:AddLine(v:Name(), 0, 0, 0, 0, 0) end end end)