23.12.2017, 15:57
didn't you just read what i said man, here is an example code:
this is an example of right down left up in the exact order.
PHP код:
new KeyPressed[MAX_PLAYERS];
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_ANALOG_RIGHT))
{
if(KeyPressed[playerid] ==0)
{
KeyPressed[playerid]++;
}
}
else if(PRESSED(KEY_ANALOG_DOWN))
{
if(KeyPressed[playerid] ==1)
{
KeyPressed[playerid]++;
}
}
else if(PRESSED(KEY_ANALOG_LEFT))
{
if(KeyPressed[playerid] ==2)
{
KeyPressed[playerid]++;
}
}
else if(PRESSED(KEY_ANALOG_UP))
{
if(KeyPressed[playerid] ==3)
{
KeyPressed[playerid]++;
}
}
return 1;
}