Chat anim
#1

Hello.

I made a simple thing which apply you a chat anim when you talk.
pawn Код:
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,1,0,0,1,time);
            SetTimerEx("StopTalk", time, false, "i", playerid);



public StopTalk(playerid)
{
  ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
    return 1;
}
The problem is next. If I use SetTimer to stop anim, it only works for player ID 0, but anim doesn't stop for other players. If I use SetTimerEx it works for all the players, but you stay frozen until anim ends. I tried changing opt4 to 0 and 1 multiple times, also tried with loop and without and it's always the same; frozen until anim ends.
Basically I tried all these options:
pawn Код:
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,1,0,0,1,time);
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,1,0,0,1,time);
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,0);
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,time);
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,1,0);
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,1,0,0,0,0);
With SetTimer it stops only for ID 0 and oyu can move while doing animation, but with SettimerEx it stops for all palyers, but oyu can't move while doing animation.

I need that it stops for all the players and you can mvoe while doing animation.
Reply
#2

I didn't read the topic but by your topic name I think I know what you want.
An animation appears as the player speaks, the animation has as same letnght as the chat.
Am I right?
Reply
#3

Animation uses this lenght
pawn Код:
new time = length * 80;
The problem is only with stopping animation as I said. If I use SetTimerEx it freezes me until animation is stopped, but if I use SetTimer it doesn't stop for all players.
Reply
#4

Try playing this animation when you want the chat one to stop
pawn Код:
ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
Reply
#5

Use strlen(text) on the animation, as its time.
Reply
#6


pawn Код:
public StopTalk(playerid)
{
  ClearAnimations(playerid);
  return 1;
}
Reply
#7

It works now. Solution is next:

pawn Код:
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,1,1);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)