Posts: 3,324
Threads: 96
Joined: Sep 2013
Quote:
Originally Posted by R0
easy,there you go:
pawn Код:
#define HOLDING(%0) \ ((newkeys & (%0)) == (%0))
#define RELEASED(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
new PressedC[MAX_PLAYERS]; new PressedAlt[MAX_PLAYERS];
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if (HOLDING(KEY_CROUCH)) { PressedC[playerid] = 1; if(PressedAlt[playerid] == 1) { LoopingAnim(playerid,"ON_LOOKERS","wave_loop",4.0,1,0,0,0,0); } } if(RELEASED(KEY_CROUCH)) { PressedC[playerid] = 0; } if(HOLDING(KEY_WALK)) { PressedAlt[playerid] = 1; if(PressedC[playerid] == 1) { LoopingAnim(playerid,"ON_LOOKERS","wave_loop",4.0,1,0,0,0,0); } } if(RELEASED(KEY_WALK)) { PressedAlt[playerid] = 0; } return 1; }
|
Why would you go through this amount of trouble?
Just do what Mencent said, that's how everybody should be doing it because it's correct.