Jump to content

Animations stuff


WiBox

Recommended Posts

local customBlockName = "parkour"
local parkourIFP = engineLoadIFP( "parkourFiles/parkour.ifp", customBlockName )

function setanimation( _, animationName )
    if ( parkourIFP ) then
        setPedAnimation( localPlayer, customBlockName, animationName )
    end
end
addCommandHandler( "animation", setanimation )

I was testing the parkour.ifp, the file is from https://wiki.multitheftauto.com/wiki/EngineReplaceAnimation , anyway I downloaded that parkour.ifp file and I add it..... but the problem is while I'm using example

/animation HandPlant

I don't see him doing the animation, I see his body moving nothing else.. Can anyone help me?

Link to comment

try this

This Was an Example

 

-- server --

addCommandHandler ( "animation" , 
function ( player )
triggerClientEvent (  "SetAnimForAll" ,player )
end
)
-- client --

addEvent('SetAnimForAll',true)
addEventHandler('SetAnimForAll',root,
function()
local customBlockName = "myNewBlock"
local IFP = engineLoadIFP( "parkour.ifp", customBlockName )
engineReplaceAnimation( source, "ped", "weapon_crouch", customBlockName, "HandPlant" )
setPedAnimation( source, customBlockName, "HandPlant" )
end)

 

Link to comment
On 23/10/2018 at 13:05, MrKAREEM said:

try this

This Was an Example

 


-- server --

addCommandHandler ( "animation" , 
function ( player )
triggerClientEvent (  "SetAnimForAll" ,player )
end
)

-- client --

addEvent('SetAnimForAll',true)
addEventHandler('SetAnimForAll',root,
function()
local customBlockName = "myNewBlock"
local IFP = engineLoadIFP( "parkour.ifp", customBlockName )
engineReplaceAnimation( source, "ped", "weapon_crouch", customBlockName, "HandPlant" )
setPedAnimation( source, customBlockName, "HandPlant" )
end)

 

I tried to do it like this, well the animation worked, but couldn't see my friend making the animation... I understand that the function should be added at server side so all can see it but I'm still trying to find a way to make that work... if someone have a solution please share it with us. ( Us because that won't just help me, it will help too many other developers. )

Link to comment

If that doesn't work :S

-- server --

addCommandHandler ( "animation" , 
function ( player )
triggerClientEvent (  "SetAnimForAll", resourceRoot, player )
end
)
-- client --

addEvent('SetAnimForAll',true)
addEventHandler('SetAnimForAll',root,
function(player)
local customBlockName = "myNewBlock"
local IFP = engineLoadIFP( "parkour.ifp", customBlockName )
engineReplaceAnimation( source, "ped", "weapon_crouch", customBlockName, "HandPlant" )
setPedAnimation( player, customBlockName, "HandPlant" )
end)
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...