Skip to content

Commit

Permalink
fix(menu): missing player names in playerlist
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Nov 25, 2022
1 parent c7f98d7 commit 7685d06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions resource/cl_playerlist.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function sendReactPlayerlist()
for pids, playerData in pairs(LOCAL_PLAYERLIST) do
upload[#upload + 1] = {
id = tonumber(pids),
name = playerData.name,
name = playerData.name or "unknown",
health = playerData.health,
dist = playerData.dist,
vType = playerData.vType,
Expand All @@ -56,7 +56,7 @@ RegisterNetEvent('txcl:setInitialPlayerlist', function(payload)
for _, playerData in pairs(payload) do
local pids = tostring(playerData[1])
LOCAL_PLAYERLIST[pids] = {
name = playerData[2] or "unknown",
name = playerData[2],
health = 0,
dist = -1,
vType = "unknown",
Expand Down Expand Up @@ -139,7 +139,7 @@ RegisterNetEvent('txcl:updatePlayer', function(id, data)
else
debugPrint("^2txcl:updatePlayer: ^3"..id.."^2 connected")
LOCAL_PLAYERLIST[pids] = {
name = data or "unknown",
name = data,
health = 0,
dist = -1,
vType = "unknown",
Expand Down
2 changes: 1 addition & 1 deletion resource/sv_playerlist.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ AddEventHandler('playerJoining', function(srcString, _oldID)

-- relaying this info to all admins
for adminID, _ in pairs(TX_ADMINS) do
TriggerClientEvent('txcl:updatePlayer', adminID, source, playerData.playerName)
TriggerClientEvent('txcl:updatePlayer', adminID, source, playerData.name)
end
end)

Expand Down

0 comments on commit 7685d06

Please sign in to comment.