Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetVehicleAutoRepairDisabled causing sync extra issue #3087

Open
Kalyptus opened this issue Jan 21, 2025 · 3 comments
Open

SetVehicleAutoRepairDisabled causing sync extra issue #3087

Kalyptus opened this issue Jan 21, 2025 · 3 comments
Labels
bug triage Needs a preliminary assessment to determine the urgency and required action

Comments

@Kalyptus
Copy link

What happened?

It’s a bug I’ve just discovered with artifact 12461. I’m not sure if it’s the same for the earlier ones. All you have to do is create a networked ‘bobcatxl,’ and different clients do not see the same thing. I’m not sure if it also happens with other vehicles. Here’s a video.
https://streamable.com/jbfq3h

Expected result

Seeing the same thing on all clients.

Reproduction steps

Create the bobcatxl vehicle and verify it on two clients.

Importancy

Slight inconvenience

Area(s)

FiveM

Specific version(s)

Server 12461

Additional information

No response

@Kalyptus Kalyptus added bug triage Needs a preliminary assessment to determine the urgency and required action labels Jan 21, 2025
@Gogsi
Copy link

Gogsi commented Jan 21, 2025

The two variants of the Bobcat XL are handled by Extras, the same mechanic that handles the signs on top of taxi cabs, etc. I guess it's not being synchronized correctly for some reason, resulting in every client picking a random extra (with or without the bed cap).

@Gogsi
Copy link

Gogsi commented Jan 22, 2025

I actually can't reproduce this. My setup is two clients on the same PC connect to a standard txAdmin server (artifact 12508, game build 3095), with only vMenu added. If I spawn a bobcatxl via vMenu on any of the clients, the other client sees the exact vehicle with all of the mods and extras.

https://files.catbox.moe/13bjh6.mp4

I checked briefly in the Network Object Viewer tool in the F8 console and the CVehicleAppearanceDataNode, which carries the extras field seems to also be set the same on both clients, i.e 3584 when the bobcat has a roof and 1537 when it doesn't.

Image

How does the /car command you use in your video work? Can you send the code for it?

@Kalyptus
Copy link
Author

Hello, after conducting additional tests, I believe this issue is caused by the SetVehicleAutoRepairDisabled native. Here is an example snippet of code to reproduce the problem:

RegisterCommand("car", function(_, args)
    local model = args[1]
    RequestModel(model)
    while not HasModelLoaded(model) do
        Wait(0)
    end
    local ped = PlayerPedId()
    local coords = GetEntityCoords(ped)
    local vehicle = CreateVehicle(model, coords.x, coords.y, coords.z, GetEntityHeading(ped), true, false)

    SetVehicleAutoRepairDisabled(vehicle, true)

    for i = 1, 20 do
        SetVehicleExtra(vehicle, i, false)
    end

    TaskWarpPedIntoVehicle(ped, vehicle, -1)
end)

@Kalyptus Kalyptus changed the title Networked BobcatXL Inconsistency Across Clients SetVehicleAutoRepairDisabled causing sync extra issue Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

No branches or pull requests

2 participants