Shopping Cart
FiveM script 11abac85b780a6bfb422bb414511bacab31e72a7

[How-to] Adapt your script to OneSync and fix your issues – Modding Tutorials

FiveM Modding Tutorial

Hello, I’m making this guide to summarize all the questions and issues that server owners faced/face with OneSync. This is an unofficial guide is made to help you and avoid dumb and useless questions that spammed the discord OneSync channel these past months. If your issue is not listed here, feel free to ask we might be able to help you and then update this guide.

  • My scoreboard/player list is broken, my script does not find the player in front of me or PvP is disabled.
    You forgot to update your player loops. Since OneSync supports 128 players you need to update some parts of your code. Here are few examples:
    Using ESX you will need to change this:
    https://github.com/ESX-Org/es_extended/blob/master/config.lua#L13
    I strongly recommend you to put 256 instead of 31-32 (usually these numbers)
    Example of a lua function using a player loop
function GetPlayers()
    local players = {}
    for i = 0, 31 do
        if NetworkIsPlayerActive(i) then
            players[#players + 1] = i
        end
    end
    return players
end

In this example, you will need to change 31 to 256.
Edit: elements added a new native to avoid useless call in this kind of loops, check this: GET_ACTIVE_PLAYERS: the replacement for player loops

  • The voice chat is not working, I hear everyone
    This is not an issue from onesync. However, you might need to set the initial voice range a little bit later than before. Here is a little snippet of a working fix:
-- 8.0 will be the default range, change it if you want
Citizen.CreateThread(function()
	NetworkSetTalkerProximity(8.0)
end)
  • Instance/Properties invisibility does not work
    This is because SetEntityLocallyInvisible and SetEntityLocallyVisible do not work as intended.
    A workable workaround is the use of SetEntityVisible instead of SetEntityLocallyInvisible in your script. A known script that uses this native: https://github.com/ESX-Org/instance/blob/master/client/main.lua#L226
    If this workaround does not work, then you forgot to update your loops.
  • I have an error in my console, related to ■■■■■■■
    “Failed to execute thread: Execution of native 000000002f7a49e6 in script host failed.”
    ■■■■■■■ uses a cfx native that is deprecated with OneSync. You have two solutions: disable ■■■■■■■ or use this untested fix https://github.com/citizenfx/cfx-server-data/pull/46/commits/18b8da8bb3ea3a97f719dbf4c44ce177329dc313
  • GCPhone is not working, I do not hear other peoples while in call
    Firstly, I recommend you to use the “WebRTC” feature of GCPhone the script should be working. properly. Otherwise, you might need to add a delay to prevent NetworkSetVoiceChannel being set at the same time (until the fix)
  • Lips are not moving
    Use this ugly little workaround : The OneSync EAP and you
  • Tatooes / Overlays are flickering
    PlayerAppearanceDataNode may not sync sometimes, this is being investigated.
  • Misc issues
    Certain vehicle gadgets (hooks/magnets) may not work as expected.
    Some natives might be broken like SetEntityVisible or NetworkCreateSynchronisedScene
  • Client crashes
    You might crash sometimes but it remains pretty rare. The most part of the remaining annoying crashes need reproduction steps to be fixed.
  • I’ve seen some servers using 40-50 slots instead of 128 slots is it more stable?
    It is not true.
  • My server is crashing what should I do?
    In you are running Linux, then RIP.
    If you are running a Windows Server upload your crash dump (crashes folder) in the OneSync bugs hunting category.
  • How do I get the onesync access key?
    Make sure your FiveM forum email and Patreon email are the same. It can take up to 6 hours for synchronization upon which https://keymaster.fivem.net/ will say you are bestowed with bonuses. Any new and existing license keys will have these bonuses. If you are using ZAP hosting, you need to create a license key and enter this as “Custom license key” in the ZAP hosting control panel.
  • How to enable OneSync ?
    To enable onesync you firstly need to have access to it, read above. Then, to enable onesync add this convar in your *.cfg file. onesync_enabled 1 and obviously sv_maxClients 64 to increase slots.
  • I’m getting “OneSync is not whitelisted for this server”
    Read How do I get the onesync access key above.
    If you did everything correctly just wait, fivem services might have performance issues but this remains pretty rare. Do not worry about it.
  • I’m not interested by mumble, how can I disable it
    If you wanna get rid of it and disable it. Go to your fx-server folder, open components.json and remove voip-server-mumble. It will prevent FXServer from running this specific dll.

This part of the forum is dedicated to heavy/meaningful/useful/relevant OneSync’s reports: https://forum.cfx.re/c/general-discussion/1s-reports



Original source: https://forum.cfx.re/t/how-to-adapt-your-script-to-onesync-and-fix-your-issues/580551

Leave a Reply
FiveM ESX Scripts

The best scripts and maps

Best support

Problems? We are there to help!

Wide range of products

We have a wide range of products

100% Secure Checkout

Stripe