Posts: 141
Threads: 2
Joined: May 2014
Reputation:
0
11.04.2015, 22:27
(
Последний раз редактировалось R0; 11.04.2015 в 22:59.
)
#define*PRESSED(%0)*\*
****(((newkeys*&*(%0))*==*(%0))*&&*((oldkeys*&*(%0 ))*!=*(%0)))*
if(PRESSED(KEY_CROUCH | KEY_WALK))
{
//animation here
}
By the way i just wanted to explain for him this code up there so i made that other code
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.