Unexpexted behaviour of vehicle creation

Client

Using canary? Yes
Windows version: 1909
System specifications:
изображение

Server

Operating system: Windows
Artifact version: 3737
IP address: localhost
Resources: default
System specifications: same as client

Incident

Summary: I am trying to create vehicle far away from player (~6000.0 units), than I am adding blip on created vehicle.

Expected behavior: One specific behaviour - preferably vehicle creation.

Actual behavior:
Sometime vehicle is not created, also sometime it will be created but deleted right away and in the rest of cases it will be created.

  • Vehicle created (red blip stays on map)
  • Created and deleted (red blip appears and dissappears)
  • Not created (nothing appears on the map)

Steps to reproduce: Execute following code on server side, open Map, use /tt command and wait for red blip. Repeat until reproducing all cases.

Server/Client? Server
Files for repro (if any):

RegisterCommand("tt", function(source, raw, args)
    local vehicles = GetAllVehicles()
    for k,v in pairs(vehicles) do
        DeleteEntity(v)
    end

    local ped = GetPlayerPed(source)
    SetEntityCoords(ped, vector3(1100.14, 6488.708, 21.06024))
    local entity = CreateVehicle(GetHashKey("blista"), 0.0, 0.0, 100.0, 0.0, true, true)
    while not DoesEntityExist(entity) do
        print("Waiting for entity creation")
        Citizen.Wait(0)
    end
    SetEntityDistanceCullingRadius(entity, 10000.0)
    AddBlipForEntity(entity)
end, false)

Error screenshot (if any):
.dmp files/report IDs:

Any additional info:
set onesync on

1 Like

Old RPC vehicle creation natives are meant to only create entities when actually in range, also the culling distance call probably won’t do much there.

Until the server can have a model list, use the experimental tree-based creation native instead.

1 Like

Can you post an example?

1 Like

Maybe he mean createautomobile
Search it on this forum

1 Like