Karoffe Posted September 3, 2014 Share Posted September 3, 2014 Whenever i create a ped and set an animation to him which the animation will not loop.. so what happens is when i leave the ped for example in los santos and go to SF and then go back to LS the ped loses his animation. the only solution i found is to enable the loop in the function which i don't want, any ideas ? Edit: Before asking,, Yes the script is serverside Link to comment
Mr.Aleks Posted September 3, 2014 Share Posted September 3, 2014 Can you show the code please? I wanna see the line where you put the animation. Link to comment
Karoffe Posted September 3, 2014 Author Share Posted September 3, 2014 (edited) setTimer(setPedAnimation, 500, 1, ped,"BEACH", "bather", -1, false, false, false, true) Edited September 3, 2014 by Guest Link to comment
Anubhav Posted September 3, 2014 Share Posted September 3, 2014 Why do you want -1 ms? Link to comment
Karoffe Posted September 3, 2014 Author Share Posted September 3, 2014 Because i don't wanna reset his animation ? as i know -1 means infinite time: how long the animation will run for in milliseconds. Link to comment
Anubhav Posted September 3, 2014 Share Posted September 3, 2014 local ped = createPed(36,x, y, z, 90, true) setPedFrozen(ped, true) setTimer(setPedAnimation, 500, 0 , ped,"ped", "KO_shot_front", 1000, false, false, false, true) Maybe this. It will keep going and set it again and again. Link to comment
Karoffe Posted September 3, 2014 Author Share Posted September 3, 2014 You have just made the same thing as looping animation does,, but you loop every 500ms. That didn't solve the problem as i don't want it to loop. Link to comment
Anubhav Posted September 3, 2014 Share Posted September 3, 2014 How do you want it then?? Link to comment
Karoffe Posted September 3, 2014 Author Share Posted September 3, 2014 I want that when i set the ped's animation it doesn't resets automatically. Without looping ^^ Edit: If you didn't understand the problem, the problem is when i set the animation of a ped, everything is alright for me, but if i went away to SF and came back to him lets say in LS i see him just standing without any animation. Link to comment
Anubhav Posted September 3, 2014 Share Posted September 3, 2014 Show us the full script.. The timer runs one time that means for -1 ms maybe unlimited in MTA:SA. Link to comment
DiSaMe Posted September 3, 2014 Share Posted September 3, 2014 Ped stats, weapon ammo, animations and some other stuff are only visible if they were set since the last stream in. Link to comment
Karoffe Posted September 3, 2014 Author Share Posted September 3, 2014 So you mean it cannot be solved ? right ? Link to comment
Moderators IIYAMA Posted September 4, 2014 Moderators Share Posted September 4, 2014 Everything can be solved, but I don't think it is it worth. Resync the animation based on time: https://wiki.multitheftauto.com/wiki/Se ... onProgress timeNow = getTickCount() That is math you learn at school, so you can ask that to your teacher. (colshape?) Link to comment
lcd1232 Posted September 4, 2014 Share Posted September 4, 2014 or use setElementStreamable Link to comment
rain_gloom Posted September 6, 2014 Share Posted September 6, 2014 Instead of using a timer (which would be a waste of resources), you could have a separate client-side script, that triggers the server-side part when the ped is streamed in. Not sure how that will affect anim-syncing though. Maybe you could keep track of time as well and set the anim progress accordingly. It's a bit more complicated, but I think it could even be used for multiple peds without too much overhead. Sry, no code. 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