Player Blips disappear after specific distance

Hey,

I was using the player blip function from esx_policejob in my script. It worked very well as I used the code some months ago. Since few weeks the blips disappear for every player that is out of range.
I don’t know why but the other players are not active in the network of the player and can’t get initialized.

This is my code:

if ESX.PlayerData.job and ESX.PlayerData.job.name == ‘polizei’ or ESX.PlayerData.job.name == ‘sheriff’ then

    ESX.TriggerServerCallback('esx_society:getOnlinePlayers', function(players)

        for i=1, #players, 1 do

            if players[i].job.name == 'polizei' or players[i].job.name == 'sheriff' then

                local id = GetPlayerFromServerId(players[i].source)

                if NetworkIsPlayerActive(id) and GetPlayerPed(id) ~= PlayerPedId() then

                    ESX.TriggerServerCallback('esx_polizei:GetNameByIdentifier', function(Name)

                        createBlip(id, players[i].job.name, Name)

                    end, players[i].identifier)

                end

            end

        end

    end)

end

I hope somebody can help!

Edit: The range when the blips disappear is when the other players are out of range for rendering

Check if your one sync has been enabled

I’ve just looked it up…
Onesync infinity is enabled.
Any other ideas?

(PS: thanks for your answer!)

With onesync, far-away players are not loaded on the client, which means you have to design your blips by sending player’s coords from the server to the client.

If onesync is enabled, every player has it’s “focus zone”. Every data in this zone is being sent to the player. When you use “AddBlipForEntity” and the entity is in player’s “focus zone” then the entity will receive a blip. When the entity leaves the “focus zone” the entity handle becomes non-existent. If you can’t code it yourself, u might aswell look into this release:

1 Like