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



Chat Animation - Bigwebicek - 09.06.2017

Hi there,
I'd like to apply animation to player who said something to the local chat, this is what am I using currently:

ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,1,1, 1,0, strlen(text) * 100);

But, I need that the player can move while the animation is applied, also, after the animation ends, I need his chat animation to be cleared.

Please, does someone know how to do this or which kind of animation should I use?

Thanks.


Re: Chat Animation - Kane - 09.06.2017

PHP код:
ApplyAnimation(playerid"CARRY""crry_prtial"4000001); 
is the correct animation.


Re: Chat Animation - Zmith - 09.06.2017

You have set the anim to loop, so it won't end. https://sampwiki.blast.hk/wiki/ApplyAnimation

If you want to stop an animnation without creating a command you can;
PHP код:
#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (
PRESSED(KEY_SECONDARY_ATTACK))
    {
        
ApplyAnimation(playerid"CARRY""crry_prtial"4000001);
    }
    return 
1;

or set a timer that will stop the animnation.

PHP код:
forward StopAnim(playerid);
public 
StopAnim(playerid)
{
    
ApplyPlayerAnimation(playerid"CARRY""crry_prtial"2.000000);
    return 
1;
}
CMD:chat(playeridparams[])//I don't know your OnPlayerText code
{
        
ApplyPlayerAnimation(playerid,"PED","IDLE_CHAT",4.1,1,1,1,1,1);
        
SetTimer("StopAnim"5000false);
    return 
1;




Re: Chat Animation - Bigwebicek - 09.06.2017

thanks everybody