Dialog and OnPlayerKeyStateChange - bug
#1

Hi

I have a problem with OnPlayerKeyStateChange callback.

Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	printf("[OnPlayerKeyStateChange]: newkeys: %d oldkeys: %d",newkeys,oldkeys);
           return 1;
}
So, when the show player dialog and player press numpad 4 or numpad 6 key, callback return strange values.

Code:
[OnPlayerKeyStateChange]: newkeys: 8 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 8
[OnPlayerKeyStateChange]: newkeys: 8 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 8
[OnPlayerKeyStateChange]: newkeys: 16 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 16
[OnPlayerKeyStateChange]: newkeys: 8 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 8
[OnPlayerKeyStateChange]: newkeys: 128 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 128
[OnPlayerKeyStateChange]: newkeys: 8 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 128 oldkeys: 8
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 128
[OnPlayerKeyStateChange]: newkeys: 8 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 8
[OnPlayerKeyStateChange]: newkeys: 128 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 128
[OnPlayerKeyStateChange]: newkeys: 8 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 8
[OnPlayerKeyStateChange]: newkeys: 128 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 128
[OnPlayerKeyStateChange]: newkeys: 8 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 8
[OnPlayerKeyStateChange]: newkeys: 8 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 8
[OnPlayerKeyStateChange]: newkeys: 128 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 128
[OnPlayerKeyStateChange]: newkeys: 8 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 8
[OnPlayerKeyStateChange]: newkeys: 8 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 8
[OnPlayerKeyStateChange]: newkeys: 32 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 32
[OnPlayerKeyStateChange]: newkeys: 8 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 8
[OnPlayerKeyStateChange]: newkeys: 8 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 8
[OnPlayerKeyStateChange]: newkeys: 128 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 8 oldkeys: 128
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 8
[OnPlayerKeyStateChange]: newkeys: 32 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 32
[OnPlayerKeyStateChange]: newkeys: 128 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 128
[OnPlayerKeyStateChange]: newkeys: 8 oldkeys: 0
[OnPlayerKeyStateChange]: newkeys: 0 oldkeys: 8
This situation is only i show dialog for player.
Sory, for my bad english
Reply
#2

What is wrong?

OnPlayerKeyStateChange logs every key and returns invalid/unused as 0
Reply
#3

Quote:
Originally Posted by PeteShag
View Post
What is wrong?

OnPlayerKeyStateChange logs every key and returns invalid/unused as 0
Look:

1. I show Player Dialog
2. Player press numpad 4
3. In console print: 8
4. Player press numpad 4 again
5. In console print: 8 or 128 or 32 or 0 etc.

When must show: 8192

2. Player press numpad 6
3. In console print: 128
4. Player press numpad 6 again
5. In console print: 8 or 128 or 32 or 0 etc.

When must show: 16384
Reply
#4

When a player is shown a dialog, I don't think keystrokes will get sent to oPKSC
Reply
#5

Quote:
Originally Posted by Retardedwolf
View Post
When a player is shown a dialog, I don't think keystrokes will get sent to oPKSC
and should be, it prevents me to write a modern banking system. So far I used textdraws and the menu, but it looks ugly
Reply
#6

To dev team: Please fix this bug.
Reply
#7

I think I know a solution for this, I think you forgot something its showin' below:

pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    print("[OnPlayerKeyStateChange]: newkeys: %d oldkeys: %d,newkeys,oldkeys);
        return 1;
}
Just copy that PAWN code.

and it is not like this

pawn Code:
printf("[OnPlayerKeyStateChange]: newkeys: %d oldkeys: %d",newkeys,oldkeys);
Reply
#8

Quote:
Originally Posted by vengeance89
View Post
I think I know a solution for this, I think you forgot something its showin' below:

pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    print("[OnPlayerKeyStateChange]: newkeys: %d oldkeys: %d,newkeys,oldkeys);
        return 1;
}
Just copy that PAWN code.
Fail post, you can't gotta format stuff for print... also you forgot a "
And I don't think that user has this problem anymore (wtf confusing)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)