10.10.2009, 17:07
I have problem with the keys in the 0.3 (do not know whether the bug is in 0.2), you see the operator & does not work with positive numbers, example:
if I press UP key, console shows UP (good)
if I press DOWN key, console show UP too (bad)
if I press LEFT key, console show LEFT (good)
if I press RIGHT key, console show LEFT too (bad)
if I change & to ==, it works good
Код:
GetPlayerKeys(playerid, Arrays[tmpInt][0], Arrays[tmpInt][1], Arrays[tmpInt][2]);
if(Arrays[tmpInt][1] & KEY_UP)
{
print("UP");
return 1;
}
if(Arrays[tmpInt][1] & KEY_DOWN)
{
print("DOWN");
return 1;
}
if(Arrays[tmpInt][2] & KEY_LEFT)
{
print("LEFT");
return 1;
}
if(Arrays[tmpInt][2] & KEY_RIGHT)
{
print("RIGHT");
return 1;
}
if I press DOWN key, console show UP too (bad)
if I press LEFT key, console show LEFT (good)
if I press RIGHT key, console show LEFT too (bad)
Код:
#define KEY_UP (-128) #define KEY_DOWN (128) #define KEY_LEFT (-128) #define KEY_RIGHT (128)

