Player::clearTasks
JavaScript
Explanation
The clearTasks function cancels any tasks or actions the player is currently performing. This is useful when you want to stop a player from continuing any ongoing actions, like running or shooting, and reset their state.
Required Params
- None
Return value
- 'void' — This function does not return any value.
Syntax
mp.players.local.clearTasks();
Example
This example demonstrates how to stop the player from performing any ongoing tasks.
// Stop any current tasks of the player
mp.players.local.clearTasks();