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();
}