Operating system: Windows 10 Artifact version: 1150 IP address: 103.193.80.98:30130 Resources: 124
Incident
Summary: For this example we had a issue with a car seemingly teleporting around without a driver. When I went to delete it, the native NetworkRequestControlOfEntity(entity) does not work. This prevents me from deleting the entity. The command I used outputs information such as the net ID and owner. The owner was another player on the server.
Expected behavior: NetworkRequestControlOfEntity(entity) to give me control, and then the entity be deleted
Actual behavior: The vehicle remained in the control of ID 58, preventing me from setting it as a mission entity and deleting it
Steps to reproduce: Currently I have not found a reputable reproduction technique
Server/Client? Both?
Files for repro (if any): Not files for a repro, but I do have client onesync logs, timestamps and a recording. Unfortunately during the recording the vehicle did not display the desynced movement. I also have a server onesync log (on request)
Script I am using to delete vehicles. I am aware it has lots of stuff (a lot probably not required) but it is what works for 99% of the time and covers all the possible issues that seem to get thrown at it
if IsEntityAMissionEntity(entity) then
Citizen.Trace("BEFORE: Entity IS a mission entity")
else
Citizen.Trace("BEFORE: Entity IS NOT a mission entity")
end
NetworkRequestControlOfEntity(entity)
local timeout = 2000
while timeout > 0 and not NetworkHasControlOfEntity(entity) do
Wait(100)
timeout = timeout - 100
end
SetEntityAsMissionEntity(entity, true, true)
local timeout = 2000
while timeout > 0 and not IsEntityAMissionEntity(entity) do
Wait(100)
timeout = timeout - 100
end
if IsEntityAMissionEntity(entity) then
Citizen.Trace("Entity IS a mission entity")
else
Citizen.Trace("Entity IS NOT a mission entity")
end
Citizen.Trace("Owner of entity: "..GetPlayerServerId(NetworkGetEntityOwner(entity)))
Citizen.Trace("NETID of entity: "..NetworkGetNetworkIdFromEntity(entity))
if NetworkHasControlOfEntity(entity) then
Citizen.Trace("Entity IS in my control")
else
Citizen.Trace("Entity IS NOT in my control")
end
Citizen.InvokeNative( 0xEA386986E786A54F, Citizen.PointerValueIntInitialized( entity ) )
if ( DoesEntityExist( entity ) ) then
Citizen.Trace("Entity FAILED to delete! If you see this please contact a developer!")
DeleteEntity(entity)
if ( DoesEntityExist( entity ) ) then
Citizen.Trace("Entity FAILED to delete on attempt 2! If you see this please contact a developer!")
return false
else
return true
end
else
return true
end