Entity::setInvincible: Difference between revisions
(yay) |
|||
| Line 11: | Line 11: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See also== | ==See also== | ||
{{ | {{Entity_definition_c}} | ||
[[Category:Clientside API]] | [[Category:Clientside API]] | ||
[[Category:TODO: Example]] | [[Category:TODO: Example]] | ||
Latest revision as of 17:56, 1 May 2024
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
entity.setInvincible(toggle);
Required Arguments
- toggle: Boolean
Return value
- Undefined
Example
// todo
See also
- Properties
- Functions
- Entity::applyForceTo
- Entity::applyForceToCenterOfMass
- Entity::attachTo
- Entity::attachToPhysically
- Entity::clearLastDamage
- Entity::destroy
- Entity::detach
- Entity::dist
- Entity::distSquared
- Entity::doesBelongToThisScript
- Entity::doesExist
- Entity::doesHaveDrawable
- Entity::doesHavePhysics
- Entity::forceAiAndAnimationUpdate
- Entity::forceStreamingUpdate
- Entity::freezePosition
- Entity::getAlpha
- Entity::getAnimCurrentTime
- Entity::getAnimTotalTime
- Entity::getAttachedTo
- Entity::getBoneIndexByName
- Entity::getCollisionNormalOfLastHitFor
- Entity::getCoords
- Entity::getForwardVector
- Entity::getForwardX
- Entity::getForwardY
- Entity::getHeading
- Entity::getHealth
- Entity::getHeight
- Entity::getHeightAboveGround
- Entity::getLastMaterialHitBy
- Entity::getLodDist
- Entity::getMatrix
- Entity::getMaxHealth
- Entity::getModel
- Entity::getNearestPlayerTo
- Entity::getNearestPlayerToOnTeam
- Entity::getObjectIndexFromIndex
- Entity::getOffsetFromGivenWorldCoords
- Entity::getOffsetFromInWorldCoords
- Entity::getPedIndexFromIndex
- Entity::getPhysicsHeading
- Entity::getPitch
- Entity::getPopulationType
- Entity::getQuaternion
- Entity::getRoll
- Entity::getRotation
- Entity::getRotationVelocity
- Entity::getScript
- Entity::getSpeed
- Entity::getSpeedVector
- Entity::getSubmergedLevel
- Entity::getType
- Entity::getUprightValue
- Entity::hasVariable
- Entity::getVariable
- Entity::getVehicleIndexFromIndex
- Entity::getVelocity
- Entity::getWorldPositionOfBone
- Entity::hasAnimEventFired
- Entity::hasAnimFinished
- Entity::hasBeenDamagedBy
- Entity::hasBeenDamagedByEntity
- Entity::hasBeenDamagedByAnyObject
- Entity::hasBeenDamagedByAnyPed
- Entity::hasBeenDamagedByAnyVehicle
- Entity::hasClearLosTo
- Entity::hasClearLosToInFront
- Entity::hasCollidedWithAnything
- Entity::hasCollisionLoadedAround
- Entity::isAMission
- Entity::isAnObject
- Entity::isAPed
- Entity::isAt
- Entity::isAtCoord
- Entity::isAttached
- Entity::isAttachedTo
- Entity::isAttachedToAnyObject
- Entity::isAttachedToAnyPed
- Entity::isAttachedToAnyVehicle
- Entity::isAVehicle
- Entity::isCollisonDisabled
- Entity::isDead
- Entity::isInAir
- Entity::isInAngledArea
- Entity::isInArea
- Entity::isInWater
- Entity::isInZone
- Entity::isOccluded
- Entity::isOnScreen
- Entity::isPlayingAnim
- Entity::isStatic
- Entity::isTouching
- Entity::isTouchingModel
- Entity::isUpright
- Entity::isUpsidedown
- Entity::isVisible
- Entity::isVisibleToScript
- Entity::isWaitingForWorldCollision
- Entity::playAnim
- Entity::playSynchronizedAnim
- Entity::processAttachments
- Entity::resetAlpha
- Entity::setAlpha
- Entity::setAlwaysPrerender
- Entity::setAnimCurrentTime
- Entity::setAnimSpeed
- Entity::setAsMission
- Entity::setCanBeDamaged
- Entity::setCanBeDamagedByRelationshipGroup
- Entity::setCanBeTargetedWithoutLos
- Entity::setCollision
- Entity::setCoords
- Entity::setCoords2
- Entity::setCoordsNoOffset
- Entity::setDynamic
- Entity::setHasGravity
- Entity::setHeading
- Entity::setHealth
- Entity::setInvincible
- Entity::setIsTargetPriority
- Entity::setLights
- Entity::setLoadCollisionFlag
- Entity::setLodDist
- Entity::setMaxHealth
- Entity::setMaxSpeed
- Entity::setMotionBlur
- Entity::setNoCollision
- Entity::setOnlyDamagedByPlayer
- Entity::setOnlyDamagedByRelationshipGroup
- Entity::setProofs
- Entity::setQuaternion
- Entity::setRecordsCollisions
- Entity::setRenderScorched
- Entity::setRotation
- Entity::setTrafficlightOverride
- Entity::setVelocity
- Entity::setVisible
- Entity::stopAnim
- Entity::stopSynchronizedAnim