fivem icon indicating copy to clipboard operation
fivem copied to clipboard

GetEntityHealth server side return 0

Open spacevx opened this issue 5 months ago • 0 comments

What happened?

GetEntityHealth for vehicle return 0 when creating the vehicle using server setter, a player need to enter into the vehicle scope so GetEntityHealth return the real value

Expected result

Default value of a vehicle (1000)

Reproduction steps

RegisterCommand("raiju", function(source)
    local coords = GetEntityCoords(GetPlayerPed(1))
    local vehicle = CreateVehicleServerSetter(`raiju`, "plane", coords.x, coords.y, coords.z)
    repeat
        Wait(0)
    until DoesEntityExist(vehicle)
    print("Raiju Health", GetEntityHealth(vehicle)) -- going to return 0
end, false)

Importancy

There's a workaround

Area(s)

FiveM, FXServer, OneSync

Specific version(s)

On every verions

Additional information

No response

spacevx avatar Sep 16 '24 18:09 spacevx