<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=ALeKS+007</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=ALeKS+007"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/ALeKS_007"/>
	<updated>2026-04-23T01:26:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Dxscoreboard&amp;diff=24174</id>
		<title>Resource:Dxscoreboard</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Dxscoreboard&amp;diff=24174"/>
		<updated>2010-08-05T13:06:21Z</updated>

		<summary type="html">&lt;p&gt;ALeKS 007: /* Exported functions/events */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
The DirectX scoreboard displays connected players, teams, pings and other data for players ingame. It also has a javascript-enabled web interface, so it can be viewed from a browser. It's created as a replacement for the old [[scoreboard]] resource created by [[User:jbeta|jbeta]].&lt;br /&gt;
&lt;br /&gt;
The biggest difference to the old resource is that it is created fully using MTA's DirectX drawing functions.&lt;br /&gt;
When you add a column to the scoreboard, it's linked to the element data field of the same name, so if you add the &amp;quot;score&amp;quot; column, element data in the field &amp;quot;score&amp;quot; will be shown for all players and teams.&lt;br /&gt;
&lt;br /&gt;
Download can be found at the [http://community.mtasa.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=419 MTA community page].&lt;br /&gt;
&lt;br /&gt;
==Exported functions/events==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
===Functions===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardAddColumn ( string name, [ element forElement = getRootElement(), int width = 70, string friendlyName = name, int priority = slot after &amp;quot;name&amp;quot; column ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''name:''' The column name (also the element data name used to get information from).&lt;br /&gt;
*'''forElement:''' The player to who the column should be added for.&lt;br /&gt;
*'''width:''' Width of the column in pixels.&lt;br /&gt;
*'''friendlyName:''' Friendly name (displayed in the scoreboard) of the column.&lt;br /&gt;
*'''priority:''' The priority slot of the column (1-500). If slot isn't free, the column in that slot will be pushed forward.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardRemoveColumn ( string name, [ element forElement = getRootElement() ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''name:''' The column name.&lt;br /&gt;
*'''forElement:''' The player from who the column should be removed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardClearColumns ( [ element forElement = getRootElement() ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''forElement:''' The player whose scoreboard's columns should be cleared.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardResetColumns ( [ element forElement = getRootElement() ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''forElement:''' The player whose scoreboard's columns should be reset (only leaves name and ping).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardSetForced ( bool forced, [ element forElement = getRootElement() ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''forced:''' Should scoreboard be forced.&lt;br /&gt;
*'''forElement:''' The player whose scoreboard should be forced.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardSetSortBy ( string name, [ bool descending = true, element forElement = getRootElement() ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''name:''' The column name. Can also be ''nil'' making the sorting be disabled.&lt;br /&gt;
*'''descending:''' Use descending sort.&lt;br /&gt;
*'''forElement:''' The player whose scoreboard should be sorted.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int scoreboardGetColumnPriority ( string name )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''name:''' The column name.&lt;br /&gt;
'''Returns the column priority (1-500).'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardSetColumnPriority ( string name, int priority, [ element forElement = getRootElement() ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''name:''' The column name.&lt;br /&gt;
*'''priority:''' The priority slot of the column (1-500). If slot isn't free, the column in that slot will be pushed forward.&lt;br /&gt;
*'''forElement:''' The player to who the column should be added for.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int scoreboardGetColumnCount ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*''No arguments.''&lt;br /&gt;
'''Returns scoreboard column count.'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardForceTeamsVisible( bool enabled )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''enabled:''' Should the team header be always visible in the scoreboard (client's setting will be ignored)?&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardForceTeamsHidden( bool enabled )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''enabled:''' Should the team header be always hidden in the scoreboard (client's setting will be ignored)?&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isPrioritySlotFree( int slot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''slot:''' The priority slot that should be checked.&lt;br /&gt;
'''Checks if the specified priority slot is free.'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getNextFreePrioritySlot( [ int startAt = 1 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''startAt:''' At which point should we start looking for free slots.&lt;br /&gt;
'''Finds the next free priority slot.'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' These functions used in [[scoreboard]] resource do also work in dxscoreboard.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool addScoreboardColumn ( string columnName, element visibleToElement, int columnPosition, float columnSize )&lt;br /&gt;
bool removeScoreboardColumn ( string columnName )&lt;br /&gt;
bool setPlayerScoreboardForced ( player thePlayer, bool forced )&lt;br /&gt;
bool resetScoreboardColumns ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
===Functions===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardAddColumn ( string name, [ int width = 70, string friendlyName = name, int priority = slot after &amp;quot;name&amp;quot; column, function textFunction = nil ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''name:''' The column name (also the element data name used to get information from).&lt;br /&gt;
*'''width:''' Width of the column in pixels.&lt;br /&gt;
*'''friendlyName:''' Friendly name (displayed in the scoreboard) of the column.&lt;br /&gt;
*'''priority:''' The priority slot of the column (1-500). If slot isn't free, the column in that slot will be pushed forward.&lt;br /&gt;
*'''textFunction:''' The text function used to process before displaying the content in the column. For example, this function would replace the &amp;quot;_&amp;quot;'s in player names with a space, if added to the &amp;quot;name&amp;quot; column.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function fixName( playerName )&lt;br /&gt;
    return playerName:gsub( &amp;quot;_&amp;quot;, &amp;quot; &amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardRemoveColumn ( string name )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''name:''' The column name.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardClearColumns ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*''No arguments.''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardResetColumns ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*''No arguments.''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardSetForced ( bool forced )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''forced:''' Should scoreboard be forced.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardSetColumnTextFunction ( string name, function textFunction )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''name:''' The column name.&lt;br /&gt;
*'''textFunction:''' The text function used to process before displaying the content in the column. For example, this function would replace the &amp;quot;_&amp;quot;'s in player names with a space, if added to the &amp;quot;name&amp;quot; column.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function fixName( playerName )&lt;br /&gt;
    return playerName:gsub( &amp;quot;_&amp;quot;, &amp;quot; &amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardSetSortBy ( string name, [ bool descending = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''name:''' The column name. Can also be ''nil'' making the sorting be disabled.&lt;br /&gt;
*'''descending:''' Use descending sort.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int scoreboardGetColumnPriority ( string name )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''name:''' The column name.&lt;br /&gt;
'''Returns the column priority (1-500).'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool scoreboardSetColumnPriority ( string name, int priority )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''name:''' The column name.&lt;br /&gt;
*'''priority:''' The priority slot of the column (1-500). If slot isn't free, the column in that slot will be pushed forward.&lt;br /&gt;
*'''forElement:''' The player to who the column should be added for.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int scoreboardGetColumnCount ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*''No arguments.''&lt;br /&gt;
'''Returns scoreboard column count.'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isPrioritySlotFree( int slot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''slot:''' The priority slot that should be checked.&lt;br /&gt;
'''Checks if the specified priority slot is free.'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getNextFreePrioritySlot( [ int startAt = 1 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''startAt:''' At which point should we start looking for free slots.&lt;br /&gt;
'''Finds the next free priority slot.'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int, int scoreboardGetTopCornerPosition ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Returns the absolute position of the scoreboards top corner if it's drawn, ''false'' otherwise.'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int, int scoreboardGetSize ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Returns the absolute size (width, height) of the scoreboard if it's drawn, ''false'' otherwise.'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table scoreboardGetSelectedRows ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Returns a table with all the selected rows (element, which can be either team or player). Can also return an empty table if rows are selected.''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' These functions used in [[scoreboard]] resource do also work in dxscoreboard.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setScoreboardForced ( bool forced )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Events===&lt;br /&gt;
====onClientPlayerScoreboardClick====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool selected, int cursorX, int cursorY&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''selected:''' Was the current row selected (''true'') or unselected (''false'').&lt;br /&gt;
*'''cursorX:''' Absolute X position of the cursor.&lt;br /&gt;
*'''cursorY:''' Absolute Y position of the cursor.&lt;br /&gt;
'''Triggered when a player clicks team/player row with the left mouse button.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''Event ''source'' is the element was clicked, can be either [[player]] or [[team]].'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can call them from another resource using call()&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
call ( getResourceFromName ( &amp;quot;dxscoreboard&amp;quot; ), &amp;quot;AddScoreboardColumn&amp;quot;, &amp;quot;Wanted level&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
-- Note that this syntax is also valid&lt;br /&gt;
exports.dxscoreboard:scoreboardAddColumn( &amp;quot;Wanted level&amp;quot; )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can set the scoreboard data with setElementData:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- 3 is inserted in the player's wanted level column, if column&lt;br /&gt;
-- called &amp;quot;Wanted level&amp;quot; has been added in the scoreboard&lt;br /&gt;
setElementData ( player, &amp;quot;Wanted level&amp;quot;, 3 ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>ALeKS 007</name></author>
	</entry>
</feed>