How to use KEY_NO ?
#1

Hi.

I've discovered KEY_NO two weeks ago.
Many times I told myself that I'll learn how to use it, but I didn't found anything about this on the wiki.

Can someone tell me how to use it ?

Thanks in advance
Reply
#2

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_NO) SendClientMessage(playerid, -1, "You pressed N button!");
    return 1;
}
Reply
#3

pawn Код:
if(newkeys && KEY_NO)
{
       cmd_enter();
       return 1;
}
dont know if it is working just test it
Reply
#4

@newbienoob

Can you explain a little ?
And I'm forced to use N button with this ? (If KEY_NO corresponds to N, I didn't know it :3)

@Matrix

I can't test it, because I'm solving bugs of my gamemode.
And the keyboard interaction would help me I think. (Not sure)
Reply
#5

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
@newbienoob

Can you explain a little ?
And I'm forced to use N button with this ? (If KEY_NO corresponds to N, I didn't know it :3)

@Matrix

I can't test it, because I'm solving bugs of my gamemode.
And the keyboard interaction would help me I think. (Not sure)
Hmm KEY_NO stands for key "N" you can do stuff with it or read me, you can use it for command like "/enter" so,
pawn Код:
if(newkeys && KEY_NO)//if player clicked "N"
{
      SendClientMessage(playerid, -1, "I know what you clicked :3")//-1 stands for Random Color :)
      return 1;
}
Reply
#6

Quote:
Originally Posted by MatriXgaMer
Посмотреть сообщение
Hmm KEY_NO stands for key "N" you can do stuff with it or read me, you can use it for command like "/enter" so,
pawn Код:
if(newkeys && KEY_NO)//if player clicked "N"
{
      SendClientMessage(playerid, -1, "I know what you clicked :3")//-1 stands for Random Color :)
      return 1;
}
-1 doesn't stand for a random color. It's just white.
Reply
#7

Thanks.
Reply
#8

Quote:
Originally Posted by MatriXgaMer
Посмотреть сообщение
Hmm KEY_NO stands for key "N" you can do stuff with it or read me, you can use it for command like "/enter" so,
pawn Код:
if(newkeys && KEY_NO)//if player clicked "N"
{
      SendClientMessage(playerid, -1, "I know what you clicked :3")//-1 stands for Random Color :)
      return 1;
}
Don't you have to use bitwise 'AND' (&) instead of logical 'AND' (&&) ?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)