• Refreshing a derma panel.
    3 replies, posted
Hello, I've got a scoreboard that appears on a menu when players join the server, but when players join the server it doesn't update/refresh the scoreboard. I was wondering whether there would be a way to refresh/reload the scoreboard every few seconds. I've tried doing this, but nothing appears to happen, as well as players:Reload(); [CODE] timer.Create( "Refresh", 1, 0, function() players:Refresh(true); end)[/CODE] The players is a DPanel, it doesn't refresh the player list or anything, is there a way to do this?
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Panel/Refresh]Panel:Refresh[/url] This refreshes a HTML panel. A DPanel isn't a HTML panel. You will probably have to manually update each of the fields, E.G. [CODE] timer.Simple( "RefreshStuff", 1, 0, function() someText:SetText( newText ) end) [/CODE] It's a pain, but the only other option I can think of would be to delete and recreate the scoreboard every frame
in the panels think hook you should check if the player count has changed, if it has then rebuild the panel
Problem solved thanks to MPan1.
Sorry, you need to Log In to post a reply to this thread.