engineLoadIFP
Client-side
Server-side
Shared
This function loads an animation library (IFP) file into GTA with a custom block name. All three IFP formats are supported ANPK, ANP2, and ANP3. Unfortunately, GTA 3 animations are not supported, however, you can load GTA:VC IFP files using this function. You don't have to replace any animation to play a custom one, to play a custom animation, load the IFP file using this function, then use setPedAnimation.
Tip
- If you want to synchronize animations, you can check ifp_demo resource.
- If you wish to replace a GTA internal animation with a custom one, you can use engineReplaceAnimation.
Syntax
ifp|false engineLoadIFP ( string filePath/rawData, string custom_block_name )Required Arguments
- filePath/rawData: The filepath to the IFP file you want to load or whole data buffer of the IFP file.
- custom_block_name: The new block name for the IFP file. You cannot use the GTA default internal block names. You should namespace this name using a string like
resource.blockname.
Returns
- ifp|false: ifp element
Returns an IFP element if the IFP file loaded, false otherwise.
Code Examples
client
This example loads a custom IFP file (parkour.ifp), adds a command animation that takes 1 parameter as animation name for playing animations within that IFP.
--[[credits to Paul_Cortez for the IFP file.parkour.ifp has following animations:
BckHndSpingBTuckBckHndSpingCartWheelFrntHndSpringHandPlant]] -- you can choose any name you want, do not choose a default GTA:SA block name-- Remember to namespace your block. That's why it starts with `test.`local customBlockName = "test.myNewBlock"
-- load the IFP filelocal IFP = engineLoadIFP("parkour.ifp", customBlockName)
-- let us know if IFP failed to loadif not IFP then outputChatBox("Failed to load 'parkour.ifp'")end
-- execute the command using /animation <NameOfCustomAnimation>-- for example, /animation CartWheelfunction setanimation(_, animationName) -- check if IFP file has loaded if IFP then -- now play our custom animation setPedAnimation(localPlayer, customBlockName, animationName) endendaddCommandHandler("animation", setanimation)See Also
Engine Functions
- engineAddClothingModelNew
- engineAddClothingTXDNew
- engineAddImageNew
- engineApplyShaderToWorldTexture
- engineFreeModel
- engineFreeTXDNew
- engineGetModelFlagsNew
- engineGetModelIDFromName
- engineGetModelLODDistance
- engineGetModelNameFromID
- engineGetModelPhysicalPropertiesGroup
- engineGetModelTextureNames
- engineGetModelTextures
- engineGetModelTXDIDNew
- engineGetModelVisibleTime
- engineGetObjectGroupPhysicalProperty
- engineGetPoolCapacityNew
- engineGetPoolDefaultCapacityNew
- engineGetPoolUsedCapacityNew
- engineGetSurfaceProperties
- engineGetVisibleTextureNames
- engineImageGetFileNew
- engineImageGetFilesNew
- engineImageGetFilesCountNew
- engineImageLinkDFFNew
- engineImageLinkTXDNew
- engineImportTXD
- engineLoadCOL
- engineLoadDFF
- engineLoadIFP
- engineLoadIMGNew
- engineLoadTXD
- enginePreloadWorldAreaNew
- engineRemoveImageNew
- engineRemoveShaderFromWorldTexture
- engineReplaceAnimation
- engineReplaceCOL
- engineReplaceModel
- engineRequestModel
- engineRequestTXDNew
- engineResetModelFlagsNew
- engineResetModelLODDistance
- engineResetModelTXDIDNew
- engineResetSurfaceProperties
- engineRestoreAnimation
- engineRestoreCOL
- engineRestoreDFFImageNew
- engineRestoreModel
- engineRestoreModelPhysicalPropertiesGroup
- engineRestoreObjectGroupPhysicalProperties
- engineRestoreTXDImageNew
- engineRestreamNew
- engineRestreamModelNew
- engineRestreamWorldUpdated
- engineSetAsynchronousLoading
- engineSetModelFlagNew
- engineSetModelFlagsNew
- engineSetModelLODDistanceUpdated
- engineSetModelPhysicalPropertiesGroupUpdated
- engineSetModelTXDIDNew
- engineSetModelVisibleTime
- engineSetObjectGroupPhysicalProperty
- engineSetPoolCapacityNew
- engineSetSurfaceProperties
- engineStreamingFreeUpMemory
- engineStreamingGetBufferSizeNew
- engineStreamingGetMemorySizeNew
- engineStreamingGetModelLoadStateNew
- engineStreamingGetUsedMemory
- engineStreamingReleaseModelNew
- engineStreamingRequestModelNew
- engineStreamingRestoreBufferSizeNew
- engineStreamingRestoreMemorySizeNew
- engineStreamingSetBufferSizeNew
- engineStreamingSetMemorySizeNew
- engineStreamingSetModelCacheLimitsNew