[Help] ApplyAnimation chat
#1

Hello,

I want to know if it's possible to create a animation with a time fix and without being freezed.

I explain, on a server ( LS-Rp) when you speak, there are a animation.

So if i made:

Код:
public OnPlayerText(playerid, text[])
{
.
.
.
   ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,1,0,0,0,5000);// Work but I am freezed during the animation
}
i have all tested but I believe it's no possible without to have ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,1,1, 1,1,1) and SetTimerEx for to stop the animation.

I true or false?

Thank
Reply
#2

preloadplayeranimlibs?

that might work, so use gl_actions and put it all in your gm
Reply
#3

I was reading about this, in ApplyAnimation

try doing this

ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,1,1, 1,0,1)

instead of

ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,1,1, 1,1,1)

read about it in here, and you'll see why I put the 0 there instead of the 1.

https://sampwiki.blast.hk/wiki/ApplyAnimation
Reply
#4

So for the last '1' it says - opt5 Timer in millisecconds. For a never ending loop it should be 0. How would you convert like say.. 5 seconds into milliseconds?
Reply
#5

Quote:
Originally Posted by Seif_
You need to have a timer, yes. If not, your player will either be frozen or will be in a bizarre animation.
OK, but in the chat, it's not dangerous always to employ a Timer? LSRP use a timer Every time?


Quote:

preloadplayeranimlibs?

that might work, so use gl_actions and put it all in your gm

Maybe PreloadAnimLib but it's no that.

Quote:

I was reading about this, in ApplyAnimation

try doing this

ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,1,1, 1,0,1)

instead of

ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,1,1, 1,1,1)

read about it in here, and you'll see why I put the 0 there instead of the 1

You use never 5000 ms.
Reply
#6

up ( 24 h)

Just there is no danger with a SetTimerEx in the chat? it'is repeat often.
Reply
#7

Quote:
Originally Posted by Seif_
You need to have a timer, yes. If not, your player will either be frozen or will be in a bizarre animation.
No, the animation will just never stop.
Quote:
Originally Posted by Homer_Jeferson
up ( 24 h)

Just there is no danger with a SetTimerEx in the chat? it'is repeat often.
Because you've put your timer incorrect.
It should be:
pawn Код:
SetTimerEx("TimerName",time,0,"d",playerid);
forward TimerName(playerid); public TimerName(playerid)
  ClearAnimations(playerid);
Reply
#8

Quote:
Originally Posted by MenaceX^
Quote:
Originally Posted by Seif_
You need to have a timer, yes. If not, your player will either be frozen or will be in a bizarre animation.
Quote:

No, the animation will just never stop.

Yes but i want to be no freeze and the animation lasts 5 seconds.

Quote:
Originally Posted by Homer_Jeferson
up ( 24 h)

Just there is no danger with a SetTimerEx in the chat? it'is repeat often.
Quote:

Because you've put your timer incorrect.
It should be:
pawn Код:
SetTimerEx("TimerName",time,0,"d",playerid);
forward TimerName(playerid); public TimerName(playerid)
  ClearAnimations(playerid);
Ok, but i never show my code with theTimer. Just im afraid because it's a Timer often repeated.

And SetTimerEx("TimerName",time,0,"d",playerid); and SetTimerEx("TimerName",time,0,"i",playerid); It is similar?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)