DTextEntry:GetValue() == NIL

  • Initiateur de la discussion
thepsyca

thepsyca

Psychopathe
Messages
2 164
Score réaction
648
Points
365
Bonsoir,

j'essai de GetValue mon DTextEntry seulement celui-ci est toujours == NIL
EDIT : En Faite Le GetValue = "valider" soit le nom du bouton et pas le DTextentry
le code

Code:
local function ShowData() local frame1 = vgui.Create("DFrame") frame1:SetTitle("") frame1:SetSize(900, 600) frame1:SetAlpha(0) frame1:AlphaTo(255, 0.25) frame1:Center() frame1:ShowCloseButton(true) frame1:MakePopup() frame1.Paint = function(self, w, h) draw.RoundedBox(0, 0, 0, w, h, Color(0, 0, 0, 255)) draw.RoundedBox(0, 0, 0, w, 30, Color(226, 0, 0, 250)) draw.DrawText("NLF BOT : Show Data", "nlf_bot_textprincipal", self:GetWide() / 2, 4, color_white, TEXT_ALIGN_CENTER) surface.SetDrawColor(0, 0, 0) surface.DrawOutlinedRect(0, 0, w, h) end local DataList = vgui.Create("DListView", frame1) DataList:Dock(FILL) DataList:DockMargin(250, 5, 5, 5) DataList:SetWidth(565) DataList:SetMultiSelect(false) DataList:AddColumn("SteamID"):SetFixedWidth(200) DataList:AddColumn("Player Name") DataList:AddColumn("Amount"):SetFixedWidth(120) local OFFEntry = vgui.Create("DTextEntry", frame1) OFFEntry:SetPos(235, 50) OFFEntry:SetSize(200, 30) OFFEntry:SetText("Search by SteamID") local Vcl = vgui.Create("DButton", frame1) Vcl:SetSize(200, 30) Vcl:SetPos(235, 90) Vcl:SetText("Valider") Vcl:SetFont("fontclose") Vcl:SetTextColor(Color(255, 255, 255, 255)) Vcl.Paint = function(self, w, h) local kcol if self.hover then kcol = Color(255, 150, 150, 255) else kcol = Color(175, 100, 100) end draw.RoundedBoxEx(0, 0, 0, w, h, Color(255, 150, 150, 255), false, false, true, true) draw.RoundedBoxEx(0, 1, 0, w - 2, h - 1, kcol, false, false, true, true) end Vcl.DoClick = function() local offlinesteamsearch = OFFEntry:GetValue() DataList:Clear() print(OFFEntry:GetValue()) print(offlinesteamsearch) end Vcl.OnCursorEntered = function(self) self.hover = true end Vcl.OnCursorExited = function(self) self.hover = false end local PlayerList = vgui.Create("DListView", frame1) PlayerList:Dock(LEFT) PlayerList:DockMargin(5, 5, 5, 5) PlayerList:SetWidth(200) PlayerList:SetMultiSelect(false) PlayerList:AddColumn("Joueurs en ligne") PlayerList.OnRowSelected = function( line) DataList:Clear() net.Start("findclientdata") net.WriteString("playername") net.WriteString(tostring(PlayerList:GetLine(line):GetValue(1))) net.SendToServer(ply) end PlayerList.OnRowRightClick = function( line) local DropDown = DermaMenu() DropDown:AddOption("Delete le fichier data", function() LocalSteamID = DataList:GetLine(line):GetValue(1) net.Start("deleteonedataclient") net.WriteString(LocalSteamID) net.SendToServer(ply) DataList:Clear() end) DropDown:AddSpacer() DropDown:Open() end for _, v in pairs(player.GetAll()) do PlayerList:AddLine(v:Nick()) end net.Receive("showclientdata", function() local ClientSteamID = net.ReadString() local ClientName = net.ReadString() local ClientAmount = net.ReadString() DataList:Clear() DataList:AddLine(ClientSteamID, ClientName, ClientAmount) end)
end
 
Dernière édition:
Z3k4

Z3k4

Helpeur Divin
Messages
4 495
Score réaction
1 513
Points
580
Utilise GetText()
 
  • J'aime
Réactions: thepsyca
Discord d'entraide
Rejoignz-nous sur Discord