Player::resetRagdollTimer

From RAGE Multiplayer Wiki

Client-Side
Function

 JavaScript



JavaScript Syntax


The `resetRagdollTimer` function resets the ragdoll timer for the player, effectively extending the duration they remain in a ragdoll state. When `setToRagdoll` is called, the player enters a ragdoll (physics-based) state for a specified time. By calling `resetRagdollTimer` before the timer expires, you can reset the timer, allowing the player to continue in the ragdoll state for the original duration again.

This function is useful in scenarios where you want to dynamically control or extend the ragdoll effect based on gameplay events, without needing to call `setToRagdoll` repeatedly with new durations.

Required Params

  • None

Return Value

  • Undefined – This function does not return a value.

Syntax

player.resetRagdollTimer();

Example

// Example usage of resetRagdollTimer

// Make the player enter ragdoll state for 5 seconds
player.setToRagdoll(5000, 5000, 0, true, true, true); 

// Wait less than 5 seconds before resetting the timer
setTimeout(() => {
    player.resetRagdollTimer(); // Resets the timer, adding another 5 seconds to the ragdoll state
    mp.gui.chat.push("Ragdoll timer reset!"); // Confirm action in chat
}, 3000); // Reset timer after 3 seconds, extending ragdoll state


See Also