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=521505)



Chat animation - Dziugsas - 23.06.2014

Hello guys!

I wanted to ask you why player freezes while chatting?

pawn Код:
new Length = strlen(text);
    new aTime = Length*200;
    if(!IsPlayerInAnyVehicle(playerid) && !IsPlayerSitting(playerid))
    {
        ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,aTime);
    }
    else if(IsPlayerInAnyVehicle(playerid))
    {
        if(GetPlayerVehicleSeat(playerid) == 0) ApplyAnimation(playerid,"CAR_CHAT","CAR_SC3_FL",4,1,0,0,0,aTime,1);
        if(GetPlayerVehicleSeat(playerid) == 1) ApplyAnimation(playerid,"CAR_CHAT","CAR_SC3_FR",4,1,0,0,0,aTime,1);
        if(GetPlayerVehicleSeat(playerid) == 2) ApplyAnimation(playerid,"CAR_CHAT","CAR_SC1_BL",4,1,0,0,0,aTime,1);
        if(GetPlayerVehicleSeat(playerid) == 3) ApplyAnimation(playerid,"CAR_CHAT","CAR_SC3_BR",4,1,0,0,0,aTime,1);
    }
    else if(!IsPlayerInAnyVehicle(playerid))
    {
        ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,aTime);
    }
this is my OnPlayerText callback.


Re: Chat animation - Clad - 23.06.2014

pawn Код:
ApplyAnimation(playerid,"PED","IDLE_chat",4.1,0, 0, 0, 0, 0);

SetTimerEx("StopAnim", 1000, false, "i", playerid);

forward StopAnim(playerid);
public StopAnim(playerid)
{
    ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0 );
}
Try it


Re: Chat animation - Dziugsas - 23.06.2014

No , he is not freezed after , everything is ok you can move , but he is freezed WHILE chatting.


Re: Chat animation - Clad - 23.06.2014

Quote:
Originally Posted by Dziugsas
Посмотреть сообщение
No , he is not freezed after , everything is ok you can move , but he is freezed WHILE chatting.
pawn Код:
ApplyAnimation(playerid, "PED", "IDLE_CHAT", 4.0, 0, 0, 0, 0, 0, 1);
SetTimerEx("StopChat", 1000, false, "i", playerid);

forward StopChat(playerid);
public StopChat(playerid)
{
     return ClearAnimations(playerid);
}



Re: Chat animation - Dziugsas - 23.06.2014

Still freezes me while saying smth.


Re: Chat animation - Clad - 23.06.2014

Quote:
Originally Posted by Dziugsas
Посмотреть сообщение
Still freezes me while saying smth.
I do beleive the animation works like this, Other person couldn't solve it too


Re: Chat animation - Dziugsas - 23.06.2014

No i made it to work while running but i dont remember how...Maybe you know...i thought.