EngineUnloadIFP: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
|||
Line 15: | Line 15: | ||
==Example== | ==Example== | ||
animation.lua | <section name="animation.lua" class="client" show="true"> | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
local localPlayer = getLocalPlayer() | |||
local ifp = nil | |||
function setanimation() | function setanimation() | ||
ifp = engineLoadIFP("data/ani.ifp") | ifp = engineLoadIFP("data/ani.ifp") | ||
setPedAnimation(getLocalPlayer(), "ANIMATIONBLOCK", "animation1") | if ifp then | ||
setPedAnimation(getLocalPlayer(), "ANIMATIONBLOCK", "animation1") | |||
end | |||
end | end | ||
Line 25: | Line 30: | ||
function stopanimation() | function stopanimation() | ||
engineUnloadIFP(ifp) | if ifp then | ||
engineUnloadIFP(ifp) | |||
setPedAnimation(localPlayer) | |||
end | |||
end | end | ||
addCommandHandler("stopanimation", stopanimation) | addCommandHandler("stopanimation", stopanimation) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
meta.xml | <section name="meta.xml" class="server" show="true"> | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
<info author="lukry" version="1.0" type="script" /> | <meta> | ||
<script src=" | <info author="lukry" version="1.0" type="script" /> | ||
<file src=" | <script src="animation.lua" type="client" /> | ||
<file src="data/ani.ifp" /> | |||
</meta> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{Engine_functions}} | {{Engine_functions}} |
Revision as of 13:30, 10 December 2010
This function unloads an animation library loaded by engineLoadIFP.
Syntax
bool engineLoadIFP ( element ifp )
Required Arguments
- ifp: The IFP element loaded by engineLoadIFP to unload.
Returns
Returns true if the IFP file has been unloaded succesfully, false otherwise.
Example
Click to collapse [-]
animation.lualocal localPlayer = getLocalPlayer() local ifp = nil function setanimation() ifp = engineLoadIFP("data/ani.ifp") if ifp then setPedAnimation(getLocalPlayer(), "ANIMATIONBLOCK", "animation1") end end addCommandHandler("animation", setanimation) function stopanimation() if ifp then engineUnloadIFP(ifp) setPedAnimation(localPlayer) end end addCommandHandler("stopanimation", stopanimation)
Click to collapse [-]
meta.xml<meta> <info author="lukry" version="1.0" type="script" /> <script src="animation.lua" type="client" /> <file src="data/ani.ifp" /> </meta>
See Also
- engineAddImage
- engineApplyShaderToWorldTexture
- engineFreeModel
- engineGetModelFlags
- engineGetModelIDFromName
- engineGetModelLODDistance
- engineGetModelNameFromID
- engineGetModelPhysicalPropertiesGroup
- engineGetModelTextureNames
- engineGetModelTextures
- engineGetModelTXDID
- engineGetModelVisibleTime
- engineGetObjectGroupPhysicalProperty
- engineGetSurfaceProperties
- engineGetVisibleTextureNames
- engineImageGetFilesCount
- engineImageGetFiles
- engineImageGetFile
- engineImageLinkDFF
- engineImageLinkTXD
- engineImportTXD
- engineLoadCOL
- engineLoadDFF
- engineLoadIMG
- engineLoadIFP
- engineLoadTXD
- engineRemoveImage
- engineRemoveShaderFromWorldTexture
- engineReplaceAnimation
- engineReplaceCOL
- engineReplaceModel
- engineRequestModel
- engineResetModelFlags
- engineResetModelLODDistance
- engineResetSurfaceProperties
- engineRestoreAnimation
- engineRestoreCOL
- engineRestoreDFFImage
- engineRestoreModel
- engineRestoreModelPhysicalPropertiesGroup
- engineRestoreObjectGroupPhysicalProperties
- engineRestoreTXDImage
- engineRestreamWorld
- engineSetAsynchronousLoading
- engineSetModelFlag
- engineSetModelFlags
- engineSetModelLODDistance
- engineSetModelPhysicalPropertiesGroup
- engineSetModelVisibleTime
- engineSetObjectGroupPhysicalProperty
- engineSetSurfaceProperties
- engineStreamingFreeUpMemory
- engineStreamingGetUsedMemory