• Ulx read file
    5 replies, posted
Hi, I'm working on a ban system using ulx. I would like to read the file "bans.txt" and get all informations in order to complete my table. Here is my actual code. local w = ScrW()  local h = ScrH() local fban = vgui.Create( "DFrame", panel) fban:SetSize( 615, 350 ) fban:SetPos( w/2-245, h/2-140) fban:MakePopup() fban.Paint = function( p, w, h )  draw.RoundedBox( 0, 0, 0, w, h, Color(51, 51, 51, 255) ) fban:SetTitle( "" ) fban:ShowCloseButton(false) fban:SetDraggable( false ) end local AppList = vgui.Create( "DListView", fban ) AppList:Dock( FILL ) AppList:SetMultiSelect( false ) AppList:AddColumn( "Name/Steam ID" ) AppList:AddColumn( "Banned By" ) AppList:AddColumn( "Unban Date" ) AppList:AddColumn( "Reason" ) AppList:SetSize( 150, 150) AppList.OnRowSelected = function( lst, index, pnl ) end
Use this to read the file: File/Read Also when storing data in your "bans.txt" convert your bans table into json: util.TableToJSON To convert it back just use this: util.JSONToTable
Also you might want to send the file through net, although it will cause problems if the list is really big
The fact is that I don't know how to get for example the STEAM ID writen in the bans.txt
UP.
leeroy___ basically told you what to use.
Sorry, you need to Log In to post a reply to this thread.