fivem
fivem copied to clipboard
Issue setting properties on server side vehicles
What happened?
I you try to set properties on a vehicles created with CreateVehicleServerSetter, it can be reset by server
Expected result
If you are the netowner, then it should set properties
Reproduction steps
- Create a vehicle with
CreateVehicleServerSetter - Set the plate text number server side after entity created, for example
XXXXXXXX - Set the plate client side
- Have a loop server side to detect when plate has changed from
XXXXXXXXto another - Server detect the plate change
- Now, create a loop to detect any other plate change
- Sometime, it reset to
XXXXXXXXand sometimes to a complete random plate number
This seems to be the case of all properties (color, engine, etc)
Importancy
Slight inconvenience
Area(s)
FiveM, OneSync, Natives
Specific version(s)
Last
Additional information
This is annoying and we can't use server side vehicles rn. I have another issue with server side vehicles : #2623 The other issue can be detected so we can respawn the vehicle just after despawn, but this issue can't be handled because properties reset at random time
I don't have any issue like that and i create every entity from server-side, make sure that the reproduction steps work in a clean environment with no other scripts that can affect vehicles properties.
Please provide more information such as server build, game build, a precise repro script to drag&drop for the Cfx.re team and such.
@CeebDev were your issues fixed
This sounds related to https://github.com/Qbox-project/qbx_core/issues/615
I noticed it started when I stopped teleporting the player into the driver seat before loading properties. This guarantees ownership, so the problem may have something to do with that.
Some things I've confirmed:
- The entity owner is the same before and after setting properties
- The server always thinks the plate is successfully set (meaning it gets the props update from the entity owner), but then sometimes a different process changes the plate. Other times the plate is set correctly, but other vehicle properties are not. I'm still trying to find out what the second process is that changes the plate.
Since this occurs infrequently I haven't been able to personally repro it. I'll see if I can test further later today.