ped.addAnimation: Difference between revisions

no edit summary
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{ScriptItem2
{{ScriptItem
|side = client
|endpoint = client
|games = iii vc sa
|games = iii vc sa
|type = method
|type = method
|class = Ped
|class = Ped
|name = addAnimation
|name = addAnimation
|parameters = Int groupId, Int animId
|parameters = int groupId, int animId
|parameter1 = int groupId the ID of the animation group
|parameter2 = int animId the ID of the animation itself
|usage = makes the ped play an animation
|usage = makes the ped play an animation
|return1 = void
|return1 = void
Line 12: Line 14:
This usually leads to undesired results as most animation were not designed to be played together. If you want to reset the current animation(s) to play another, use [[ped.clearAnimations|ped.clearAnimations]] on GTA VC and SA, [[ped.clearObjective|ped.clearObjective]] on GTA III.<br>
This usually leads to undesired results as most animation were not designed to be played together. If you want to reset the current animation(s) to play another, use [[ped.clearAnimations|ped.clearAnimations]] on GTA VC and SA, [[ped.clearObjective|ped.clearObjective]] on GTA III.<br>
Animation lists for [[Resources/GTA3/Animations|GTA III]], [[Resources/GTAVC/Animations|GTA Vice City]], [[Resources/GTASA/Animations|GTA SA]], and [[Resources/GTAIV/Animations|GTA IV]]<br>
Animation lists for [[Resources/GTA3/Animations|GTA III]], [[Resources/GTAVC/Animations|GTA Vice City]], [[Resources/GTASA/Animations|GTA SA]], and [[Resources/GTAIV/Animations|GTA IV]]<br>
For GTA IV, use an animation native such as [[natives.taskPlayAnimNonInterruptable|natives.taskPlayAnimNonInterruptable]] or [[https://wiki.gtaconnected.com/natives.taskPlayAnimWithFlags|https://wiki.gtaconnected.com/natives.taskPlayAnimWithFlags]]
For GTA IV, use an animation native such as [[natives.taskPlayAnimNonInterruptable|natives.taskPlayAnimNonInterruptable]] or [[natives.taskPlayAnimWithFlags|natives.taskPlayAnimWithFlags]]
|exampleJSCS = addCommandHandler("talk", function(command, params) {
    localPlayer.addAnimation(0, 11); // GTA Vice City, make your player ped use a talking animation
});
}}
}}
2,860

edits