Animation Help
#1

Код:
if((newkeys & KEY_SPRINT) && !(oldkeys & KEY_SPRINT) )
	{
		if(GetPlayerSkin(playerid) == 99 )
		{
			ApplyAnimation(playerid, "SKATE", "skate_sprint", 4.1, 1, 1, 1, 1, 1, 1);
		}
	}
So i am applying a skating animation. but the problem is when a player releases sprint it should stop and so i tried adding this code to it

Код:
if ((oldkeys & KEY_SPRINT) && !(newkeys & KEY_SPRINT))
	{
		if(GetPlayerSkin(playerid) == 99 )
		{
            ClearAnimations(playerid);
		}
	}
but still it not stopping so how to make this animation when player holding a key ??

Thnx rep
Reply
#2

Put it where your all defines are,
Код:
#define RELEASED(%0) \
	(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
Thanks to SAMP WIKI
and use this one,
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
        if(RELEASED(KEY_SPRINT))
	{
		if(GetPlayerSkin(playerid) == 99 )
		{
                ClearAnimations(playerid);
		}
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)