Yunix Posted July 16, 2014 Posted July 16, 2014 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?
Et-win Posted July 16, 2014 Posted July 16, 2014 setPedAnimation(source,false) Try to understand the code. (Example number 3)
Yunix Posted July 16, 2014 Author Posted July 16, 2014 Don't you think i also tried false? It won't stop the animation.
Dealman Posted July 16, 2014 Posted July 16, 2014 Post your current code and read about setPedAnimation thoroughly.
Yunix Posted July 16, 2014 Author Posted July 16, 2014 setPedAnimation( source, "GANGS", "prtial_gngtlkB", 1, false, true, true, true, false ) setTimer(function() setPedAnimation(source, false) end, 1000, 1)
Et-win Posted July 16, 2014 Posted July 16, 2014 Logical, source is not defined. Add it to the timer: setTimer(function(tPlayer) setPedAnimation(tPlayer, false) end, 1000, 1, source)
cheez3d Posted July 16, 2014 Posted July 16, 2014 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.
12p Posted July 16, 2014 Posted July 16, 2014 (edited) 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 July 16, 2014 by Guest
Et-win Posted July 16, 2014 Posted July 16, 2014 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.
Yunix Posted July 16, 2014 Author Posted July 16, 2014 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.
Et-win Posted July 16, 2014 Posted July 16, 2014 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.
cheez3d Posted July 16, 2014 Posted July 16, 2014 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);
Et-win Posted July 16, 2014 Posted July 16, 2014 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.
_DrXenon Posted July 16, 2014 Posted July 16, 2014 Just saying, in setTimer(function() end,50,1) 50 isn't 50 seconds but milliseconds... So setting a timer for 50ms is just like not setting..
Yunix Posted July 16, 2014 Author Posted July 16, 2014 Well sure the limit is 50, but is there a other way to achieve what i wanted? To make walking + having the talk animation at the same time possible? The only way i know now is putting the time below 50.
_DrXenon Posted July 16, 2014 Posted July 16, 2014 I didnt understand your idea but.. Did you mean that you want to set the player animation as talking when chatting?
Yunix Posted July 16, 2014 Author Posted July 16, 2014 No not exactly, i already made it so when you chat you get the animation but i want to allow the player walk while doing the animation.
_DrXenon Posted July 16, 2014 Posted July 16, 2014 Set it as 50, becuz thats possible.. I am pretty sure that 50ms is just like 40ms or 30ms.
Yunix Posted July 16, 2014 Author Posted July 16, 2014 50> works and you can stop it 50< works you can walk while doing the animation but you can't stop it
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