Animation on chat
#1

Hello, i have one question... Today i tried to make an animation, when you type something in chat. And i get, player talks (moves hes hands...) and after that hes holding hes hands down, and when i try to run hes running like somekind of retard idiot. lol ( animation does not finishes...) how to make that ?

My callback:

Код:
public OnPlayerText(playerid, text[])
{
 ApplyAnimation(playerid, "ped" , "IDLE_chat" , 4.0, 0, 1, 1, 1, 1000);
	return 1;
}
Looking forward
Reply
#2

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("//blahblah", cmdtext, true, == 0)
{
ApplyAnimation(playerid, "ped" , "IDLE_chat" , 4.0, 0, 1, 1, 1, 1000);
return 1;
}

Peace....
Reply
#3

Quote:
Originally Posted by Stig
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("//blahblah", cmdtext, true, == 0)
{
ApplyAnimation(playerid, "ped" , "IDLE_chat" , 4.0, 0, 1, 1, 1, 1000);
return 1;
}

Peace....
No not the command, but when player talks, simply, without "/"... Its for role-play
Reply
#4

Sozz, i missunderstood





Peace...
Reply
#5

Quote:
Originally Posted by Stig
Sozz, i missunderstood





Peace...
No problem So, any ideas?
Reply
#6

Use a 2 second timer and use ClearAnimations

https://sampwiki.blast.hk/wiki/ClearAnimations
https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#7

Quote:
Originally Posted by dice7
Oh, thats what i meant to do so... But i thought there are timers in commands, like ApplyAnimation(id,anim,anim,opt,opt,opt,opt,time) or somethign...
Reply
#8

Quote:
Originally Posted by dice7

Sounds like the right idea :P


Peace....
Reply
#9

Or. instead of a timer you could do

public OnPlayerKeyStateChange()
{
//clear all animations here
}

That way as soon as they press a key to move, jump, do anything other then enter chat, the animation will stop.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)