SA-MP Forums Archive
How to type talk people with animation /chat - 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: How to type talk people with animation /chat (/showthread.php?tid=512847)



How to type talk people with animation /chat - jesdynguyen - 13.05.2014

i come to the server LSRP and see people when talk they use animation expressionless by hand like /chat by press T for each text when you type. how can i do that for my server , please me help me, im not good at coder

Thanks to visit my topic , i hope someone can help me


Re: How to type talk people with animation /chat - nmader - 13.05.2014

Well, what those scripts have is formula that uses "strlen" to determine the length of what a player is saying and then sets an amount of seconds based on the length of the string and then applies the animation and has a timer (which is set by the strlen value) to stop the animation.

More information about strlen can be found here: https://sampwiki.blast.hk/wiki/Strlen


Re: How to type talk people with animation /chat - SAMProductions - 13.05.2014

Like this ?;
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(GetPlayerState(playerid) == 1)
    {
        new lengthTime = strlen(text);
        new animTime = lengthTime*200;
        new animRand = random(1);

        switch (aRand)
        {
            case 0: ApplyAnimation(playerid, "PED", "IDLE_CHAT", 4.1, 1, 0, 0, 0, animTime);
        }
    }
    return 1;
}
or

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(GetPlayerState(playerid) == 1)
    {
        new lengthTime = strlen(text);
        new animTime = lengthTime*200;
        new animRand = random(3);
       
        switch (animRand)
        {
            case 0: ApplyAnimation(playerid, "PED", "IDLE_CHAT", 4.1, 1, 0, 0, 0, animTime);
            case 1: ApplyAnimation(playerid, "GHANDS", "gsign4LH", 4.1, 1, 0, 0, 0, animTime);
            case 2: ApplyAnimation(playerid, "GHANDS", "gsign5", 4.1, 1, 0, 0, 0, animTime);
        }
    }
    return 1;
}



Re: How to type talk people with animation /chat - jesdynguyen - 13.05.2014

is that work , sir?


Re: How to type talk people with animation /chat - SAMProductions - 13.05.2014

Just give it a try

Tell me if it's working or not.


Re: How to type talk people with animation /chat - jesdynguyen - 13.05.2014

do it for FS or past in on gamemode , sir ?


Re: How to type talk people with animation /chat - Laure - 13.05.2014

@jesdynguyen as SAMPProductions coded copy the above code and paste into your gm and apply some edits if needed according to your script. That is going to work.


Re: How to type talk people with animation /chat - jesdynguyen - 13.05.2014

thanks