Skip to content

feat(nui): add live players map to the in-game menu - #1151

Open
someone005 wants to merge 1 commit into
citizenfx:developfrom
someone005:feat/players-map
Open

someone005 wants to merge 1 commit into
citizenfx:developfrom
someone005:feat/players-map

Conversation

@someone005

Copy link
Copy Markdown

Problem

The in-game Players tab currently tells an admin only one thing about a player's location: their distance in meters. That number has no direction, so it doesn't help answer the questions admins actually have during moderation. When a report comes in about a fight, a griefer or a player stuck somewhere, the admin has to either teleport to the player blindly or spectate players one by one to understand what is going on. The list also can't show relations between players, so there is no quick way to notice that ten people have gathered in one spot, that someone is far outside the area where a roleplay scene takes place, or that a player is moving across the map in a way that doesn't look legitimate. On busy servers this costs time with every report, and it is exactly the kind of overview that a list of names cannot give.

Change

This PR adds a live map to the in-game Players tab. A new round button with a pin icon in the bottom-right corner switches the tab from the list to a satellite map of GTA V, where every player is shown as a circle with their server ID. When players are so close that their circles overlap by at least 20%, the circles merge into one placed between them, showing the number of players (or 9+ for ten or more), so crowded areas stay readable instead of turning into a pile of overlapping markers.

Clicking a single player opens the same player modal as clicking them in the list, so all existing actions are one click away. Clicking a merged circle opens a side list of the players in it, and each of them can be clicked as well. The map can be zoomed with the mouse wheel and moved by dragging, and it can't be dragged past its edges. It respects the current search and filter, and while it is open, positions refresh every 2.5 seconds instead of the list's usual 5.

Notes

The feature requires OneSync. The server was already collecting player coordinates for the distance column, so the only change on the Lua side is that the client now passes them to the NUI. The map button is hidden on RedM, since the map is GTA V only.

The map image (nui/public/images/map-satellite.jpg, 5944x8075, about 15MB) is kept at full resolution on purpose, because a smaller image became visibly pixelated when zoomed in. Coordinates were calibrated against 12 known in-game landmarks, and the error is at most around 7 game units, which is smaller than a player marker.

For now this is only in the in-game menu. If there is a need or request for it, it can also be added to the web panel, either in this PR or in a follow-up one.

Previews

image image image image

@someone005
someone005 requested a review from tabarra as a code owner October 13, 2026 14:12
Signed-off-by: someone <98275381+someone005@users.noreply.github.com>
ASTROWwwW pushed a commit to ASTROWwwW/better-txAdmin that referenced this pull request Oct 29, 2026
Imported from citizenfx#1151, taking only its feature commit (ba1dffd), which sits on top of unrelated wip commits in that PR.

Adapted on import: the 15 MB satellite image is downscaled to 3000x4076 (1.7 MB) because nui/** is downloaded by every player joining the server, and the maximum zoom goes from 32 to 8 to match the image resolution. The origin and the usage rights of the satellite image are not verified.

Signed-off-by: someone <98275381+someone005@users.noreply.github.com>

Claude-Session: https://claude.ai/code/session_01UkEUa9SLFwKVZvxaBcVkm5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant