Detecting keys
#1

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if((newkeys & KEY_RIGHT) && !(oldkeys & KEY_RIGHT))
	{
	    SendDebug(playerid, "Key Right Detected!");
	}

	if((newkeys == KEY_RIGHT))
	{
	    SendDebug(playerid, "Key Right Detected! (Check 2)");
	}
        return 1;
}
Can someone test it cos when i connect to server and press right key or D (Walk to right) it does not detect it at all but it detects it when i press space or right aim key...(On foot and in vehicle)
I know the second way is not how we detect keys i just added it to be sure its not my fault

Im only one or someone may confirm these as a 0.3x bug?
Thx
Reply
#2

Aright, Let me test it.
EDIT:That also happened for me lol..
Reply
#3

Can anyone else test these please?
Reply
#4

It always was so and always will be so, even the wiki could tell you that -> OnPlayerKeyStateChange
The obviously reason is that it would spam the callback

You need to use GetPlayerKeys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)