DarkLink Posted August 2, 2011 Share Posted August 2, 2011 Hey guys I am trying to do a ped animation for only a few seconds , but seems that isnt working the time argument ? okay so I made this: setPedAnimation(source , "ped", "handsup", 5000, false, false, false, false) But after the 5 seconds the ped have the same animation I could make a timer, and set animation to nil after those 5 seconds, but the time argument on function setPedAnimation should work right? By the way, while the ped is on the animation he can move on a 360 degres circle using W,S,A,D . Is there a way to freeze him with the animation without using setPedFrozen? Thanks alot guys. Cya. Link to comment
will briggs Posted August 2, 2011 Share Posted August 2, 2011 U need to set a seperate timer, not in the setPedAnimation. SetTimer Link to comment
DarkLink Posted August 2, 2011 Author Share Posted August 2, 2011 U need to set a seperate timer, not in the setPedAnimation. SetTimer Yes I know that I can do that, but its also possible with time argument of setPedAnimation doesnt it ? It says on wiki this about the time argument: time: how long the animation will run for in milliseconds. So why is not working for me? Thanks for your help Link to comment
JR10 Posted August 2, 2011 Share Posted August 2, 2011 I had my problems with animations before, just use it as a full one, don't loop, and make your timer. I'm not really sure that this time thing works in animations. Link to comment
will briggs Posted August 2, 2011 Share Posted August 2, 2011 It doesnt. Thats why i said what i did. We couldnt get it working on SAUR Link to comment
DarkLink Posted August 2, 2011 Author Share Posted August 2, 2011 Ahhhh ! I understanded now will Thanks alot guys both. Thats a bug that needs to get fixed, wont be such difficult I guess Cya Link to comment
qaisjp Posted August 2, 2011 Share Posted August 2, 2011 _setPedAnimation = setPedAnimation function setPedAnimation(a,b,c,d,e,f,g,h) if tonumber(d) then setTimer(setPedAnimation, tonumber(d), 1, a, false) end setPedAnimation(a,b,c,d,e,f,g,h) end setPedAnimation(source , "ped", "handsup", 5000, false, false, false, false) (Sorry, can't be arsed to write all the stuff..) (Yes I know he fixed it, but what is the harm in providing an alternative ) Link to comment
DarkLink Posted August 2, 2011 Author Share Posted August 2, 2011 _setPedAnimation = setPedAnimation function setPedAnimation(a,b,c,d,e,f,g,h) if tonumber(d) then setTimer(setPedAnimation, tonumber(d), 1, a, false) end setPedAnimation(a,b,c,d,e,f,g,h) end setPedAnimation(source , "ped", "handsup", 5000, false, false, false, false) (Sorry, can't be arsed to write all the stuff..) (Yes I know he fixed it, but what is the harm in providing an alternative ) Ahh I thats nice, I guess I understanted your code. You changed the real function setPedAnimation to _setPedAnimation, and then you can your costum setPedAnimation function with time argument fixed right? But I can just make a timer with 5 seconds and change animation to nil, I guess its easier But thanks alot, and I think I understand u Link to comment
JR10 Posted August 4, 2011 Share Posted August 4, 2011 Wait wouldn't that give infinite execution, saw a problem caused by that somewhere. For cautions use that: _setPedAnimation = setPedAnimation function setPedAnimation(a,b,c,d,e,f,g,h) if tonumber(d) then setTimer(_setPedAnimation, tonumber(d), 1, a, false) end _setPedAnimation(a,b,c,d,e,f,g,h) end setPedAnimation(source , "ped", "handsup", 5000, false, false, false, false) Same but changed it to _setPedAnimation , because it might give infinite execution. Link to comment
DarkLink Posted August 4, 2011 Author Share Posted August 4, 2011 Wait wouldn't that give infinite execution, saw a problem caused by that somewhere.For cautions use that: _setPedAnimation = setPedAnimation function setPedAnimation(a,b,c,d,e,f,g,h) if tonumber(d) then setTimer(_setPedAnimation, tonumber(d), 1, a, false) end _setPedAnimation(a,b,c,d,e,f,g,h) end setPedAnimation(source , "ped", "handsup", 5000, false, false, false, false) Same but changed it to _setPedAnimation , because it might give infinite execution. Hm okay thanks jacob, but I guess is not false, is nil instead. for delete animation from ped Thanks Link to comment
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