Jump to content
  • 0

setPedAnimation in MTA 1.4


Balrog85

Question

I'm not sure if it's a bug or a change to the API that hasn't been mirrored on the wiki, but since updating my server to 1.4, all animations triggered by setPedAnimation are looping and updating position, regardless of the settings passed to the function. I can't find any information on this anywhere, so would be grateful for any help.

I already have a workaround in place, but I'd like to know if this is permanent and if I need to change something permanently.

Link to comment

2 answers to this question

Recommended Posts

  • 0
I'm not sure if it's a bug or a change to the API that hasn't been mirrored on the wiki, but since updating my server to 1.4, all animations triggered by setPedAnimation are looping and updating position, regardless of the settings passed to the function. I can't find any information on this anywhere, so would be grateful for any help.

I already have a workaround in place, but I'd like to know if this is permanent and if I need to change something permanently.

Read this:

bool setPedAnimation ( ped thePed [, string block=nil, string anim=nil, int time=-1, bool loop=true, bool updatePosition=true, bool interruptable=true, bool freezeLastFrame = true] )

Optional Arguments

NOTE: When using optional arguments, you must supply all arguments before the one you wish to use. For more information on optional arguments, see Optional Arguments.

block: the animation block's name.

anim: the name of the animation within the block.

time: how long the animation will run for in milliseconds.

loop: indicates whether or not the animation will loop.

updatePosition: will change the actual coordinates of the ped according to the animation. Use this for e.g. walking animations.

interruptable: if set to 'false' other tasks wont be able to interupt the animation. Setting this to 'false' also gives this function more power to override other animations that are running. For example, squatting after a jump can be terminated.

freezeLastFrame: ... (From 1.1 onwards).

So.. You have to set animation time in milliseconds and loop (true or false).

Link to comment
  • 0

That's not an answer to my question at all. It's just spam. I already know how the function works. I'm asking if it's bugged or if it's been changed for 1.4.

Edit: Ok, I apologise. Turns out the resource I was using was passing nil instead of -1 to the time parameter. Worked fine in 1.3 but doesn't in 1.4 so I guess I just need to replace all those nils with -1s. Thanks.

Edit 2: Yeah, that fixed it. Thank you very much and sorry for being rude :D

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