Chat animation
#1

Hello guys!

I have a problem here...

When i chat the animation wont stop even wtih timer for clearanimations.

Second thing car chating anims not working , whenever i start to chat i get dropped out of the car and idle chat animation starts to go and loops for ever.

pawn Код:
public OnPlayerText(playerid, text[])
{
    new Length = strlen(text);
    new aTime = Length*200;
    if((!IsPlayerInAnyVehicle(playerid) || !IsPlayerSitting(playerid)) &&   PlayerInfo[playerid][Dead] == false)
    {
        ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,1,1, 1,1,1);
        SetTimerEx("StopChat", aTime, false, "i", playerid);
    }
    else if(IsPlayerInAnyVehicle(playerid))
    {
        if(GetPlayerVehicleSeat(playerid) == 0) ApplyAnimation(playerid,"CAR_CHAT","CAR_SC3_FL",4,1,1,1,1,aTime,1);
        if(GetPlayerVehicleSeat(playerid) == 1) ApplyAnimation(playerid,"CAR_CHAT","CAR_SC3_FR",4,1,1,1,1,aTime,1);
        if(GetPlayerVehicleSeat(playerid) == 2) ApplyAnimation(playerid,"CAR_CHAT","CAR_SC1_BL",4,1,1,1,1,aTime,1);
        if(GetPlayerVehicleSeat(playerid) == 3) ApplyAnimation(playerid,"CAR_CHAT","CAR_SC3_BR",4,1,1,1,1,aTime,1);
    }
return 1;
}

forward StopChat(playerid);
public StopChat(playerid)
{
     return ClearAnimations(playerid);
}
WHAT IS WRONG HERE?
Reply
#2

Maybe timer is not working or what?
Reply
#3

You don't need a timer for that the ApplyAnimation function has it's own FREEZE and TIME.

Код:
(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync)
Like this.

pawn Код:
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,Length*200,1); // Time Length*200, freeze = 0
//loop = 0
Reply


Forum Jump:


Users browsing this thread: