GameEntity::getEntityAnimDuration: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with " {{ClientsideJsFunction}} {{JSContainer| ===Required Params=== *'''animDict:''' {{RageType|string}} *'''animName:''' {{RageType|string}} ===Return value=== *''' {{RageType|number}} ''' ==Syntax== <syntaxhighlight lang="javascript"> mp.game.entity.getEntityAnimDuration(animDict, animName) </syntaxhighlight> ==Example== <syntaxhighlight lang="javascript"> //todo </syntaxhighlight> }} ==See also== {{Entity_functions_c}} Category:Clientside API Category:TODO: Examp...")
 
No edit summary
 
Line 1: Line 1:
{{ClientsideJsFunction}}
{{ClientsideJsFunction}}
{{JSContainer|
{{JSContainer|


===Required Params===
===Required Params===
*'''animDict:''' {{RageType|string}}
*'''animDict:''' {{RageType|string}} - The name of the animation dictionary.
*'''animName:''' {{RageType|string}}
*'''animName:''' {{RageType|string}} - The name of the animation.


===Return value===
===Return value===
*''' {{RageType|number}} '''
*''' {{RageType|number}} ''' - The duration of the specified animation in seconds.


==Syntax==
==Syntax==
Line 17: Line 16:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
//todo
// Example animation dictionary and name
let animDict = mp.game.joaat("anim@mp_ferris_wheel");
let animName = mp.game.joaat("idle_a");
 
// Get the duration of the specified animation
let duration = mp.game.entity.getEntityAnimDuration(animDict, animName);
mp.gui.chat.push("Animation Duration: " + duration + " seconds");
</syntaxhighlight>
</syntaxhighlight>
}}
}}

Latest revision as of 11:47, 2 November 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


Required Params

  • animDict: string - The name of the animation dictionary.
  • animName: string - The name of the animation.

Return value

  • number - The duration of the specified animation in seconds.

Syntax

mp.game.entity.getEntityAnimDuration(animDict, animName)

Example

// Example animation dictionary and name
let animDict = mp.game.joaat("anim@mp_ferris_wheel");
let animName = mp.game.joaat("idle_a");

// Get the duration of the specified animation
let duration = mp.game.entity.getEntityAnimDuration(animDict, animName);
mp.gui.chat.push("Animation Duration: " + duration + " seconds");


See also