WiBox Posted October 20, 2018 Posted October 20, 2018 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?
Z4Zy Posted October 20, 2018 Posted October 20, 2018 Did the parkour.ifp file located in the file called parkourFiles inside the resource ?
WiBox Posted October 20, 2018 Author Posted October 20, 2018 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
MrKAREEM Posted October 20, 2018 Posted October 20, 2018 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 .
Fist Posted October 21, 2018 Posted October 21, 2018 You need to use setPedAnimation on server side not on client, that's why only you see doing it.
Z4Zy Posted October 21, 2018 Posted October 21, 2018 If you want to synchronize custom animations, check IFP_demo
MrKAREEM Posted October 23, 2018 Posted October 23, 2018 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)
WiBox Posted October 25, 2018 Author Posted October 25, 2018 Thank you all, now I understand, you mean the setPedAnimation should be at Server Side, because if it was on Client Side only the player will see it. Thanks again
WiBox Posted October 27, 2018 Author Posted October 27, 2018 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. )
Z4Zy Posted October 27, 2018 Posted October 27, 2018 -- server -- addCommandHandler ( "animation" , function ( player ) triggerClientEvent ( root, "SetAnimForAll" ,player ) --sent to root element end ) try this server code with your existing client code.
WiBox Posted October 27, 2018 Author Posted October 27, 2018 hm trying XD Nope, didn't work, as always the body move but others can't see the animation, only I can
Z4Zy Posted October 27, 2018 Posted October 27, 2018 If that doesn't work -- 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)
WiBox Posted October 27, 2018 Author Posted October 27, 2018 I need to ask, about triggerClientEvent which root should I use which represent server? Nope, also didn't work XD
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now