How to type talk people with animation /chat
#1

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
Reply
#2

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
Reply
#3

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;
}
Reply
#4

is that work , sir?
Reply
#5

Just give it a try

Tell me if it's working or not.
Reply
#6

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

@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.
Reply
#8

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)