Ghost156 Posted September 22, 2018 Share Posted September 22, 2018 (edited) Hi there, I've been working on an In Game log searcher for logs that I save in a database. I've got a column named source and affected elements The source column saves the account ID of the one who triggered the function. The affected column stores the account ID's of those who were around when the function was triggered, these numbers are seperated by a ; icon. I've got an export to a different resource, that allows me to get the character name from the account ID. I already managed to do this for the source column so that it displays the character name in game, instead of the number. Though the column on the gridlist in game it shows either as 22; or 22;34, depending if there was only 1 affected player, or more. I've posted the code below that populates the gridlist with the data acquired from the mySQL string on the server side. Though how do I go about seperating the ID's and getting the names from them. to display like Derek J;Dustin J or Derek J, Dustin J. I'm using the DGS directx lib, though that shouldn't be much of an issue. function populateLogGrid(logsResult) for i, record in ipairs(logsResult) do local row = DGS:dgsGridListAddRow(grid) DGS:dgsGridListSetItemText(grid, row, col.date, record[1]) local theAct = getActionRecord(tonumber(record[2])) DGS:dgsGridListSetItemText(grid, row, col.act, tostring(theAct)) local nameShow = exports.cache:getCharacterNameFromID(record[3]) DGS:dgsGridListSetItemText(grid, row, col.element, tostring(nameShow)) DGS:dgsGridListSetItemText(grid, row, col.elements, record[4]) DGS:dgsGridListSetItemText(grid, row, col.detail, tostring(record[5])) end end addEvent("log:populate", true) addEventHandler("log:populate", localPlayer, populateLogGrid) Edited September 22, 2018 by Ghost156 Link to comment
Ghost156 Posted September 22, 2018 Author Share Posted September 22, 2018 What I forgot in all the haste of writing this, the ID's are not limited to players, these could be vehicle IDs or specific team ID's. Link to comment
Ghost156 Posted September 22, 2018 Author Share Posted September 22, 2018 Nevermind! I've solved it. 1 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