05.05.2015, 13:16
The 'keys' variable doesn't store U/D/L/R. That's what the 'updown' and 'leftright' variables are for.
Or alternatively...
Also, you want to check if they just STARTED to hold a key, you don't want to keep applying the animation. So to do this, you need to get their old key state (save it in variables).
pawn Код:
if(leftright == KEY_LEFT || leftright == KEY_RIGHT)
{
// They are holding left or right
}
pawn Код:
if(leftright) // Not false (0)
{
// They are holding left or right
}