Why does it stop animations at all time?
#1

So I've made this little code and I cut out a bit of it to save some space to make it easier to read;

Код:
public OnPlayerUpdate(playerid)
{
	new Keys,ud,lr;
    GetPlayerKeys(playerid,Keys,ud,lr);

    if((ud == KEY_UP) && (HoldingForWalkstyle[playerid] == 1) && (UsingWalkstyle[playerid] == 0))
    {
        UsingWalkstyle[playerid] = 1;
        switch(pData[playerid][pWalkStyle])
        {
            case 1: ApplyAnimation............ till case 15
        }
    }
    ... so it goes for every key (up/down/left/right)
    
	return 1;
}
Now I've got this under OnPlayerKeyStateChange;

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(HOLDING(KEY_WALK))
	{
	    if(!IsPlayerInAnyVehicle(playerid))
	    {
	    	HoldingForWalkstyle[playerid] = 1;
	    }
	}
	if(PRESSED(KEY_WALK))
	{
	 	if(UsingWalkstyle[playerid] == 1 && !IsPlayerInAnyVehicle(playerid))
	 	{
			ApplyAnimationEx(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
	    }
	}
	return 1;
}
Why does this apply the animation at all times? Even when the walking animation isn't being played?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)