Skip to content

Commit

Permalink
fix(server/players): sort players by playerId
Browse files Browse the repository at this point in the history
  • Loading branch information
antond15 committed Jan 11, 2025
1 parent 7fcd62d commit d35ee62
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use_experimental_fxv2_oal 'yes'

name 'ac_scoreboard'
author 'AC Scripts'
version '2.2.0'
version '2.2.1'
description 'A framework-standalone scoreboard UI for FiveM.'
repository 'https://github.com/acscripts/ac_scoreboard'

Expand Down
7 changes: 3 additions & 4 deletions modules/server/sections/players.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ local Players = {}

CreateThread(function()
for _, playerId in ipairs(GetPlayers()) do
Players[playerId] = GetPlayerName(playerId)
Players[tonumber(playerId)] = GetPlayerName(playerId)
end
end)


AddEventHandler('playerJoining', function()
local playerId = tostring(source)
Players[playerId] = GetPlayerName(playerId)
Players[source] = GetPlayerName(source)
end)

AddEventHandler('playerDropped', function()
Players[tostring(source)] = nil
Players[source] = nil
end)


Expand Down
2 changes: 2 additions & 0 deletions web/src/components/footer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
copied: 'mdi:clipboard-check',
};
// preload icons to prevent possible "flash" of empty icon space before it loads
// since it's visible only on hover, it's quite noticeable
loadIcons([copyIcons.copy, copyIcons.copied]);
</script>

Expand Down

0 comments on commit d35ee62

Please sign in to comment.