Skip to content

Commit d35ee62

Browse files
committed
fix(server/players): sort players by playerId
1 parent 7fcd62d commit d35ee62

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

fxmanifest.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use_experimental_fxv2_oal 'yes'
55

66
name 'ac_scoreboard'
77
author 'AC Scripts'
8-
version '2.2.0'
8+
version '2.2.1'
99
description 'A framework-standalone scoreboard UI for FiveM.'
1010
repository 'https://github.com/acscripts/ac_scoreboard'
1111

modules/server/sections/players.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@ local Players = {}
22

33
CreateThread(function()
44
for _, playerId in ipairs(GetPlayers()) do
5-
Players[playerId] = GetPlayerName(playerId)
5+
Players[tonumber(playerId)] = GetPlayerName(playerId)
66
end
77
end)
88

99

1010
AddEventHandler('playerJoining', function()
11-
local playerId = tostring(source)
12-
Players[playerId] = GetPlayerName(playerId)
11+
Players[source] = GetPlayerName(source)
1312
end)
1413

1514
AddEventHandler('playerDropped', function()
16-
Players[tostring(source)] = nil
15+
Players[source] = nil
1716
end)
1817

1918

web/src/components/footer.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
copied: 'mdi:clipboard-check',
2020
};
2121
22+
// preload icons to prevent possible "flash" of empty icon space before it loads
23+
// since it's visible only on hover, it's quite noticeable
2224
loadIcons([copyIcons.copy, copyIcons.copied]);
2325
</script>
2426

0 commit comments

Comments
 (0)