Player::clearTasks: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
Line 1: Line 1:
{{ClientsideJsFunction}} 
{{JSContainer| 


==Syntax==
===Explanation===
<syntaxhighlight lang="javascript">player.clearTasks();</syntaxhighlight>
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 Arguments ===
 
===Return value===
===Required Params===
*'''Undefined'''
*'''None''' 
==Example==
 
<syntaxhighlight lang="javascript">
===Return value===
// todo
*'''{{RageType|void}}''' — This function does not return any value. 
 
==Syntax== 
<syntaxhighlight lang="javascript"> 
mp.players.local.clearTasks(); 
</syntaxhighlight>
 
==Example==
This example demonstrates how to stop the player from performing any ongoing tasks. 
 
<syntaxhighlight lang="javascript">
// Stop any current tasks of the player 
mp.players.local.clearTasks(); 
</syntaxhighlight>
</syntaxhighlight>
==See also==
}}
{{Player_function_c}}
==See also==
[[Category:Clientside API]]
{{Player_function_c}}
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 17:07, 8 November 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


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();


See also