animation when talking
#1

PHP код:
    new message[144];
       if(
enabledtalk)
    {
    return 
1;
    }
    else if(!
enabledtalk)
    {
     
format(messagesizeof(message), "%s says: %s"GetOOCName(playerid), text);
    
NearMessageSender(playerid5messageCOLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
    
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,1,11,1,time);
    return 
0;
    }
    return 
1;

The problem is that the animation is infinite, while I would like that after about five seconds the anim finish.
Reply
#2

Add this:
pawn Код:
new lengthtime = strlen(text);
        new time = lengthtime*50;
        ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,time);
Reply
#3

There is a parameter in the ApplyAnimation function called "loop" (just after the delta parameter).

If you put 1 (or true) in this parameter, it will never stops. Just put it to 0.

EDIT : Too late...
Reply
#4

solved ... I have a similar problem.
I would like to enter the anim when you picked up the phone for a few seconds and then it disappears.
PHP код:
 format (textv2sizeof (textv2), "%s says:%s"GetOOCName(playerid), params); 
NearMessageSender (playerid15textv2COLOR_RADIOCOLOR_RADIOCOLOR_RADIOCOLOR_RADIOCOLOR_RADIO);
 
SetPlayerSpecialAction (playeridSPECIAL_ACTION_USECELLPHONE); 
A few seconds later, I would like to apply this action:
SPECIAL_ACTION_STOPUSECELLPHONE
The problem is that I do not know how to do.
Reply
#5

Quote:
Originally Posted by uTorrent
Посмотреть сообщение
solved ... I have a similar problem.
I would like to enter the anim when you picked up the phone for a few seconds and then it disappears.
PHP код:
 format (textv2sizeof (textv2), "%s says:%s"GetOOCName(playerid), params); 
NearMessageSender (playerid15textv2COLOR_RADIOCOLOR_RADIOCOLOR_RADIOCOLOR_RADIOCOLOR_RADIO);
 
SetPlayerSpecialAction (playeridSPECIAL_ACTION_USECELLPHONE); 
A few seconds later, I would like to apply this action:
SPECIAL_ACTION_STOPUSECELLPHONE
The problem is that I do not know how to do.
pawn Код:
public OnPlayerText(playerid, text[])
{
    new textv2[128];
    format (textv2, sizeof (textv2), "%s says:%s", GetOOCName(playerid), params);
    NearMessageSender (playerid, 15, textv2, COLOR_RADIO, COLOR_RADIO, COLOR_RADIO, COLOR_RADIO, COLOR_RADIO);
    SetPlayerSpecialAction (playerid, SPECIAL_ACTION_USECELLPHONE);
    SetTimerEx("Stopanim",5000,false,"d",playerid);//1000 milliseconds equal 1 second
    return 1;
}
forward Stopanim(playerid);
public Stopanim(playerid)
{
    SetPlayerSpecialAction (playerid, SPECIAL_ACTION_NONE);//reset his special action
    return 1;
}
Reply
#6

Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)