setPedPhysicalProofs
Choose exactly which kinds of physical damage an NPC ignores: bullets, fire, explosions, collisions, or melee hits.
Syntax
bool setPedPhysicalProofs(ped thePed, bool bullet, bool fire, bool explosion, bool collision, bool melee)GTA task mapping
SCM equivalent: SET_CHAR_PROOFS
This does not create a CTask. It writes GTA's five independent ped-proof flags and keeps them on the MTA ped for native recreation.
Arguments
thePedpedScript ped controlled by this client; players are rejected.
bulletboolBullet-proof flag.
fireboolFire-proof flag.
explosionboolExplosion-proof flag.
collisionboolCollision-proof flag.
meleeboolMelee-weapon-proof flag.
Returns
true when the current ped syncer stored the complete proof tuple; false for a player, invalid ped, or observer client.
Ownership and lifecycle
Low-level ped task calls require the client that simulates the living, streamed ped. Driving tasks also require control of the streamed vehicle. They do not create lifecycle handles; the optional native-task-runtime adds server-owned route epochs and reconstruction for drive_to routes. Gang-tag ownership is resource-exclusive, survives object streaming and recreation, and is released automatically when the owner stops.
- The policy survives stream-out and native ped recreation on this client.
- It has no automatic resource-stop restoration. Save the previous values with getPedPhysicalProofs and restore them during cleanup.
Example
-- Temporarily make a mission actor fireproof.local bullet, fire, explosion, collision, melee = getPedPhysicalProofs(actor)assert(setPedPhysicalProofs(actor, bullet, true, explosion, collision, melee))
-- Restore this tuple when the scene ends.setPedPhysicalProofs(actor, bullet, fire, explosion, collision, melee)Where this comes from
Continue exploring
← Back to the SA:O Lua API · How Native ped tasks and gang tags works →