Jump to content

Help required.


screedix

Recommended Posts

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
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

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
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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...