screedix Posted April 29, 2017 Share Posted April 29, 2017 Hello, I'm having a slight problem which I'm really hoping to find an answer for. I'm using lil_toady's admin panel on my server, associated with it's "team-system". When a team is created, it's also sent to the scoreboard (TAB BUTTON). The problem is, I'd want to hide the team when none of it's members are online. Currently, when nobody is online from the team, all it does is shows the team name and then "0 players" at the end. Is there a way to fix this? Thank you in advance. Link to comment
NeXuS™ Posted April 29, 2017 Share Posted April 29, 2017 You'll have to edit the scoreboard to fix it. Link to comment
screedix Posted April 29, 2017 Author Share Posted April 29, 2017 1 minute ago, NeXuS™ said: You'll have to edit the scoreboard to fix it. How tho? Link to comment
Simple. Posted April 29, 2017 Share Posted April 29, 2017 go to file dxscoreboard_client.lua in scoreboard script add this code after line 398 if #getPlayersInTeam ( team ) ~= 0 then and after line 443 after this code teamSortTableIndex = teamSortTableIndex + 1 add end Link to comment
screedix Posted April 29, 2017 Author Share Posted April 29, 2017 2 hours ago, 'SimpleArtS . . said: go to file dxscoreboard_client.lua in scoreboard script add this code after line 398 if #getPlayersInTeam ( team ) ~= 0 then and after line 443 after this code teamSortTableIndex = teamSortTableIndex + 1 add end Absolute legend, thanks! One more thing, that'd be perfect.. can I somehow make it so when a player gets assigned to a team, their name color changes automatically to the one the team has? Link to comment
NeXuS™ Posted April 29, 2017 Share Posted April 29, 2017 Use getTeamColorsetPlayerNametagColor I think the scoreboard uses the player's nametag color. Link to comment
screedix Posted April 29, 2017 Author Share Posted April 29, 2017 2 minutes ago, NeXuS™ said: Use getTeamColorsetPlayerNametagColor I think the scoreboard uses the player's nametag color. Sorry, I'm still learning scripting, can you forward me a bit more deeper into doing that? Link to comment
NeXuS™ Posted April 29, 2017 Share Posted April 29, 2017 Do you have a command so players can create their own team and join a team? Link to comment
Simple. Posted April 29, 2017 Share Posted April 29, 2017 try this function onPreFunction( sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ... ) local args = { ... } if args[2] and getPlayerNametagColor ( args[1] ) ~= getTeamColor ( args[2] ) then local tR, tG, tB = getTeamColor ( args[2] ) setPlayerNametagColor ( args[1], tR, tG, tB ) end end addDebugHook( "preFunction", onPreFunction, { "setPlayerTeam" }) Link to comment
screedix Posted April 29, 2017 Author Share Posted April 29, 2017 11 minutes ago, 'SimpleArtS . . said: try this function onPreFunction( sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ... ) local args = { ... } if args[2] and getPlayerNametagColor ( args[1] ) ~= getTeamColor ( args[2] ) then local tR, tG, tB = getTeamColor ( args[2] ) setPlayerNametagColor ( args[1], tR, tG, tB ) end end addDebugHook( "preFunction", onPreFunction, { "setPlayerTeam" }) Where exactly should I add it? Link to comment
screedix Posted April 29, 2017 Author Share Posted April 29, 2017 18 minutes ago, 'SimpleArtS . . said: server side Doesn't seem to work Link to comment
Simple. Posted April 29, 2017 Share Posted April 29, 2017 sry , try this function onPreFunction( sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ... ) local args = { ... } if args[2] then local tR, tG, tB = getTeamColor ( args[2] ) setPlayerNametagColor ( args[1], tR, tG, tB ) else setPlayerNametagColor ( args[1], false ) end end addDebugHook( "preFunction", onPreFunction, { "setPlayerTeam" }) 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