Ped::setSynchronizedSceneLooped: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{ClientsideJsFunction}}
{{JSContainer|


==Syntax==
The `setSynchronizedSceneLooped` function is used to set a synchronized scene to loop or stop looping based on the toggle parameter. This can be particularly useful for animations or sequences that need to be repeated continuously, such as background activities or idle loops.
<syntaxhighlight lang="javascript">ped.setSynchronizedSceneLooped(sceneID, toggle);</syntaxhighlight>
 
=== Required Arguments ===
=== Required Params ===
*'''sceneID:''' int
* '''sceneID:''' {{RageType|int}} – The ID of the synchronized scene.
*'''toggle:''' Boolean
* '''toggle:''' {{RageType|boolean}} – `true` to loop the scene, `false` to play once.
===Return value===
 
*'''Undefined'''
=== Return Value ===
==Example==
* '''Undefined''' – This function does not return a value.
 
== Syntax ==
<syntaxhighlight lang="javascript">
mp.game.ped.setSynchronizedSceneLooped(sceneID, toggle);
</syntaxhighlight>
 
== Example ==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
todo
// Example usage of setSynchronizedSceneLooped
 
const sceneID = mp.game.ped.createSynchronizedScene(x, y, z, rotX, rotY, rotZ, 2); // Sample scene creation
mp.game.ped.setSynchronizedSceneLooped(sceneID, true); // Loop the scene
</syntaxhighlight>
</syntaxhighlight>
==See also==
 
{{Ped_function_c}}
== See Also ==
{{Ped_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:Ped API]]
}}

Latest revision as of 10:59, 2 November 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


The `setSynchronizedSceneLooped` function is used to set a synchronized scene to loop or stop looping based on the toggle parameter. This can be particularly useful for animations or sequences that need to be repeated continuously, such as background activities or idle loops.

Required Params

  • sceneID: int – The ID of the synchronized scene.
  • toggle: boolean – `true` to loop the scene, `false` to play once.

Return Value

  • Undefined – This function does not return a value.

Syntax

mp.game.ped.setSynchronizedSceneLooped(sceneID, toggle);

Example

// Example usage of setSynchronizedSceneLooped

const sceneID = mp.game.ped.createSynchronizedScene(x, y, z, rotX, rotY, rotZ, 2); // Sample scene creation
mp.game.ped.setSynchronizedSceneLooped(sceneID, true); // Loop the scene

See Also