(help) sprint key bug
#1

hi all
my problem is when i press sprint key the player start sprint & even if take my finger out the key he still sprinting
can some one show me can i change that to make the player sprint only if he HOLD THE KEY pls
this is the code that i'm using
Код:
	if((newkeys & KEY_SPRINT) && (team[playerid] == 2))
	{
		ApplyAnimation(playerid,"MUSCULAR","MuscleSprint",100000.1,1,1,1,1,1,1);
		return 1;
    }
Reply
#2

This should do the trick
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys < oldkeys)
    {
        if(oldkeys - newkeys == KEY_SPRINT)
        {
            ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
        }
    }
    else
    {
        if(newkeys - oldkeys == KEY_SPRINT)
        {
            ApplyAnimation(playerid,"MUSCULAR", "MuscleSprint", 4.0, 1, 1, 1, 1, 1, 1);
        }
    }
    return 1;
}
Reply
#3

thanks a lot
works
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)