Jump to content

Animations stuff


WiBox

Recommended Posts

Posted
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?

Posted

It's in a folder.. folder name is parkourFiles

It work fine but the thing is if you do the animation, only you can see yourself making that animation... Another player will see you moving not animating

Posted

all thing are true this problem i had it from some days

i think it was that u can see u self makin the anim and other cant see

am right ?

if that the problem i can help u reply only .

Posted

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)

 

Posted
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. )

Posted

-- server --

addCommandHandler ( "animation" , 
function ( player )
triggerClientEvent (  root, "SetAnimForAll" ,player ) --sent to root element
end
)

try this server code with your existing client code.

Posted

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)

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...