[HELP] Chat Animation -
joeri55 - 13.12.2009
Hello,
I don't got a problem but I need some explanation of something:
I've made something that if you talk a animation appears.
Code:
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,1,1);
Also made a timer for it and forwarded it:
Code:
SetTimerEx("StopTalk", 1000, 0, "i", playerid);
What I want to do next is that my animation stops when you only type for ex: "Hi."
So when you type
"Hi." it should appear for like
1 second. And if you type more it should appear
for longer.
Do you guys have any idea to make this?
I've allready used the
search button but couldn't find anything like what I want. I only finded how to make the animation appear. Like I allready got.
I hope someone of you can help me, thanks anyways.
Re: [HELP] Chat Animation -
Patrik356b - 13.12.2009
Well, you could take the length of the string, then multiply it by, maybe 500 or 1000 (or anything that suits)
Then it becomes 2 seconds for "Hi", 5 seconds for "Hello", and so on
Re: [HELP] Chat Animation -
joeri55 - 13.12.2009
Yeah that's exacly what I need but how do I make it?
Re: [HELP] Chat Animation -
_[HuN]_Epsilon_ - 13.12.2009
Just change the timer calling line
pawn Code:
SetTimerEx("StopTalk",floatround(strlen(text)/9)*1000, 0, "i", playerid);
Re: [HELP] Chat Animation -
Sergei - 13.12.2009
strlen can't return float lol...
pawn Code:
SetTimerEx("StopTalk", strlen(text)*80, false, "i", playerid);
I found this option to fit the best.
Re: [HELP] Chat Animation -
_[HuN]_Epsilon_ - 13.12.2009
Quote:
Originally Posted by [HUN
Epsilon ]
Just change the timer calling line
pawn Code:
SetTimerEx("StopTalk",floatround(strlen(text)/9)*1000, 0, "i", playerid);
|
But if I divide it with 9 it wont be integer... Lol man..
Epsilon
Re: [HELP] Chat Animation -
LarzI - 13.12.2009
*nvm*
Re: [HELP] Chat Animation -
joeri55 - 13.12.2009
Thanks it's working!
But I've got one problem left:
If I talk in a car, my character automaticly gets putted out of the car. How can I fix that?
Re: [HELP] Chat Animation -
_[HuN]_Epsilon_ - 13.12.2009
Edit the ApplyAnimation function's line;
Code:
if(!IsPlayerInAnyVehicle(playerid)) ApplyAnimation(playerid,...);
Re: [HELP] Chat Animation -
joeri55 - 13.12.2009
Where do I need to put that?