Client
Using canary? Yes
Windows version: 10.0.19042 Build 19042
System specifications:
Processor: i7-6700k
Video card: GTX 1070
Memory: 16GB
Server
Operating system: Same as client
Artifact version: FXServer-master SERVER v1.0.0.5562
IP address: local host
Resources:
System specifications:
Incident
Summary: When spawning a vehicle and a ped server side, in case there are more than 1 player in the server, the ped has strange behaviour
Expected behavior: The ped should spawn inside the vehicle, and start driving around
Actual behavior:
-
When both entities (ped and vehicle) are owned by the same player, for the entities owner the vehicle will start driving normally, but for the player who doesn’t own the entities, it will stay stuck
video of this:
-
When the vehicle is owned by player A and the ped driving it is owned by player B, the ped won’t move at all. When both players are close to the vehicle, the driver will start driving (it probably means that the network owner of both entities, now is 1 player only)
video of this:
Steps to reproduce:
- Creating the entities (server side)
local vehicle = CreateVehicle(
cargoRobberyData.data.vehicleModel,
startingCoords.x +.0, startingCoords.y+.0, startingCoords.z+.0,
startingHeading+.0, true, true
)
if(not Utils.isServerEntityReady(vehicle)) then return end -- This will just wait until the entity exists
SetEntityDistanceCullingRadius(vehicle, 30000.0) -- So this entity will be visible by all clients at any distance
Citizen.Wait(2000)
local ped = CreatePedInsideVehicle(vehicle, 0, cargoRobberyData.data.driverModel, -1, true, true)
if(not Utils.isServerEntityReady(ped)) then return end -- This will just wait until the entity exists
SetEntityDistanceCullingRadius(ped, 30000.0) -- So this entity will be visible by all clients at any distance
Citizen.Wait(2000)
- Making the network owner to force the ped to drive
(server side anywhere)
while isDrivingRandomly do
TriggerClientEvent(Utils.eventsPrefix .. ":cargo:driveRandomly", NetworkGetEntityOwner(ped), pedNetId, vehicleNetId, cargoRobberyData.data.maxSpeed)
Citizen.Wait(20000)
end
(client side)
RegisterNetEvent(Utils.eventsPrefix .. ":cargo:driveRandomly", function(pedNetId, vehicleNetId, maxSpeed)
if(not NetworkDoesNetworkIdExist(pedNetId)) then return end
if(not NetworkDoesNetworkIdExist(vehicleNetId)) then return end
local ped = NetworkGetEntityFromNetworkId(pedNetId)
local vehicle = NetworkGetEntityFromNetworkId(vehicleNetId)
TaskVehicleDriveWander(ped, vehicle, maxSpeed + .0, 187)
SetPedKeepTask(ped, true)
end)
Server/Client? Entities are created server side, the driving task is client side (done on the network owner of the ped)
Files for repro (if any):
Error screenshot (if any):
.dmp files/report IDs:
Any additional info:
When both vehicle and ped are owned by person A, and the person B doesn’t see the vehicle (when it’s distant from the vehicle spawn point) until the person A teleports in the current vehicle position as well