EngineUnloadIFP: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Syntax added. Example needed.)
 
Line 15: Line 15:


==Example==  
==Example==  
animation.lua
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--Todo..
function setanimation()
ifp = engineLoadIFP("data/ani.ifp")
setPedAnimation(getLocalPlayer(), "ANIMATIONBLOCK", "animation1")
end
 
addCommandHandler("animation", setanimation)
 
function stopanimation()
engineUnloadIFP(ifp)
end
 
addCommandHandler("stopanimation", stopanimation)
</syntaxhighlight>
 
meta.xml
<syntaxhighlight lang="lua">
<info author="lukry" version="1.0" type="script" />
<script src="animation/animation.lua" />
<file src="animation/data/ani.ifp" />
</syntaxhighlight>
</syntaxhighlight>



Revision as of 12:30, 10 December 2010

This function unloads an animation library loaded by engineLoadIFP.

Syntax

bool engineLoadIFP ( element ifp ) 

Required Arguments

Returns

Returns true if the IFP file has been unloaded succesfully, false otherwise.

Example

animation.lua

function setanimation()
ifp = engineLoadIFP("data/ani.ifp")
setPedAnimation(getLocalPlayer(), "ANIMATIONBLOCK", "animation1")
end

addCommandHandler("animation", setanimation)

function stopanimation()
engineUnloadIFP(ifp)
end

addCommandHandler("stopanimation", stopanimation)

meta.xml

<info author="lukry" version="1.0" type="script" />
<script src="animation/animation.lua" />
<file src="animation/data/ani.ifp" />

See Also