Akranes123 Posted November 20, 2016 Share Posted November 20, 2016 (edited) Hola, buenas noticias para todos, espero que estés muy bien. Quiero que me ayude con esto estoy editando un marcador y cuando lo activo y entro en mi servidor con mi seudónimo por ejemplo, # FF0000Akranes el código se ve en el marcador Quiero que me ayude con ese pequeño error por favor, no sé cómo hacer que se vaya sin los códigos -- -- Update the scoreboard content -- local currentTick = getTickCount() if (currentTick - scoreboardTicks.lastUpdate > scoreboardTicks.updateInterval and (scoreboardToggled or scoreboardForced)) or forceScoreboardUpdate then forceScoreboardUpdate = false scoreboardContent = {} local index = 1 local sortTableIndex = 1 local sortTable = {} local players = getElementsByType( "player" ) for key, player in ipairs( players ) do if not getPlayerTeam( player ) or not (showTeams or (serverInfo.forceshowteams and not serverInfo.forcehideteams)) or serverInfo.forcehideteams then sortTable[sortTableIndex] = {} for key, column in ipairs( scoreboardColumns ) do local content if column.name == "name" then local playerName = getPlayerName( player ) if serverInfo.allowcolorcodes then if string.find( playerName, "#%x%x%x%x%x%x" ) then local colorCodes = {} while( string.find( playerName, "#%x%x%x%x%x%x" ) ) do local startPos, endPos = string.find( playerName, "#%x%x%x%x%x%x" ) if startPos then colorCode = string.sub( playerName, startPos, endPos ) table.insert( colorCodes, { { getColorFromString( colorCode ) }, startPos } ) playerName = string.gsub( playerName, "#%x%x%x%x%x%x", "", 1 ) end end content = { playerName, colorCodes } else content = playerName end else content = playerName end elseif column.name == "ping" then content = getPlayerPing( player ) else content = getElementData( player, column.name ) end content = iif( content and column.name ~= "name" and type( content ) ~= "table", tostring( content ), content ) if column.textFunction then if content and column.name == "name" and type( content ) == "table" then content[1] = column.textFunction( content[1], player ) else content = column.textFunction( content, player ) end end sortTable[sortTableIndex][column.name] = content sortTable[sortTableIndex]["__SCOREBOARDELEMENT__"] = player end sortTableIndex = sortTableIndex + 1 end end if sortBy.what ~= "__NONE__" then table.sort( sortTable, scoreboardSortFunction ) end for key, value in ipairs( sortTable ) do scoreboardContent[index] = value index = index + 1 end if (showTeams or (serverInfo.forceshowteams and not serverInfo.forcehideteams)) and not serverInfo.forcehideteams then -- And then the teams local teamSortTableIndex = 1 local teamSortTable = {} sortTableIndex = 1 sortTable = {} local teams = getElementsByType( "team" ) for key, team in ipairs( teams ) do -- Add teams to sorting table first teamSortTable[teamSortTableIndex] = {} for key, column in ipairs( scoreboardColumns ) do local content if column.name == "name" then local teamName = getTeamName( team ) local teamMemberCount = #getPlayersInTeam( team ) teamName = iif( teamName, tostring( teamName ), "-" ) teamMemberCount = iif( teamMemberCount, tostring( teamMemberCount ), "0" ) teamName = teamName .. " (" .. teamMemberCount .. " player" .. iif( teamMemberCount == "1", "", "s" ) .. ")" if serverInfo.allowcolorcodes then if string.find( teamName, "#%x%x%x%x%x%x" ) then local colorCodes = {} while( string.find( teamName, "#%x%x%x%x%x%x" ) ) do local startPos, endPos = string.find( teamName, "#%x%x%x%x%x%x" ) if startPos then colorCode = string.sub( teamName, startPos, endPos ) table.insert( colorCodes, { { getColorFromString( colorCode ) }, startPos } ) teamName = string.gsub( teamName, "#%x%x%x%x%x%x", "", 1 ) end end content = { teamName, colorCodes } else content = teamName end else content = teamName end else content = getElementData( team, column.name ) end content = iif( content and column.name ~= "name" and type( content ) ~= "table", tostring( content ), content ) if column.textFunction then if content and column.name == "name" and type( content ) == "table" then content[1] = column.textFunction( content[1], team ) else content = column.textFunction( content, team ) end end teamSortTable[teamSortTableIndex][column.name] = content teamSortTable[teamSortTableIndex]["__SCOREBOARDELEMENT__"] = team end teamSortTableIndex = teamSortTableIndex + 1 -- and then the players sortTableIndex = 1 sortTable[team] = {} local players = getPlayersInTeam( team ) for key, player in ipairs( players ) do sortTable[team][sortTableIndex] = {} for key, column in ipairs( scoreboardColumns ) do local content if column.name == "name" then local playerName = getPlayerName( player ) if serverInfo.allowcolorcodes then if string.find( playerName, "#%x%x%x%x%x%x" ) then local colorCodes = {} while( string.find( playerName, "#%x%x%x%x%x%x" ) ) do local startPos, endPos = string.find( playerName, "#%x%x%x%x%x%x" ) if startPos then colorCode = string.sub( playerName, startPos, endPos ) table.insert( colorCodes, { { getColorFromString( colorCode ) }, startPos } ) playerName = string.gsub( playerName, "#%x%x%x%x%x%x", "", 1 ) end end content = { playerName, colorCodes } else content = playerName end else content = playerName end elseif column.name == "ping" then content = getPlayerPing( player ) else content = getElementData( player, column.name ) end content = iif( content and column.name ~= "name" and type( content ) ~= "table", tostring( content ), content ) if column.textFunction then if content and column.name == "name" and type( content ) == "table" then content[1] = column.textFunction( content[1], player ) else content = column.textFunction( content, player ) end end sortTable[team][sortTableIndex][column.name] = content sortTable[team][sortTableIndex]["__SCOREBOARDELEMENT__"] = player end sortTableIndex = sortTableIndex + 1 end if sortBy.what ~= "__NONE__" then table.sort( sortTable[team], scoreboardSortFunction ) end end if sortBy.what ~= "__NONE__" then table.sort( teamSortTable, scoreboardSortFunction ) end for key, content in ipairs( teamSortTable ) do local team = content["__SCOREBOARDELEMENT__"] scoreboardContent[index] = content index = index + 1 for key, value in ipairs( sortTable[team] ) do scoreboardContent[index] = value index = index + 1 end end end scoreboardTicks.lastUpdate = currentTick end Edited November 20, 2016 by jhxp Link to comment
iPrestege Posted November 20, 2016 Share Posted November 20, 2016 Hi, You can open the admin panel and search for the scoreboard resource and open the setting for the scoreboard and change color code or names not sure from false to true . 1 Link to comment
Akranes123 Posted November 20, 2016 Author Share Posted November 20, 2016 thanks thanks <3 Link to comment
iPrestege Posted November 20, 2016 Share Posted November 20, 2016 You are welcome. PS. Next time please use the code editor so we can read the code. Link to comment
Recommended Posts