WASSIm. Posted November 8, 2013 Share Posted November 8, 2013 hi guys i have fail problem in GridList. plis help IMAGE http://i.imgur.com/seXLDdB.png FILE [(2013/11/8) | (12:52)]: CMD-WASSIm.[NOOSE] spawned haut parleur SERVER function getLog(logname) if ( logname ) then local post = ""..logname..".log" local file = fileOpen(post) local textlog = {} for i=1, fileGetSize(file) do local text = fileRead(file, i) table.insert(textlog, text) end fileClose(file) return textlog end end function loadLog(logname) local logs = getLog(""..logname.."") triggerClientEvent("onLoadLoginList", root, logs) end addEvent( "onloadLog", true ) addEventHandler( "onloadLog", getRootElement(), loadLog) CLIENT addEvent("onLoadLoginList",true) addEventHandler("onLoadLoginList", root, function (Table) guiGridListClear(GUIEditor.gridlist[1]) for _, v in ipairs(Table) do local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) guiGridListSetItemText ( GUIEditor.gridlist[1], row, column, ""..v.."", false, false ) end end ) Link to comment
Sasu Posted November 9, 2013 Share Posted November 9, 2013 I dont know if is too late to answer but you could try change line 7 in the server local text = fileRead(file, i) -> local text = fileRead(file, 500) Link to comment
WASSIm. Posted November 9, 2013 Author Share Posted November 9, 2013 thanks but why he mae more row ! Link to comment
Sasu Posted November 9, 2013 Share Posted November 9, 2013 I didnt understand what you said. Show me a photo. Link to comment
Desaster Posted November 12, 2013 Share Posted November 12, 2013 try to clear the gird before you create your row's Link to comment
WASSIm. Posted November 12, 2013 Author Share Posted November 12, 2013 i already use it addEvent("onLoadLoginList",true) addEventHandler("onLoadLoginList", root, function (Table) guiGridListClear(GUIEditor.gridlist[1])---HERE for _, v in ipairs(Table) do local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) guiGridListSetItemText ( GUIEditor.gridlist[1], row, column, ""..v.."", false, false ) end end ) Link to comment
Sasu Posted November 12, 2013 Share Posted November 12, 2013 Line 6 ( server ): replace for i=1, fileGetSize(file) do -> while not fileIsEOF(file) do Link to comment
WASSIm. Posted November 12, 2013 Author Share Posted November 12, 2013 thank you. but if why its replace old text not add Link to comment
Sasu Posted November 12, 2013 Share Posted November 12, 2013 I dont know. It would be more easy if you do in SQLite. I can help you, PM Me if you want. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now