mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-12-12 06:14:09 +01:00
fix playernames serverside memory leak (#106)
* Update playernames_sv.lua * Update playernames_cl.lua * Update playernames_sv.lua * clean up
This commit is contained in:
@@ -46,9 +46,9 @@ function updatePlayerNames()
|
||||
local localCoords = GetEntityCoords(PlayerPedId())
|
||||
|
||||
-- for each valid player index
|
||||
for i = 0, 255 do
|
||||
for _, i in ipairs(GetActivePlayers()) do
|
||||
-- if the player exists
|
||||
if NetworkIsPlayerActive(i) and i ~= PlayerId() then
|
||||
if i ~= PlayerId() then
|
||||
-- get their ped
|
||||
local ped = GetPlayerPed(i)
|
||||
local pedCoords = GetEntityCoords(ped)
|
||||
@@ -188,4 +188,4 @@ SetTimeout(0, function()
|
||||
end)
|
||||
|
||||
-- run this function every frame
|
||||
SetTimeout(0, updatePlayerNames)
|
||||
SetTimeout(0, updatePlayerNames)
|
||||
|
||||
Reference in New Issue
Block a user