Jump to content

Animation won't stop


Yunix

Recommended Posts

I created a talk animation on chat but after i put the value "1" in the time parameter i can walk with the animation but it can't be stopped.

It just ignores setPedAnimation(source) or something.

Also the hands are not moving when the animation finishes.

Is there a fix for this?

Link to comment
That is the same thing as what he posted above.

No, it isn't.

end, 1000, 1) 

end, 1000, 1, source) 

He posted a fix. It should work. I also have to add:

setTimer(function(tPlayer) 
    setPedAnimation(tPlayer, nil) 
end, 1000, 1, source) 

Edited by Guest
Link to comment
Logical, source is not defined.

Add it to the timer:

setTimer(function(tPlayer) 
    setPedAnimation(tPlayer, false) 
end, 1000, 1, source) 

That is the same thing as what he posted above.

No, it is not. setTimer has no 'source' and that is why you have to send the 'source' as a argument.

Link to comment

Works if the time parameter is above 50 but that's the problem, i want it between 1 and 50 because then you're able to walk and have the animation at the same time. If the time parameter is above 50/100 you can't do that.

Link to comment
Works if the time parameter is above 50 but that's the problem, i want it between 1 and 50 because then you're able to walk and have the animation at the same time. If the time parameter is above 50/100 you can't do that.
setTimer 

Read the wiki, then you will see that the limit = 50 ms.

Link to comment
addEventHandler("onPlayerJoin",root,function() 
    setTimer(function() 
        outputChatBox("Message!",source); -- source is valid, it's inside the scope; 
    end,1000,1); 
end); 

addEventHandler("onPlayerJoin",root,function() 
    setTimer(function(player) -- useless; 
        outputChatBox("Message!",player); 
    end,1000,1,source); 
end); 

Link to comment

Cheez3D, if you don't know how it works, please don't react. Go test your own script which you posted by yourself. I did too, and it posted for everyone. setTimer does NOT have a source. How can you think about outputting it then? setTimer doesn't 'remember' the source+arguments you sended withing the function, that's why you have to put them in the setTimer.

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