Jump to content

How to avoid that ?


Karoffe

Recommended Posts

Posted

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

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

Posted

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.

Posted

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.

Posted

Ped stats, weapon ammo, animations and some other stuff are only visible if they were set since the last stream in.

Posted

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.

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