cityrp.scoreboard
Scoreboard version selection.
The server picks which scoreboard every client opens; sv_scoreboard.lua owns the writes and
core/cl_scoreboard.lua dispatches on the result. Named for load order: the Register call below
needs sh_network.lua first.
- Servercityrp.acommands.scoreboard(ply, version) → boolean?Source ☍
-
Report or switch the server's scoreboard version.
Parameters
- plyPlayerThe player running the command.
- versionstring?The version to switch to. Omitted to report the current one.
Returns
- boolean?False when the command was rejected.
- Sharedcityrp.scoreboard.CanHide(teamIndex) → booleanSource ☍
-
Whether a player on this team may hide on the scoreboard.
Parameters
- teamIndexnumberThe team.
Returns
- boolean
- Servercityrp.scoreboard.Command(ply, args) → boolean?Source ☍
-
/scoreboard hidden [title]and/scoreboard reset.Parameters
- plyPlayerThe player running the command.
- argsstring[]The command's arguments.
Returns
- boolean?False when the command was rejected.
- Servercityrp.scoreboard.ConfiguredDefault() → stringSource ☍
-
The version this server starts on, from the
SCOREBOARD_VERSIONenvironment variable. A missing or unrecognised value falls back tocityrp.scoreboard.DEFAULT_VERSION.Returns
- stringOne of
cityrp.scoreboard.VERSIONS.
- stringOne of
- Sharedcityrp.scoreboard.GetDisguise(target) → number?Source ☍
-
The team a player's clothing disguises them as, if it isn't their own.
Parameters
- targetPlayerThe player.
Returns
- number?
- Sharedcityrp.scoreboard.GetTeamRule(teamIndex) → ScoreboardLookRule?Source ☍
-
The look rule set for a team.
Parameters
- teamIndexnumberThe team.
Returns
- Sharedcityrp.scoreboard.GetTrueJobMarker(target, lookTeam, title) → string?Source ☍
-
The staff marker for a row whose look or title isn't the player's true job, e.g. "(Rebel: Bob's Shop)".
Parameters
- targetPlayerThe player the row is for.
- lookTeamnumberThe team the row shows as.
- titlestringThe row's title.
Returns
- string?Nil when the row already shows the true team and title.
- Sharedcityrp.scoreboard.GetVersion() → stringSource ☍
-
The scoreboard version the server has selected.
Returns
- stringOne of
cityrp.scoreboard.VERSIONS.
- stringOne of
- Sharedcityrp.scoreboard.IsBefore(a, b) → booleanSource ☍
-
Whether one row sorts above another: by look in team registration order, then by rank, then by name. Nothing here reads a true team.
Parameters
- a{ team: number, rank: number, name: string }
- b{ team: number, rank: number, name: string }
Returns
- boolean
- Sharedcityrp.scoreboard.IsVersion(value) → booleanSource ☍
-
Whether a value names a selectable scoreboard version.
Parameters
- valueanyThe value to check.
Returns
- boolean
- Sharedcityrp.scoreboard.ResolveLook(viewer, target) → number, string, boolean, number?Source ☍
-
A player's look as seen by a viewer. true team: the target themselves, or their faction.
Parameters
Returns
- 1numberThe team the row shows as.
- 2stringThe row's title.
- 3booleanTrue when the target is hidden or disguised but this viewer sees their
- 4number?What everyone else sees, when seen through; the row fades towards it.
- Sharedcityrp.scoreboard.SetDisguise(itemID, teamIndex)Source ☍
-
Makes a clothing item disguise its wearer as a team on the scoreboard.
Parameters
- itemIDstringThe clothing item.
- teamIndexnumberThe team its wearer shows as.
- Servercityrp.scoreboard.SetHidden(ply, hidden, title)Source ☍
-
Hides a player on the scoreboard as a Citizen, or shows them as themselves again.
Parameters
- plyPlayerThe player.
- hiddenbooleanWhether to hide them.
- titlestring?The title to show while hidden; "Citizen" when nil or empty.
- Sharedcityrp.scoreboard.SetTeamRule(teamIndex, rule)Source ☍
-
Sets how a team shows on the V2 scoreboard, replacing any rule it already had.
Parameters
- teamIndexnumberThe team.
- ruleScoreboardLookRuleThe team's look rule.
- Servercityrp.scoreboard.SetVersion(version) → booleanSource ☍
-
Selects the scoreboard version for every client. Clients pick it up the next time they open it.
Parameters
- versionstringOne of
cityrp.scoreboard.VERSIONS.
Returns
- booleanFalse, with nothing changed, when
versionis not a scoreboard version.
- versionstringOne of
- SharedScoreboardLookRuleSource ☍
-
How a team shows on the V2 scoreboard.
- Sharedcityrp.scoreboardSource ☍
- Sharedcityrp.scoreboard.DEFAULT_VERSIONSource ☍
-
The version used until the server sets one.
- Sharedcityrp.scoreboard.disguiseModelsSource ☍
- Sharedcityrp.scoreboard.disguisesSource ☍
-
Clothing that disguises its wearer as another team, as
[item id] = team. Filled in beside the team definitions; set throughSetDisguiseso the model lookup is rebuilt. - Servercityrp.scoreboard.loggerSource ☍
-
A namespaced, level-filterable logger. Obtain instances via cityrp.logging.GetLogger rather than constructing directly.
- Sharedcityrp.scoreboard.MAX_TITLE_LENGTHSource ☍
-
Longest override title, matching
/job. - Sharedcityrp.scoreboard.NETVARSource ☍
-
The global network var carrying the active version.
- Sharedcityrp.scoreboard.rulesSource ☍
- SharedScoreboardLookRule.factionSource ☍
-
A viewer on a team of the same faction sees this team's players as their true team.