About PointsUI
PointsUI is a Rust server plugin that introduces stylistic user interface elements that indicate the gain of points due to different events. The plugin is highly configurable and comes with a set of built-in events, as of version 1.0.1, these built-in events include
- Eliminations - issued when a player kills another player
- Knocks - issued when a player wounds another player
- Assists - issued when a player kills a wounded player that had been wounded by someone else
- Headshots - issued when a kill (or a knock, configurable) is the result of a head-shot
- Long shots - issued when a kill (or a knock, configurable) is the result of a shot fired from a configurable distance
Demo
Installation
- Download the PointsUI.cs plugin file.
- Place the plugin file into your server’s plugins directory.
Usage/Commands
/pointsui help
Display the available sub-commands menu.
/pointsui <on|off>
Enable or disable the display of plugin UI elements for yourself (the command issuer).
/pointsui add <player> <score> [(key|value) <message>]
Display (or add-to) the given score and an optional text label next to said score for the target player. The score argument is expected to be a number. If the key/value argument is "value", the message argument will be interpreted as-in by the issued command. Otherwise, if the key/value argument is "key", the message argument will be passed through as a key in the plugin language (i18n) component and its result will be used. Using the "key" option is recommended if you wish to support multiple language options for the UI labels and applied to players automatically based on their individual game language settings.
/pointsui clear <player>
Clears any points UI elements currently active for the target player.
Permissions
-
pointsui.display - Allows the player to have UI elements displayed.
-
pointsui.command.toggle- Allows the command sender access to the /pointsui <on|off> sub-command.
-
pointsui.command.add - Allows the command sender access to the /pointsui add sub-command.
-
pointsui.command.clear- Allows the command sender access to the /pointsui clear sub-command.
Configuration
{ "Sum score": { "Stages": [ { "Color": "#ED2703", "Fade in duration": 0.03, "Delay": 0.05 }, { "Color": "#EC8D21", "Fade in duration": 0.04, "Delay": 0.05 }, { "Color": "#F5E86C", "Fade in duration": 0.1, "Delay": 0.1 } ], "Font": "robotocondensed-bold.ttf", "Font size": 18 }, "Score history lines": { "Color": "#FFFFFF", "Fade in duration": 0.3, "Font": "robotocondensed-bold.ttf", "Font size": 14, "Maximum displayed line count": 4, "Delay between new line additions": 0.3, "Ignore delay of first new line addition": false }, "Delay to start reducing score history after last score update": 2.0, "Delay between each score reduction": 0.5, "Position": { "Anchor Min X": 0.6, "Anchor Min Y": 0.5, "Anchor Max X": 1.0, "Anchor Max Y": 1.0, "Distance between score sum and score history": 16.0, "Score history line size": 16.0 }, "Built-in hooks": { "Affect players": true, "Affect NPCs": false, "NPC types emulating players (advanced)": [ "CustomScientistNpc" ], "Elimination": { "Enabled": true, "Commands": [ "pointsui add {attacker.id} 100 key ELIMINATION" ] }, "Knock": { "Enabled": true, "Commands": [ "pointsui add {attacker.id} 50 key KNOCK" ] }, "Assist": { "Enabled": true, "Commands": [ "pointsui add {attacker.id} 25 key ASSIST" ] }, "Headshot": { "Award on knock": false, "Award on elimination": true, "Enabled": true, "Commands": [ "pointsui add {attacker.id} 25 key HEADSHOT" ] }, "Long shot": { "Award on knock": false, "Award on elimination": true, "Distance": 3000.0, "Enabled": true, "Commands": [ "pointsui add {attacker.id} 25 key LONGSHOT" ] } } }
Configuration Notes
Sum score
The sum score section controls the behavior of the score streak element. By default, it emulates a color animation by stacking multiple text elements of the same text value, but of different colors, fade-in time and display delay. New layers/stages can be added or removed. The delay of each stage controls when the next stage will occur. It is recommended to keep the fade-in time less than or equal to the delay time.
Score history lines
The score history lines section controls the past scores that make up the score streak.
Built-in hooks
The plugin is primarily designed for other plugins to use, however some built-in hooks are provided. The commands section allows to enter 0 or more commands to execute when the hook is ran. The valid placeholders for command arguments are {attacker.id}, {attacker.name}, {victim.id}, and {victim.name}, which correspond the the user steam ID and the display names of the attacker and victim players respectively.
Developer API
void API_AddScore(BasePlayer player, int score, string? message) void API_ClearScore(BasePlayer player)