SA-MP Forums Archive
Make anim repeating all time - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Make anim repeating all time (/showthread.php?tid=619315)



Make anim repeating all time - henkas - 16.10.2016

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.


Re: Make anim repeating all time - NealPeteros - 16.10.2016

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;




Re: Make anim repeating all time - Eoussama - 16.10.2016

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




Re: Make anim repeating all time - NealPeteros - 16.10.2016

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


Re: Make anim repeating all time - henkas - 16.10.2016

No one work normal.


Re: Make anim repeating all time - henkas - 16.10.2016

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?


Re: Make anim repeating all time - henkas - 16.10.2016

up up up


Re: Make anim repeating all time - henkas - 16.10.2016

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?


Re: Make anim repeating all time - Eoussama - 16.10.2016

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,