Animation on Player Text
#9

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
When a player chats, OnPlayerText is called. So that is the callback we want to use.
pawn Код:
public OnPlayerText(playerid, text[])
{
    //Code
    return 1;
}
We want to apply the chat animation, which is "IDLE_chat" in the "ped" library.
pawn Код:
ApplyAnimation(playerid, "ped", "IDLE_chat", 4.1, 1, 1, 1, 0, ((strlen(text) * 100) + 1000), 1);
(strlen(text) * 100) + 1000) is used as the 'timer' parameter in ApplyAnimation. This means that the animation will play for a certain amount of time, so with this, the longer the text you typed in the chat, the longer that your player will appear to be 'chatting', adding a more realistic effect to it.

The full code:
pawn Код:
public OnPlayerText(playerid, text[])
{
    ApplyAnimation(playerid, "ped", "IDLE_chat", 4.1, 1, 1, 1, 0, ((strlen(text) * 100) + 1000), 1);
    return 1;
}
References:
ApplyAnimation
OnPlayerText
Benzo has just explained everything here.
Reply


Messages In This Thread
Animation on Player Text - by cedizon - 29.05.2014, 06:49
Re: Animation on Player Text - by NaClchemistryK - 29.05.2014, 06:51
Re: Animation on Player Text - by BroZeus - 29.05.2014, 06:51
Re: Animation on Player Text - by Threshold - 29.05.2014, 07:03
Re: Animation on Player Text - by cedizon - 29.05.2014, 07:07
Re: Animation on Player Text - by cedizon - 29.05.2014, 07:25
Re: Animation on Player Text - by Threshold - 29.05.2014, 07:47
Re: Animation on Player Text - by Guest4390857394857 - 29.05.2014, 07:53
Re: Animation on Player Text - by Parallex - 29.05.2014, 07:54
Re: Animation on Player Text - by cedizon - 29.05.2014, 08:09

Forum Jump:


Users browsing this thread: 2 Guest(s)