Native referenceFiveM

IS_ENTITY_ATTACHED

0xB346476EF1A64897 ENTITY
FUNCTION SIGNATURE
BOOL IS_ENTITY_ATTACHED(Entity entity);
Property Value
Native Name IS_ENTITY_ATTACHED
Hash 0xB346476EF1A64897
Return Type BOOL
Parameters entity (Entity)

Parameters

  • entity (Entity) — The entity to check if it is attached to another entity.

Examples

local ped = PlayerPedId()

if IsEntityAttached(ped) then
    DetachEntity(ped, true, true)
end
int ped = PlayerPedId();

if(IsEntityAttached(ped)) {
    DetachEntity(ped, true, true);
}
using static CitizenFX.Core.Native.API;
// ...

int ped = PlayerPedId();

if(IsEntityAttached(ped))
{
    DetachEntity(ped, true, true);
}

// or the preferred use of C# wrapper
if(Game.PlayerPed.IsAttached()) {
    Game.PlayerPed.Detach();
}
Back to ENTITY