Talking Animation OnPlayerText based with length of the message.
#2

If you want it as realistic as possible you should check what the average human words/minute rate is. After some googling I found that the average adult reads 250-300 words/minute.

Then you could use a loop to check for number of spaces in a chat message sent and then start counting words, and then make a timer based on number of words and the reading rate.

Example code:

pawn Код:
new
        wordCount;
for( new i = 0; i < strlen( text ); i ++ )
{
    if( text[ i ] == ' ' )
        wordCount ++;
}
wordCount += 1; //There will always be an extra word as there is not a space after the last word.

ApplyAnimation( playerid, "PED", "IDLE_CHAT", 1.0, 1, 1, 1, 0, ( 0.24 * wordCount )); //250 words per 60 seconds = 1 word per 0.24 seconds
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)