ped.addAnimation: Difference between revisions
No edit summary |
No edit summary |
||
| Line 5: | Line 5: | ||
|class = Ped | |class = Ped | ||
|name = addAnimation | |name = addAnimation | ||
|parameters = | |parameters = int groupId, int animId | ||
|parameter1 = | |parameter1 = int groupId the ID of the animation group | ||
|parameter2 = | |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 | ||
Latest revision as of 16:54, 4 March 2026
Method Client Only
![]()
Online and Offline
void ped.addAnimation(int groupId, int animId)
Parameters
| 1) | int | groupId | The ID of the animation group. |
| 2) | int | animId | The ID of the animation itself. |
Return
| void | This method doesn't return a value. |
Types
Shared PedShared Player
Notes
- More than one animation can be applied, which is why the function is called "add animation" instead of "play animation". 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 on GTA VC and SA, ped.clearObjective on GTA III.
- Animation lists for GTA III, GTA Vice City, GTA SA, and GTA IV.
- For GTA IV, use an animation native such as natives.taskPlayAnimNonInterruptable or natives.taskPlayAnimWithFlags.
Examples
Example 1 - JavaScript - Client-Side:
addCommandHandler("talk", function(command, params) {
localPlayer.addAnimation(0, 11); // GTA Vice City, make your player ped use a talking animation
});
Compatibility
There isn't any compatibility information for this method.
Related
Client Related
getPedCount
getPeds
gta.clearThreatForPedType
gta.createPed
gta.forceRandomPedType
gta.pedDensity
gta.setThreatForPedType
gta.setZonePedInfo
gta.tommyFatness
ped.addAnimation
ped.affectedByGravity
ped.alpha
ped.armour
ped.bleeding
ped.blendAnimation
ped.boundingCentre
ped.boundingMax
ped.boundingMin
ped.boundingRadius
ped.buyIceCream
ped.canBeKnockedOffBike
ped.canExitVehicle
ped.centerOfMass
ped.changeBodyPart
ped.children
ped.clearAnimations
ped.clearExistsFor
ped.clearObjective
ped.clearPointGunAt
ped.clearThreatSearch
ped.clearWeapons
ped.collisionBoxCount
ped.collisionBoxes
ped.collisionLineCount
ped.collisionLines
ped.collisionPower
ped.collisionsEnabled
ped.collisionSphereCount
ped.collisionSpheres
ped.collisionVertexCount
ped.collisionVertices
ped.contactEntity
ped.contactEntityOffset
ped.crouching
ped.crouchingTime
ped.dimension
ped.distanceFromCentreOfMassToBaseOfModel
ped.dropObject
ped.duck
ped.enterVehicle
ped.existsFor
ped.exitVehicle
ped.getComponentOffset
ped.getComponentPosition
ped.getData
ped.getNearestDoorPosition
ped.getNearestPassengerDoorPosition
ped.getPositionToOpenVehicleDoor
ped.getRotation
ped.getWeaponAmmunition
ped.getWeaponClipAmmunition
ped.getWeaponSlotAmmunition
ped.getWeaponSlotClipAmmunition
ped.giveHelmet
ped.giveWeapon
ped.hailTaxi
ped.heading
ped.health
ped.health
ped.heedThreats
ped.holdObject
ped.id
ped.instantVehicleExit
ped.instantVehicleJack
ped.interior
ped.invincible
ped.inWater
ped.isCreatedFor
ped.isEnteringVehicle
ped.isExitingVehicle
ped.isInVehicle
ped.island
ped.isLocal
ped.isOnScreen
ped.isOwner
ped.isSyncer
ped.isType
ped.jumping
ped.lookAt
ped.markAsNoLongerNeeded
ped.mass
ped.matrix
ped.maxArmour
ped.maxHealth
ped.maxStamina
ped.model
ped.modelIndex
ped.money
ped.name
ped.netFlags
ped.objective
ped.onScreen
ped.parent
ped.pedType
ped.pointGunAt
ped.pointGunAtPosition
ped.position
ped.removeAllData
ped.removeBodyPart
ped.removeData
ped.removeFromVehicle
ped.removeHelmet
ped.removeNametag
ped.resource
ped.resurrect
ped.roomToBeVehicleJacked
ped.rotation
ped.runTo
ped.say
ped.seat
ped.setData
ped.setExistsFor
ped.setNametag
ped.setPedStats
ped.setProofs
ped.setRotation
ped.setSeek
ped.setSyncer
ped.setThreatSearch
ped.setWaitState
ped.setWanderPath
ped.setWeaponAmmunition
ped.setWeaponClipAmmunition
ped.setWeaponSlotAmmunition
ped.setWeaponSlotClipAmmunition
ped.skin
ped.sprintTo
ped.stamina
ped.staminaDuration
ped.state
ped.status
ped.stayInSamePlace
ped.streamInDistance
ped.streamOutDistance
ped.syncer
ped.syncerId
ped.turnVelocity
ped.type
ped.upperTorsoRotation
ped.vehicle
ped.velocity
ped.visible
ped.waitState
ped.walkStyle
ped.walkTo
ped.warpIntoVehicle
ped.weapon
ped.weapons
ped.weaponSlot
ped.weaponSlots
ped.weaponState