Chaz-CR Posted March 23, 2014 Share Posted March 23, 2014 So how the title says, i want to refresh the gridlist of the players when i open the panel, how can i do that? this is what i did with a loop. for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist, row, playcol, string.gsub ( getPlayerName (playeritem), '#%x%x%x%x%x%x','' ), false, false ) end Link to comment
Spajk Posted March 24, 2014 Share Posted March 24, 2014 https://wiki.multitheftauto.com/wiki/GuiGridListClear Use this function to remove all the data from the gridlist and then just use the code you wrote above. Link to comment
Chaz-CR Posted March 24, 2014 Author Share Posted March 24, 2014 Thanks man i solved it! Link to comment
OGF Posted March 24, 2014 Share Posted March 24, 2014 watup Chaz, how you been? What you could also do to update the panel playerlist on events such as onClientPlayerJoin, onClientPlayerQuit, and onClientPlayerChangeNick. That way when you have the panel opened it just updates it automatically instead of opening and closing just so it refreshes. Link to comment
Chaz-CR Posted March 24, 2014 Author Share Posted March 24, 2014 Hey T-Bom I've been fine thanks. And i didn't know that. Those functions might be helpful in other resource I'm making, thanks for the help! Link to comment
Spajk Posted March 24, 2014 Share Posted March 24, 2014 It all depends on how often that panel is used. If the panel is often used then you should constantly update it on these events, but if the panel is rarely used then there's no need for constant updating. 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