Yet another MP/locality/vehicle related issue. This time assignedVehicleRole command fails to report correct in vehicle position on the server while vehicle is owned by the server. Client side assignedVehicleRole works on the same vehicle just fine. If locality of the vehicle transferred to client, serverside assignedVehicleRole also starts working.
Description
Details
- Legacy ID
- 166371067
- Severity
- None
- Resolution
- Open
- Reproducibility
- Always
- Category
- Multiplayer
Start dedicated server
log in
on the CLIENT execute
playerServer = player;
publicVariable "playerServer";
"test" addPublicVariableEventHandler {hint str (_this select 1)};
create helicopter on ther SERVER
heli = "B_Heli_Transport_01_camo_F" createvehicle position playerServer;
Get in cargo for example then execute on the SERVER
test = assignedVehicleRole playerServer;
publicVariable "test";
hint shows []
now execute the same on the CLIENT
hint str assignedVehicleRole player;
hint shows ["Cargo"]
Now get out of the heli and change helicopter locality to client, execute on the SERVER
heli setOwner owner playerServer;
Get in Cargo seat again and execute on the SERVER
test = assignedVehicleRole playerServer;
publicVariable "test";
hint now shows ["Cargo"] and it works for any seat
Event Timeline
I've seen similar behaviour for two players - driver sees ["Driver"] for himself and [] for passenger. While passenger sees ["Driver"] for driver and ["Cargo",[whatever]] for himself.