SA-MP Forums Archive
Chat animation - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Chat animation (/showthread.php?tid=521606)



Chat animation - Dziugsas - 23.06.2014

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?


Re: Chat animation - Dziugsas - 23.06.2014

Maybe timer is not working or what?


Re: Chat animation - Beckett - 23.06.2014

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