//_Dragon Posted January 13, 2016 Share Posted January 13, 2016 Hi guys , i want add name of server & numbre players in this scoreboard !! it's possible ? Pic : http://imgur.com/xMPE4FX Scoreboar ==> https://mega.nz/#!olViCKBa!i41OKi5rLuQa ... CTWo_v8Lo0 Link to comment
' A F . Posted January 13, 2016 Share Posted January 13, 2016 You Can Search In Communtiy https://community.multitheftauto.com/in ... ls&id=9729 Link to comment
1LoL1 Posted January 13, 2016 Share Posted January 13, 2016 Hi guys , i want add name of server & numbre players in this scoreboard !! it's possible ?Pic : http://imgur.com/xMPE4FX Scoreboar ==> https://mega.nz/#!olViCKBa!i41OKi5rLuQa ... CTWo_v8Lo0 Yes it is possible. I tested the script and you forgot used in settings "server" use to "true". Link to comment
//_Dragon Posted January 13, 2016 Author Share Posted January 13, 2016 Yes it is possible. I tested the script and you forgot used in settings "server" use to "true". i think here i can make name server & nums players acces in scoreboard -- THESE CAN BE CHANGED triggerKey = "tab" -- default button to open/close scoreboard settingsKey = "F7" -- default button to open the settings window drawOverGUI = true -- draw scoreboard over gui? seperationSpace = 80 -- the space between top/bottom screen and scoreboard top/bottom in pixels -- BUT DON'T TOUCH THESE scoreboardToggled = false scoreboardForced = false scoreboardDrawn = false forceScoreboardUpdate = false useAnimation = true scoreboardIsToggleable = false showServerInfo = false showGamemodeInfo = false showTeams = true useColors = true drawSpeed = 1 scoreboardScale = 1 teamHeaderFont = "clear" contentFont = "default-bold" columnFont = "default-bold" serverInfoFont = "default" rmbFont = "clear" cBlack = tocolor( 0, 0, 0 ) cWhite = tocolor( 255, 255, 255 ) cSettingsBox = tocolor( 255, 255, 255, 150 ) MAX_PRIRORITY_SLOT = 500 scoreboardColumns = {} resourceColumns = {} scoreboardDimensions = { ["width"] = 0, ["height"] = 0, ["phase"] = 1, ["lastSeconds"] = 0 } scoreboardTicks = { ["lastUpdate"] = 0, ["updateInterval"] = 500 } scoreboardContent = {} firstVisibleIndex = 1 sortBy = { ["what"] = "__NONE__", ["dir"] = -1 } -- -1 = dec, 1 = asc sbOutOffset, sbInOffset = 1, 1 sbFont = "clear" sbFontScale = 0.68 serverInfo = {} fontScale = { -- To make all fonts be equal in height ["default"] = 1.0, ["default-bold"] = 1.0, ["clear"] = 1.0, ["arial"] = 1.0, ["sans"] = 1.0, ["pricedown"] = 0.5, ["bankgothic"] = 0.5, ["diploma"] = 0.5, ["beckett"] = 0.5 } selectedRows = {} addEvent( "onClientPlayerScoreboardClick" ) addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), function ( resource ) cScoreboardBackground = tocolor( defaultSettings.bg_color.r, defaultSettings.bg_color.g, defaultSettings.bg_color.b, defaultSettings.bg_color.a ) cSelection = tocolor( defaultSettings.selection_color.r, defaultSettings.selection_color.g, defaultSettings.selection_color.b, defaultSettings.selection_color.a ) cHighlight = tocolor( defaultSettings.highlight_color.r, defaultSettings.highlight_color.g, defaultSettings.highlight_color.b, defaultSettings.highlight_color.a ) cHeader = tocolor( defaultSettings.header_color.r, defaultSettings.header_color.g, defaultSettings.header_color.b, defaultSettings.header_color.a ) cTeam = tocolor( defaultSettings.team_color.r, defaultSettings.team_color.g, defaultSettings.team_color.b, defaultSettings.team_color.a ) cBorder = tocolor( defaultSettings.border_color.r, defaultSettings.border_color.g, defaultSettings.border_color.b, defaultSettings.border_color.a ) cServerInfo = tocolor( defaultSettings.serverinfo_color.r, defaultSettings.serverinfo_color.g, defaultSettings.serverinfo_color.b, defaultSettings.serverinfo_color.a ) cContent = tocolor( defaultSettings.content_color.r, defaultSettings.content_color.g, defaultSettings.content_color.b, defaultSettings.content_color.a ) bindKey( triggerKey, "down", "Toggle scoreboard", "1" ) bindKey( triggerKey, "up", "Toggle scoreboard", "0" ) bindKey( settingsKey, "down", "Open scoreboard settings", "1" ) addEventHandler( "onClientRender", getRootElement(), drawScoreboard ) triggerServerEvent( "onClientDXScoreboardResourceStart", getRootElement() ) readScoreboardSettings() triggerServerEvent( "requestServerInfo", getRootElement() ) colorPicker.constructor() end ) addEventHandler( "onClientPlayerQuit", getRootElement(), function() selectedRows[source] = nil end ) function sendServerInfo( output ) serverInfo = output end addEvent( "sendServerInfo", true ) addEventHandler( "sendServerInfo", getResourceRootElement( getThisResource() ), sendServerInfo ) function toggleScoreboard( _, state ) state = iif( state == "1", true, false ) if scoreboardIsToggleable and state then scoreboardToggled = not scoreboardToggled elseif not scoreboardIsToggleable then scoreboardToggled = state end end addCommandHandler( "Toggle scoreboard", toggleScoreboard ) function openSettingsWindow() if scoreboardDrawn then local sX, sY = guiGetScreenSize() if not (windowSettings and isElement( windowSettings ) and guiGetVisible( windowSettings )) then createScoreboardSettingsWindow( sX-323, sY-350 ) showCursor( true ) elseif isElement( windowSettings ) then destroyScoreboardSettingsWindow() end end end addCommandHandler( "Open scoreboard settings", openSettingsWindow ) addCommandHandler( "scoreboard", function () scoreboardToggled = not scoreboardToggled end ) function iif( cond, arg1, arg2 ) if cond then return arg1 end return arg2 end function doDrawScoreboard( rtPass, onlyAnim, sX, sY ) if #scoreboardColumns ~= 0 then -- -- In/out animation -- local currentSeconds = getTickCount() / 1000 local deltaSeconds = currentSeconds - scoreboardDimensions.lastSeconds scoreboardDimensions.lastSeconds = currentSeconds deltaSeconds = math.clamp( 0, deltaSeconds, 1/25 ) if scoreboardToggled or scoreboardForced then local phases = { [1] = { ["width"] = s(10), ["height"] = s(5), ["incToWidth"] = s(10), ["incToHeight"] = s(5), ["decToWidth"] = 0, ["decToHeight"] = 0 }, [2] = { ["width"] = s(40), ["height"] = s(5), ["incToWidth"] = calculateWidth(), ["incToHeight"] = s(5), ["decToWidth"] = s(10), ["decToHeight"] = s(5) }, [3] = { ["width"] = calculateWidth(), ["height"] = s(30), ["incToWidth"] = calculateWidth(), ["incToHeight"] = calculateHeight(), ["decToWidth"] = calculateWidth(), ["decToHeight"] = s(5) } } if not useAnimation then scoreboardDimensions.width = calculateWidth() scoreboardDimensions.height = calculateHeight() scoreboardDimensions.phase = #phases end local maxChange = deltaSeconds * 30*drawSpeed local maxWidthDiff = math.clamp( -maxChange, phases[scoreboardDimensions.phase].incToWidth - scoreboardDimensions.width, maxChange ) local maxHeightDiff = math.clamp( -maxChange, phases[scoreboardDimensions.phase].incToHeight - scoreboardDimensions.height, maxChange ) if scoreboardDimensions.width < phases[scoreboardDimensions.phase].incToWidth then scoreboardDimensions.width = scoreboardDimensions.width + maxWidthDiff * phases[scoreboardDimensions.phase].width if scoreboardDimensions.width > phases[scoreboardDimensions.phase].incToWidth then scoreboardDimensions.width = phases[scoreboardDimensions.phase].incToWidth end elseif scoreboardDimensions.width > phases[scoreboardDimensions.phase].incToWidth and not scoreboardDrawn then scoreboardDimensions.width = scoreboardDimensions.width - maxWidthDiff * phases[scoreboardDimensions.phase].width if scoreboardDimensions.width < phases[scoreboardDimensions.phase].incToWidth then scoreboardDimensions.width = phases[scoreboardDimensions.phase].incToWidth end end if scoreboardDimensions.height < phases[scoreboardDimensions.phase].incToHeight then scoreboardDimensions.height = scoreboardDimensions.height + maxHeightDiff * phases[scoreboardDimensions.phase].height if scoreboardDimensions.height > phases[scoreboardDimensions.phase].incToHeight then scoreboardDimensions.height = phases[scoreboardDimensions.phase].incToHeight end elseif scoreboardDimensions.height > phases[scoreboardDimensions.phase].incToHeight and not scoreboardDrawn then scoreboardDimensions.height = scoreboardDimensions.height - maxHeightDiff * phases[scoreboardDimensions.phase].height if scoreboardDimensions.height < phases[scoreboardDimensions.phase].incToHeight then scoreboardDimensions.height = phases[scoreboardDimensions.phase].incToHeight end end if scoreboardDimensions.width == phases[scoreboardDimensions.phase].incToWidth and scoreboardDimensions.height == phases[scoreboardDimensions.phase].incToHeight then if phases[scoreboardDimensions.phase + 1] then scoreboardDimensions.phase = scoreboardDimensions.phase + 1 else if not scoreboardDrawn then bindKey( "mouse2", "both", showTheCursor ) bindKey( "mouse_wheel_up", "down", scrollScoreboard, -1 ) bindKey( "mouse_wheel_down", "down", scrollScoreboard, 1 ) addEventHandler( "onClientClick", getRootElement(), scoreboardClickHandler ) if not (windowSettings and isElement( windowSettings )) then showCursor( false ) end triggerServerEvent( "requestServerInfo", getRootElement() ) end scoreboardDrawn = true end end elseif scoreboardDimensions.width ~= 0 and scoreboardDimensions.height ~= 0 then local phases = { [1] = { ["width"] = s(10), ["height"] = s(5), ["incToWidth"] = s(10), ["incToHeight"] = s(5), ["decToWidth"] = 0, ["decToHeight"] = 0 }, [2] = { ["width"] = s(40), ["height"] = s(5), ["incToWidth"] = calculateWidth(), ["incToHeight"] = s(5), ["decToWidth"] = s(10), ["decToHeight"] = s(5) }, [3] = { Link to comment
-Doc- Posted January 13, 2016 Share Posted January 13, 2016 Here it is. -- THESE CAN BE CHANGED triggerKey = "tab" -- default button to open/close scoreboard settingsKey = "F7" -- default button to open the settings window drawOverGUI = true -- draw scoreboard over gui? seperationSpace = 80 -- the space between top/bottom screen and scoreboard top/bottom in pixels -- BUT DON'T TOUCH THESE scoreboardToggled = false scoreboardForced = false scoreboardDrawn = false forceScoreboardUpdate = false useAnimation = true scoreboardIsToggleable = false showServerInfo = true showGamemodeInfo = false showTeams = true useColors = true drawSpeed = 1 scoreboardScale = 1 teamHeaderFont = "clear" contentFont = "default-bold" columnFont = "default-bold" serverInfoFont = "default" rmbFont = "clear" cBlack = tocolor( 0, 0, 0 ) cWhite = tocolor( 255, 255, 255 ) cSettingsBox = tocolor( 255, 255, 255, 150 ) MAX_PRIRORITY_SLOT = 500 scoreboardColumns = {} resourceColumns = {} scoreboardDimensions = { ["width"] = 0, ["height"] = 0, ["phase"] = 1, ["lastSeconds"] = 0 } scoreboardTicks = { ["lastUpdate"] = 0, ["updateInterval"] = 500 } scoreboardContent = {} firstVisibleIndex = 1 sortBy = { ["what"] = "__NONE__", ["dir"] = -1 } -- -1 = dec, 1 = asc sbOutOffset, sbInOffset = 1, 1 sbFont = "clear" sbFontScale = 0.68 serverInfo = {} fontScale = { -- To make all fonts be equal in height ["default"] = 1.0, ["default-bold"] = 1.0, ["clear"] = 1.0, ["arial"] = 1.0, ["sans"] = 1.0, ["pricedown"] = 0.5, ["bankgothic"] = 0.5, ["diploma"] = 0.5, ["beckett"] = 0.5 } selectedRows = {} addEvent( "onClientPlayerScoreboardClick" ) addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), function ( resource ) cScoreboardBackground = tocolor( defaultSettings.bg_color.r, defaultSettings.bg_color.g, defaultSettings.bg_color.b, defaultSettings.bg_color.a ) cSelection = tocolor( defaultSettings.selection_color.r, defaultSettings.selection_color.g, defaultSettings.selection_color.b, defaultSettings.selection_color.a ) cHighlight = tocolor( defaultSettings.highlight_color.r, defaultSettings.highlight_color.g, defaultSettings.highlight_color.b, defaultSettings.highlight_color.a ) cHeader = tocolor( defaultSettings.header_color.r, defaultSettings.header_color.g, defaultSettings.header_color.b, defaultSettings.header_color.a ) cTeam = tocolor( defaultSettings.team_color.r, defaultSettings.team_color.g, defaultSettings.team_color.b, defaultSettings.team_color.a ) cBorder = tocolor( defaultSettings.border_color.r, defaultSettings.border_color.g, defaultSettings.border_color.b, defaultSettings.border_color.a ) cServerInfo = tocolor( defaultSettings.serverinfo_color.r, defaultSettings.serverinfo_color.g, defaultSettings.serverinfo_color.b, defaultSettings.serverinfo_color.a ) cContent = tocolor( defaultSettings.content_color.r, defaultSettings.content_color.g, defaultSettings.content_color.b, defaultSettings.content_color.a ) bindKey( triggerKey, "down", "Toggle scoreboard", "1" ) bindKey( triggerKey, "up", "Toggle scoreboard", "0" ) bindKey( settingsKey, "down", "Open scoreboard settings", "1" ) addEventHandler( "onClientRender", getRootElement(), drawScoreboard ) triggerServerEvent( "onClientDXScoreboardResourceStart", getRootElement() ) readScoreboardSettings() triggerServerEvent( "requestServerInfo", getRootElement() ) colorPicker.constructor() end ) addEventHandler( "onClientPlayerQuit", getRootElement(), function() selectedRows[source] = nil end ) function sendServerInfo( output ) serverInfo = output end addEvent( "sendServerInfo", true ) addEventHandler( "sendServerInfo", getResourceRootElement( getThisResource() ), sendServerInfo ) function toggleScoreboard( _, state ) state = iif( state == "1", true, false ) if scoreboardIsToggleable and state then scoreboardToggled = not scoreboardToggled elseif not scoreboardIsToggleable then scoreboardToggled = state end end addCommandHandler( "Toggle scoreboard", toggleScoreboard ) function openSettingsWindow() if scoreboardDrawn then local sX, sY = guiGetScreenSize() if not (windowSettings and isElement( windowSettings ) and guiGetVisible( windowSettings )) then createScoreboardSettingsWindow( sX-323, sY-350 ) showCursor( true ) elseif isElement( windowSettings ) then destroyScoreboardSettingsWindow() end end end addCommandHandler( "Open scoreboard settings", openSettingsWindow ) addCommandHandler( "scoreboard", function () scoreboardToggled = not scoreboardToggled end ) function iif( cond, arg1, arg2 ) if cond then return arg1 end return arg2 end function doDrawScoreboard( rtPass, onlyAnim, sX, sY ) if #scoreboardColumns ~= 0 then -- -- In/out animation -- local currentSeconds = getTickCount() / 1000 local deltaSeconds = currentSeconds - scoreboardDimensions.lastSeconds scoreboardDimensions.lastSeconds = currentSeconds deltaSeconds = math.clamp( 0, deltaSeconds, 1/25 ) if scoreboardToggled or scoreboardForced then local phases = { [1] = { ["width"] = s(10), ["height"] = s(5), ["incToWidth"] = s(10), ["incToHeight"] = s(5), ["decToWidth"] = 0, ["decToHeight"] = 0 }, [2] = { ["width"] = s(40), ["height"] = s(5), ["incToWidth"] = calculateWidth(), ["incToHeight"] = s(5), ["decToWidth"] = s(10), ["decToHeight"] = s(5) }, [3] = { ["width"] = calculateWidth(), ["height"] = s(30), ["incToWidth"] = calculateWidth(), ["incToHeight"] = calculateHeight(), ["decToWidth"] = calculateWidth(), ["decToHeight"] = s(5) } } if not useAnimation then scoreboardDimensions.width = calculateWidth() scoreboardDimensions.height = calculateHeight() scoreboardDimensions.phase = #phases end local maxChange = deltaSeconds * 30*drawSpeed local maxWidthDiff = math.clamp( -maxChange, phases[scoreboardDimensions.phase].incToWidth - scoreboardDimensions.width, maxChange ) local maxHeightDiff = math.clamp( -maxChange, phases[scoreboardDimensions.phase].incToHeight - scoreboardDimensions.height, maxChange ) if scoreboardDimensions.width < phases[scoreboardDimensions.phase].incToWidth then scoreboardDimensions.width = scoreboardDimensions.width + maxWidthDiff * phases[scoreboardDimensions.phase].width if scoreboardDimensions.width > phases[scoreboardDimensions.phase].incToWidth then scoreboardDimensions.width = phases[scoreboardDimensions.phase].incToWidth end elseif scoreboardDimensions.width > phases[scoreboardDimensions.phase].incToWidth and not scoreboardDrawn then scoreboardDimensions.width = scoreboardDimensions.width - maxWidthDiff * phases[scoreboardDimensions.phase].width if scoreboardDimensions.width < phases[scoreboardDimensions.phase].incToWidth then scoreboardDimensions.width = phases[scoreboardDimensions.phase].incToWidth end end if scoreboardDimensions.height < phases[scoreboardDimensions.phase].incToHeight then scoreboardDimensions.height = scoreboardDimensions.height + maxHeightDiff * phases[scoreboardDimensions.phase].height if scoreboardDimensions.height > phases[scoreboardDimensions.phase].incToHeight then scoreboardDimensions.height = phases[scoreboardDimensions.phase].incToHeight end elseif scoreboardDimensions.height > phases[scoreboardDimensions.phase].incToHeight and not scoreboardDrawn then scoreboardDimensions.height = scoreboardDimensions.height - maxHeightDiff * phases[scoreboardDimensions.phase].height if scoreboardDimensions.height < phases[scoreboardDimensions.phase].incToHeight then scoreboardDimensions.height = phases[scoreboardDimensions.phase].incToHeight end end if scoreboardDimensions.width == phases[scoreboardDimensions.phase].incToWidth and scoreboardDimensions.height == phases[scoreboardDimensions.phase].incToHeight then if phases[scoreboardDimensions.phase + 1] then scoreboardDimensions.phase = scoreboardDimensions.phase + 1 else if not scoreboardDrawn then bindKey( "mouse2", "both", showTheCursor ) bindKey( "mouse_wheel_up", "down", scrollScoreboard, -1 ) bindKey( "mouse_wheel_down", "down", scrollScoreboard, 1 ) addEventHandler( "onClientClick", getRootElement(), scoreboardClickHandler ) if not (windowSettings and isElement( windowSettings )) then showCursor( false ) end triggerServerEvent( "requestServerInfo", getRootElement() ) end scoreboardDrawn = true end end elseif scoreboardDimensions.width ~= 0 and scoreboardDimensions.height ~= 0 then local phases = { [1] = { ["width"] = s(10), ["height"] = s(5), ["incToWidth"] = s(10), ["incToHeight"] = s(5), ["decToWidth"] = 0, ["decToHeight"] = 0 }, [2] = { ["width"] = s(40), ["height"] = s(5), ["incToWidth"] = calculateWidth(), ["incToHeight"] = s(5), ["decToWidth"] = s(10), ["decToHeight"] = s(5) }, [3] = { Link to comment
//_Dragon Posted January 14, 2016 Author Share Posted January 14, 2016 Here it is. -- THESE CAN BE CHANGED triggerKey = "tab" -- default button to open/close scoreboard settingsKey = "F7" -- default button to open the settings window drawOverGUI = true -- draw scoreboard over gui? seperationSpace = 80 -- the space between top/bottom screen and scoreboard top/bottom in pixels -- BUT DON'T TOUCH THESE scoreboardToggled = false scoreboardForced = false scoreboardDrawn = false forceScoreboardUpdate = false useAnimation = true scoreboardIsToggleable = false showServerInfo = true showGamemodeInfo = false showTeams = true useColors = true drawSpeed = 1 scoreboardScale = 1 teamHeaderFont = "clear" contentFont = "default-bold" columnFont = "default-bold" serverInfoFont = "default" rmbFont = "clear" cBlack = tocolor( 0, 0, 0 ) cWhite = tocolor( 255, 255, 255 ) cSettingsBox = tocolor( 255, 255, 255, 150 ) MAX_PRIRORITY_SLOT = 500 scoreboardColumns = {} resourceColumns = {} scoreboardDimensions = { ["width"] = 0, ["height"] = 0, ["phase"] = 1, ["lastSeconds"] = 0 } scoreboardTicks = { ["lastUpdate"] = 0, ["updateInterval"] = 500 } scoreboardContent = {} firstVisibleIndex = 1 sortBy = { ["what"] = "__NONE__", ["dir"] = -1 } -- -1 = dec, 1 = asc sbOutOffset, sbInOffset = 1, 1 sbFont = "clear" sbFontScale = 0.68 serverInfo = {} fontScale = { -- To make all fonts be equal in height ["default"] = 1.0, ["default-bold"] = 1.0, ["clear"] = 1.0, ["arial"] = 1.0, ["sans"] = 1.0, ["pricedown"] = 0.5, ["bankgothic"] = 0.5, ["diploma"] = 0.5, ["beckett"] = 0.5 } selectedRows = {} addEvent( "onClientPlayerScoreboardClick" ) addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), function ( resource ) cScoreboardBackground = tocolor( defaultSettings.bg_color.r, defaultSettings.bg_color.g, defaultSettings.bg_color.b, defaultSettings.bg_color.a ) cSelection = tocolor( defaultSettings.selection_color.r, defaultSettings.selection_color.g, defaultSettings.selection_color.b, defaultSettings.selection_color.a ) cHighlight = tocolor( defaultSettings.highlight_color.r, defaultSettings.highlight_color.g, defaultSettings.highlight_color.b, defaultSettings.highlight_color.a ) cHeader = tocolor( defaultSettings.header_color.r, defaultSettings.header_color.g, defaultSettings.header_color.b, defaultSettings.header_color.a ) cTeam = tocolor( defaultSettings.team_color.r, defaultSettings.team_color.g, defaultSettings.team_color.b, defaultSettings.team_color.a ) cBorder = tocolor( defaultSettings.border_color.r, defaultSettings.border_color.g, defaultSettings.border_color.b, defaultSettings.border_color.a ) cServerInfo = tocolor( defaultSettings.serverinfo_color.r, defaultSettings.serverinfo_color.g, defaultSettings.serverinfo_color.b, defaultSettings.serverinfo_color.a ) cContent = tocolor( defaultSettings.content_color.r, defaultSettings.content_color.g, defaultSettings.content_color.b, defaultSettings.content_color.a ) bindKey( triggerKey, "down", "Toggle scoreboard", "1" ) bindKey( triggerKey, "up", "Toggle scoreboard", "0" ) bindKey( settingsKey, "down", "Open scoreboard settings", "1" ) addEventHandler( "onClientRender", getRootElement(), drawScoreboard ) triggerServerEvent( "onClientDXScoreboardResourceStart", getRootElement() ) readScoreboardSettings() triggerServerEvent( "requestServerInfo", getRootElement() ) colorPicker.constructor() end ) addEventHandler( "onClientPlayerQuit", getRootElement(), function() selectedRows[source] = nil end ) function sendServerInfo( output ) serverInfo = output end addEvent( "sendServerInfo", true ) addEventHandler( "sendServerInfo", getResourceRootElement( getThisResource() ), sendServerInfo ) function toggleScoreboard( _, state ) state = iif( state == "1", true, false ) if scoreboardIsToggleable and state then scoreboardToggled = not scoreboardToggled elseif not scoreboardIsToggleable then scoreboardToggled = state end end addCommandHandler( "Toggle scoreboard", toggleScoreboard ) function openSettingsWindow() if scoreboardDrawn then local sX, sY = guiGetScreenSize() if not (windowSettings and isElement( windowSettings ) and guiGetVisible( windowSettings )) then createScoreboardSettingsWindow( sX-323, sY-350 ) showCursor( true ) elseif isElement( windowSettings ) then destroyScoreboardSettingsWindow() end end end addCommandHandler( "Open scoreboard settings", openSettingsWindow ) addCommandHandler( "scoreboard", function () scoreboardToggled = not scoreboardToggled end ) function iif( cond, arg1, arg2 ) if cond then return arg1 end return arg2 end function doDrawScoreboard( rtPass, onlyAnim, sX, sY ) if #scoreboardColumns ~= 0 then -- -- In/out animation -- local currentSeconds = getTickCount() / 1000 local deltaSeconds = currentSeconds - scoreboardDimensions.lastSeconds scoreboardDimensions.lastSeconds = currentSeconds deltaSeconds = math.clamp( 0, deltaSeconds, 1/25 ) if scoreboardToggled or scoreboardForced then local phases = { [1] = { ["width"] = s(10), ["height"] = s(5), ["incToWidth"] = s(10), ["incToHeight"] = s(5), ["decToWidth"] = 0, ["decToHeight"] = 0 }, [2] = { ["width"] = s(40), ["height"] = s(5), ["incToWidth"] = calculateWidth(), ["incToHeight"] = s(5), ["decToWidth"] = s(10), ["decToHeight"] = s(5) }, [3] = { ["width"] = calculateWidth(), ["height"] = s(30), ["incToWidth"] = calculateWidth(), ["incToHeight"] = calculateHeight(), ["decToWidth"] = calculateWidth(), ["decToHeight"] = s(5) } } if not useAnimation then scoreboardDimensions.width = calculateWidth() scoreboardDimensions.height = calculateHeight() scoreboardDimensions.phase = #phases end local maxChange = deltaSeconds * 30*drawSpeed local maxWidthDiff = math.clamp( -maxChange, phases[scoreboardDimensions.phase].incToWidth - scoreboardDimensions.width, maxChange ) local maxHeightDiff = math.clamp( -maxChange, phases[scoreboardDimensions.phase].incToHeight - scoreboardDimensions.height, maxChange ) if scoreboardDimensions.width < phases[scoreboardDimensions.phase].incToWidth then scoreboardDimensions.width = scoreboardDimensions.width + maxWidthDiff * phases[scoreboardDimensions.phase].width if scoreboardDimensions.width > phases[scoreboardDimensions.phase].incToWidth then scoreboardDimensions.width = phases[scoreboardDimensions.phase].incToWidth end elseif scoreboardDimensions.width > phases[scoreboardDimensions.phase].incToWidth and not scoreboardDrawn then scoreboardDimensions.width = scoreboardDimensions.width - maxWidthDiff * phases[scoreboardDimensions.phase].width if scoreboardDimensions.width < phases[scoreboardDimensions.phase].incToWidth then scoreboardDimensions.width = phases[scoreboardDimensions.phase].incToWidth end end if scoreboardDimensions.height < phases[scoreboardDimensions.phase].incToHeight then scoreboardDimensions.height = scoreboardDimensions.height + maxHeightDiff * phases[scoreboardDimensions.phase].height if scoreboardDimensions.height > phases[scoreboardDimensions.phase].incToHeight then scoreboardDimensions.height = phases[scoreboardDimensions.phase].incToHeight end elseif scoreboardDimensions.height > phases[scoreboardDimensions.phase].incToHeight and not scoreboardDrawn then scoreboardDimensions.height = scoreboardDimensions.height - maxHeightDiff * phases[scoreboardDimensions.phase].height if scoreboardDimensions.height < phases[scoreboardDimensions.phase].incToHeight then scoreboardDimensions.height = phases[scoreboardDimensions.phase].incToHeight end end if scoreboardDimensions.width == phases[scoreboardDimensions.phase].incToWidth and scoreboardDimensions.height == phases[scoreboardDimensions.phase].incToHeight then if phases[scoreboardDimensions.phase + 1] then scoreboardDimensions.phase = scoreboardDimensions.phase + 1 else if not scoreboardDrawn then bindKey( "mouse2", "both", showTheCursor ) bindKey( "mouse_wheel_up", "down", scrollScoreboard, -1 ) bindKey( "mouse_wheel_down", "down", scrollScoreboard, 1 ) addEventHandler( "onClientClick", getRootElement(), scoreboardClickHandler ) if not (windowSettings and isElement( windowSettings )) then showCursor( false ) end triggerServerEvent( "requestServerInfo", getRootElement() ) end scoreboardDrawn = true end end elseif scoreboardDimensions.width ~= 0 and scoreboardDimensions.height ~= 0 then local phases = { [1] = { ["width"] = s(10), ["height"] = s(5), ["incToWidth"] = s(10), ["incToHeight"] = s(5), ["decToWidth"] = 0, ["decToHeight"] = 0 }, [2] = { ["width"] = s(40), ["height"] = s(5), ["incToWidth"] = calculateWidth(), ["incToHeight"] = s(5), ["decToWidth"] = s(10), ["decToHeight"] = s(5) Link to comment
//_Dragon Posted January 14, 2016 Author Share Posted January 14, 2016 here too must be edited i think ---- dxscoreboard_clientsettings settings = { ["useanimation"] = nil, ["toggleable"] = nil, ["showserverinfo"] = nil, ["showgamemodeinfo"] = nil, ["showteams"] = nil, ["usecolors"] = nil, ["drawspeed"] = nil, ["scale"] = nil, ["columnfont"] = nil, ["contentfont"] = nil, ["teamfont"] = nil, ["serverinfofont"] = nil, ["bg_color"] = {}, ["selection_color"] = {}, ["highlight_color"] = {}, ["header_color"] = {}, ["team_color"] = {}, ["border_color"] = {}, ["serverinfo_color"] = {}, ["content_color"] = {} } defaultSettings = { ["useanimation"] = true, ["toggleable"] = false, ["showserverinfo"] = false, ["showgamemodeinfo"] = false, ["showteams"] = true, ["usecolors"] = true, ["drawspeed"] = 1.5, ["scale"] = 1.0, ["columnfont"] = "default-bold", ["contentfont"] = "default-bold", ["teamfont"] = "clear", ["serverinfofont"] = "default", ["bg_color"] = { ["r"] = 0, ["g"] = 0, ["b"] = 0, ["a"] = 170 }, ["selection_color"] = { ["r"] = 82, ["g"] = 103, ["b"] = 188, ["a"] = 170 }, ["highlight_color"] = { ["r"] = 255, ["g"] = 255, ["b"] = 255, ["a"] = 50 }, ["header_color"] = { ["r"] = 100, ["g"] = 100, ["b"] = 100, ["a"] = 255 }, ["team_color"] = { ["r"] = 100, ["g"] = 100, ["b"] = 100, ["a"] = 100 }, ["border_color"] = { ["r"] = 100, ["g"] = 100, ["b"] = 100, ["a"] = 50 }, ["serverinfo_color"] = { ["r"] = 150, ["g"] = 150, ["b"] = 150, ["a"] = 255 }, ["content_color"] = { ["r"] = 255, ["g"] = 255, ["b"] = 255, ["a"] = 255 } } tempColors = { ["bg_color"] = { ["r"] = nil, ["g"] = nil, ["b"] = nil, ["a"] = nil }, ["selection_color"] = { ["r"] = nil, ["g"] = nil, ["b"] = nil, ["a"] = nil }, ["highlight_color"] = { ["r"] = nil, ["g"] = nil, ["b"] = nil, ["a"] = nil }, ["header_color"] = { ["r"] = nil, ["g"] = nil, ["b"] = nil, ["a"] = nil }, ["team_color"] = { ["r"] = nil, ["g"] = nil, ["b"] = nil, ["a"] = nil }, ["border_color"] = { ["r"] = nil, ["g"] = nil, ["b"] = nil, ["a"] = nil }, ["serverinfo_color"] = { ["r"] = nil, ["g"] = nil, ["b"] = nil, ["a"] = nil }, ["content_color"] = { ["r"] = nil, ["g"] = nil, ["b"] = nil, ["a"] = nil } } MAX_DRAWSPEED = 4.0 MIN_DRAWSPEED = 0.5 MAX_SCALE = 2.5 MIN_SCALE = 0.5 fontIndexes = { ["column"] = 1, ["content"] = 1, ["team"] = 1, ["serverinfo"] = 1 } fontNames = { "default", "default-bold", "clear", "arial", "sans","pricedown", "bankgothic", "diploma", "beckett" } function readScoreboardSettings() local settingsFile = xmlLoadFile( "settings.xml" ) if not settingsFile then settingsFile = xmlCreateFile( "settings.xml", "settings" ) if not settingsFile then return false end local useanimationTag = xmlCreateChild( settingsFile, "useanimation" ) xmlNodeSetValue( useanimationTag, tostring( defaultSettings.useanimation ) ) local toggleableTag = xmlCreateChild( settingsFile, "toggleable" ) xmlNodeSetValue( toggleableTag, tostring( defaultSettings.toggleable ) ) local showserverinfoTag = xmlCreateChild( settingsFile, "showserverinfo" ) xmlNodeSetValue( showserverinfoTag, tostring( defaultSettings.showserverinfo ) ) local showgamemodeinfoTag = xmlCreateChild( settingsFile, "showgamemodeinfo" ) xmlNodeSetValue( showgamemodeinfoTag, tostring( defaultSettings.showgamemodeinfo ) ) local showteamsTag = xmlCreateChild( settingsFile, "showteams" ) xmlNodeSetValue( showteamsTag, tostring( defaultSettings.showteams ) ) local usecolorsTag = xmlCreateChild( settingsFile, "usecolors" ) xmlNodeSetValue( usecolorsTag, tostring( defaultSettings.usecolors ) ) local drawspeedTag = xmlCreateChild( settingsFile, "drawspeed" ) xmlNodeSetValue( drawspeedTag, tostring( defaultSettings.drawspeed ) ) local scaleTag = xmlCreateChild( settingsFile, "scale" ) xmlNodeSetValue( scaleTag, tostring( defaultSettings.scale ) ) local columnfontTag = xmlCreateChild( settingsFile, "columnfont" ) xmlNodeSetValue( columnfontTag, tostring( defaultSettings.columnfont ) ) local contentfontTag = xmlCreateChild( settingsFile, "contentfont" ) xmlNodeSetValue( contentfontTag, tostring( defaultSettings.contentfont ) ) local teamfontTag = xmlCreateChild( settingsFile, "teamfont" ) xmlNodeSetValue( teamfontTag, tostring( defaultSettings.teamfont ) ) local serverinfofontTag = xmlCreateChild( settingsFile, "serverinfofont" ) xmlNodeSetValue( serverinfofontTag, tostring( defaultSettings.serverinfofont ) ) local bg_colorTag = xmlCreateChild( settingsFile, "bg_color" ) xmlNodeSetAttribute( bg_colorTag, "r", tostring( defaultSettings.bg_color.r ) ) xmlNodeSetAttribute( bg_colorTag, "g", tostring( defaultSettings.bg_color.g ) ) xmlNodeSetAttribute( bg_colorTag, "b", tostring( defaultSettings.bg_color.b ) ) xmlNodeSetAttribute( bg_colorTag, "a", tostring( defaultSettings.bg_color.a ) ) local selection_colorTag = xmlCreateChild( settingsFile, "selection_color" ) xmlNodeSetAttribute( selection_colorTag, "r", tostring( defaultSettings.selection_color.r ) ) xmlNodeSetAttribute( selection_colorTag, "g", tostring( defaultSettings.selection_color.g ) ) xmlNodeSetAttribute( selection_colorTag, "b", tostring( defaultSettings.selection_color.b ) ) xmlNodeSetAttribute( selection_colorTag, "a", tostring( defaultSettings.selection_color.a ) ) local highlight_colorTag = xmlCreateChild( settingsFile, "highlight_color" ) xmlNodeSetAttribute( highlight_colorTag, "r", tostring( defaultSettings.highlight_color.r ) ) xmlNodeSetAttribute( highlight_colorTag, "g", tostring( defaultSettings.highlight_color.g ) ) xmlNodeSetAttribute( highlight_colorTag, "b", tostring( defaultSettings.highlight_color.b ) ) xmlNodeSetAttribute( highlight_colorTag, "a", tostring( defaultSettings.highlight_color.a ) ) local header_colorTag = xmlCreateChild( settingsFile, "header_color" ) xmlNodeSetAttribute( header_colorTag, "r", tostring( defaultSettings.header_color.r ) ) xmlNodeSetAttribute( header_colorTag, "g", tostring( defaultSettings.header_color.g ) ) xmlNodeSetAttribute( header_colorTag, "b", tostring( defaultSettings.header_color.b ) ) xmlNodeSetAttribute( header_colorTag, "a", tostring( defaultSettings.header_color.a ) ) local team_colorTag = xmlCreateChild( settingsFile, "team_color" ) xmlNodeSetAttribute( team_colorTag, "r", tostring( defaultSettings.team_color.r ) ) xmlNodeSetAttribute( team_colorTag, "g", tostring( defaultSettings.team_color.g ) ) xmlNodeSetAttribute( team_colorTag, "b", tostring( defaultSettings.team_color.b ) ) xmlNodeSetAttribute( team_colorTag, "a", tostring( defaultSettings.team_color.a ) ) local border_colorTag = xmlCreateChild( settingsFile, "border_color" ) xmlNodeSetAttribute( border_colorTag, "r", tostring( defaultSettings.border_color.r ) ) xmlNodeSetAttribute( border_colorTag, "g", tostring( defaultSettings.border_color.g ) ) xmlNodeSetAttribute( border_colorTag, "b", tostring( defaultSettings.border_color.b ) ) xmlNodeSetAttribute( border_colorTag, "a", tostring( defaultSettings.border_color.a ) ) local serverinfo_colorTag = xmlCreateChild( settingsFile, "serverinfo_color" ) xmlNodeSetAttribute( serverinfo_colorTag, "r", tostring( defaultSettings.serverinfo_color.r ) ) xmlNodeSetAttribute( serverinfo_colorTag, "g", tostring( defaultSettings.serverinfo_color.g ) ) xmlNodeSetAttribute( serverinfo_colorTag, "b", tostring( defaultSettings.serverinfo_color.b ) ) xmlNodeSetAttribute( serverinfo_colorTag, "a", tostring( defaultSettings.serverinfo_color.a ) ) local content_colorTag = xmlCreateChild( settingsFile, "content_color" ) xmlNodeSetAttribute( content_colorTag, "r", tostring( defaultSettings.content_color.r ) ) xmlNodeSetAttribute( content_colorTag, "g", tostring( defaultSettings.content_color.g ) ) xmlNodeSetAttribute( content_colorTag, "b", tostring( defaultSettings.content_color.b ) ) xmlNodeSetAttribute( content_colorTag, "a", tostring( defaultSettings.content_color.a ) ) xmlSaveFile( settingsFile ) end local useanimationTag = xmlFindChild( settingsFile, "useanimation", 0 ) if not useanimationTag then useanimationTag = xmlCreateChild( settingsFile, "useanimation" ) xmlNodeSetValue( useanimationTag, tostring( defaultSettings.useanimation ) ) xmlSaveFile( settingsFile ) end local toggleableTag = xmlFindChild( settingsFile, "toggleable", 0 ) if not toggleableTag then toggleableTag = xmlCreateChild( settingsFile, "toggleable" ) xmlNodeSetValue( toggleableTag, tostring( defaultSettings.toggleable ) ) xmlSaveFile( settingsFile ) end local showserverinfoTag = xmlFindChild( settingsFile, "showserverinfo", 0 ) if not showserverinfoTag then showserverinfoTag = xmlCreateChild( settingsFile, "showserverinfo" ) xmlNodeSetValue( showserverinfoTag, tostring( defaultSettings.showserverinfo ) ) xmlSaveFile( settingsFile ) end local showgamemodeinfoTag = xmlFindChild( settingsFile, "showgamemodeinfo", 0 ) if not showgamemodeinfoTag then showgamemodeinfoTag = xmlCreateChild( settingsFile, "showgamemodeinfo" ) xmlNodeSetValue( showgamemodeinfoTag, tostring( defaultSettings.showgamemodeinfo ) ) Link to comment
-Doc- Posted January 14, 2016 Share Posted January 14, 2016 https://community.multitheftauto.com/index.php?p=resources&s=download&resource=419&selectincludes=1 Link to comment
//_Dragon Posted January 14, 2016 Author Share Posted January 14, 2016 I fixe it thanks But i want how i can change column server name & player because fonts it's small and i want make it a little larger How :v ? 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