Make anim repeating all time
#1

I tryed make anim that he doesn't stop when i press keyboard like "enter" or my mouse, bat it must let walk with (W,A,S,D) like when i type this command he do this all time, bat when he die this animation is gone.
Код:
CMD:test(playerid,params[])
{
   ApplyAnimation(playerid, "PED", "WALK_fatold", 4.1,1,1,1,1,1);
   return 1;
}
Now this command just gone when i press something different.
Reply
#2

Something like this?

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (
HOLDINGKEY_UP ))
    {
        
ApplyAnimation(playerid"PED""WALK_fatold"4.1,1,1,1,1,0);
        return 
1;
    }
    return 
1;

Reply
#3

Or
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
newkeys == (INSERT A KEY ID HERE) && GetPlayerAnimationIndex(playerid) != 0){
            
ClearAnimations(playerid);
            return 
1;
       }

Reply
#4

Or
PHP код:
new
    
bool:HoldingWalk[MAX_PLAYERS];

public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
newkeys KEY_UP && !HoldingWalk[playerid])
    {
        
KeyCheck(playerid);
        
HoldingWalk[playerid] = true;
    }

    return 
1;
}

forward KeyCheck(playerid);
public 
KeyCheck(playerid)
{
    if(
IsPlayerConnected(playerid))
    {
        new
            
keysudlr;
            
        
GetPlayerKeys(playeridkeysudlr);
        
        if(
keys KEY_UP)
        {
            
// Player is holding the key if it gets here
            
ApplyAnimation(playerid"PED""WALK_fatold"4.1,1,1,1,1,0);
            
SetTimerEx("KeyCheck"1000"i"playerid);
            
            return 
0;
        }
    }
    
    
HoldingKey[playerid] = false;
    
    return 
0;

Not really sure which is which.

Credits to Tannz0rz for the code
Reply
#5

No one work normal.
Reply
#6

Tell me how i should put anim on player, that he walk with this anim while he die. He cant print run or somehow pulled over this anim?
Reply
#7

up up up
Reply
#8

Tell me how i should put anim on player, that he walk with this anim while he die. He cant print run or somehow pulled over this anim?
Reply
#9

Quote:
Originally Posted by henkas
Посмотреть сообщение
Tell me how i should put anim on player, that he walk with this anim while he die. He cant print run or somehow pulled over this anim?
stop bumping, just use the edit button to add extra notes to your previous post,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)