Перейти к содержанию

Entity::setInvincible

Материал из RAGE MP Wiki Archive
Версия от 17:56, 1 мая 2024; imported>Shr0x (See also)
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

Sets a ped or an object totally invincible. It doesn't take any kind of damage. Peds will not ragdoll on explosions and the tazer animation won't apply either.

If you use this for a ped and you want Ragdoll to stay enabled, then do:
*(DWORD *)(pedAddress + 0x188) |= (1 << 9);

Use this if you want to get the invincibility status:
bool IsPedInvincible(Ped ped)
{
auto addr = getScriptHandleBaseAddress(ped);

if (addr)
{
DWORD flag = *(DWORD *)(addr + 0x188);
return ((flag & (1 << 8)) != 0) || ((flag & (1 << 9)) != 0);
}

return false;
}

Syntax

<syntaxhighlight lang="javascript">entity.setInvincible(toggle);</syntaxhighlight>

Required Arguments

  • toggle: Boolean

Return value

  • Undefined

Example

<syntaxhighlight lang="javascript"> // todo </syntaxhighlight>

See also