17.02.2012, 18:11
Try this, not tested though;
pawn Код:
#define HOLDING(%0) ((newkeys & (%0)) == (%0))
#define RELEASED(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new udlr, ud, lr;
GetPlayerKeys(playerid, udlr, ud, lr);
if(HOLDING(KEY_WALK) && ud > 0 || HOLDING(KEY_WALK) && ud < 0 || HOLDING(KEY_WALK) && lr > 0 || HOLDING(KEY_WALK) && lr < 0) {
// Once a player presses ALT and one of the arrows.
} else if(RELEASED(KEY_WALK)) {
// Once a player releases ALT.
}
return 1;
}