John Smith Posted November 29, 2014 Posted November 29, 2014 I have tried to edit freeroam's code, the setPedAnimation syntax and added few more arguments and put updatePosition argument to false, but anims still change coordinate positions i am trying to disable movement when using anims when an animation finishes in freeroam, new one starts because its looped and then it moves to player as more it loops please help if you understand what i said
Dzsozi (h03) Posted December 1, 2014 Posted December 1, 2014 You could try this function: bool setElementFrozen ( element theElement, bool freezeStatus ) while animation is being applied on someone.
juanruiz85 Posted December 1, 2014 Posted December 1, 2014 Something as this setPedAnimation(theElement, "GANGS", "shake_carSH") setElementFrozen(theElement, true) and maybe when the playe press a key the animation stop and unfroze it
John Smith Posted December 1, 2014 Author Posted December 1, 2014 i have used that alternative before but it doesnt look natural and/or smooth isnt updatePostion set to false supposed to freeze animation's position by itself?
Dzsozi (h03) Posted December 1, 2014 Posted December 1, 2014 It should, try it again, maybe you wrote something wrong, but if not then it look's like it's a bug or it doesn't freeze the player. But I think you would get the same result with setElementFrozen as with setting updatePosition to false. Sorry for bad English, hope you understand me!
Moderators IIYAMA Posted December 2, 2014 Moderators Posted December 2, 2014 You can also freeze it by rendering. (the ped isn't frozen in this video, but just to show you what is more possible when you render it)
juanruiz85 Posted December 4, 2014 Posted December 4, 2014 Do you want apply one animation and the ped no move it? but not want frozzen it.... bool setPedAnimation ( ped thePed [, string block=nil, string anim=nil, int time=-1, bool loop=true, bool updatePosition=true, bool interruptable=true, bool freezeLastFrame = true] ) NOTE: When using optional arguments, you must supply all arguments before the one you wish to use. For more information on optional arguments, see Optional Arguments.block: the animation block's name. anim: the name of the animation within the block. time: how long the animation will run for in milliseconds. loop: indicates whether or not the animation will loop. updatePosition: will change the actual coordinates of the ped according to the animation. Use this for e.g. walking animations. interruptable: if set to 'false' other tasks wont be able to interupt the animation. Setting this to 'false' also gives this function more power to override other animations that are running. For example, squatting after a jump can be terminated. freezeLastFrame: ... (From 1.1 onwards). https://wiki.multitheftauto.com/wiki/SetPedAnimation
John Smith Posted December 4, 2014 Author Posted December 4, 2014 Dont you think that i have read this before?
Moderators IIYAMA Posted December 4, 2014 Moderators Posted December 4, 2014 Well John, did you tried to render it? Like in the video expect reset the position.
juanruiz85 Posted December 4, 2014 Posted December 4, 2014 Dont you think that i have read this before? sorry my english is bad i was asking about if not want frozen the ped .... and show the info trying to understand what you did but you do not like of this way and you are trying to do of other way the animation sorry and good luck
Moderators IIYAMA Posted December 4, 2014 Moderators Posted December 4, 2014 Well very simple: local peds = getElementsByType("ped") local pedPositions = {} for i=1,#peds do local ped = peds[i] local x,y,z = getElementPosition(ped) pedPositions[#pedPositions+1] = { ["element"]=ped, ["x"]=x, ["y"]=y, ["z"]=z } end addEventHandler("onClientRender",root, function () for i=#pedPositions,1,-1 do -- infers loop for using table.remove. local pedData = pedPositions[i] local ped = pedData["element"] if isElement(ped) then setElementPosition( ped, pedData["x"], pedData["y"], pedData["z"], false -- don't interrupt the animation = false ) else table.remove(pedPositions,i) end end end)
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