Ped::setPedToRagdollWithFall
JavaScript
enum ragdollFallTypes {
TYPE_FROM_HIGH = 0,
TYPE_OVER_WALL,
TYPE_DOWN_STAIRS,
TYPE_DIE_TYPES,
TYPE_DIE_FROM_HIGH,
TYPE_DIE_OVER_WALL,
TYPE_DIE_DOWN_STAIRS
}
Required Arguments
- ped: Handle
- minTime: Number
- maxTime: Number
- fallType: Number (use values from
ragdollFallTypes) - dirX: Number
- dirY: Number
- dirZ: Number
- groundHeight: Number
- p8: Number
- p9: Number
- p10: Number
- p11: Number
- p12: Number
- p13: Number
Return value
- Boolean
Syntax
mp.game.ped.setPedToRagdollWithFall(ped, minTime, maxTime, fallType, dirX, dirY, dirZ, groundHeight, p8, p9, p10, p11, p12, p13);
Example
let playerPed = mp.players.local.handle;
let minFallTime = 1000; // Minimum time in milliseconds
let maxFallTime = 3000; // Maximum time in milliseconds
let fallType = ragdollFallTypes.TYPE_FROM_HIGH; // Ragdoll fall type
let directionX = 0.0; // X direction of the fall
let directionY = 0.0; // Y direction of the fall
let directionZ = -1.0; // Z direction of the fall (downwards)
let groundHeight = mp.game.gameplay.getGroundZFor3dCoord(mp.players.local.position.x, mp.players.local.position.y, mp.players.local.position.z, false);
// Set the player to ragdoll
mp.game.ped.setPedToRagdollWithFall(playerPed, minFallTime, maxFallTime, fallType, directionX, directionY, directionZ, groundHeight, 0, 0, 0, 0, 0, 0);