Jump to content

Ped Animation


DarkLink

Recommended Posts

Hey guys I am trying to do a ped animation for only a few seconds , but seems that isnt working the time argument ? :S

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 :S

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
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
  
_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
  
_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 :P

But thanks alot, and I think I understand u :)

Link to comment

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

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