Chat with animation problem
#1

I got problem with animation while chatting.
It freezes the player's arms after the animation ends + the chat length is not exact with the animation's time.

Here's the code.
Код:
if(PlayerInfo[playerid][pAccent] != 0 && PlayerInfo[playerid][pAccent] != 1)
	{
		format(string, sizeof(string), "%s %s says: %s", accent, sendername, text);
		ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
		SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
		new lengthtime = strlen(text);
		new time = lengthtime*50;
		ApplyAnimation(playerid, "PED", "IDLE_CHAT", 4.1, 0, 1, 1, 1, time);
	}
	else
	{
	    format(string, sizeof(string), "%s says: %s", sendername, text);
		ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
		SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
		new lengthtime = strlen(text);
		new time = lengthtime*50;
		ApplyAnimation(playerid, "PED", "IDLE_CHAT", 4.1, 0, 1, 1, 1, time);
	}
Pictures.
Код:
Chatting
http://imgur.com/mHtpHTV,tYMJKcd,lzT...2bND,hd9FXUr#2
http://imgur.com/mHtpHTV,tYMJKcd,lzT...2bND,hd9FXUr#3
Код:
Chat Ended(Look at the arms)
http://imgur.com/mHtpHTV,tYMJKcd,lzT...2bND,hd9FXUr#4
http://imgur.com/mHtpHTV,tYMJKcd,lzT...2bND,hd9FXUr#1
http://imgur.com/mHtpHTV,tYMJKcd,lzT...2bND,hd9FXUr#0
Reply
#2

ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,0,1, 1,0,time);

https://sampwiki.blast.hk/wiki/ApplyAnimation

The zero before "time" stands for freeze(ref to wiki)
freeze Setting this to 1 will freeze the player at the end of the animation. 0 will not.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)