How to use KEY_NO ? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to use KEY_NO ? (
/showthread.php?tid=487291)
How to use KEY_NO ? -
S4t3K - 12.01.2014
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
Re: How to use KEY_NO ? -
newbienoob - 12.01.2014
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_NO) SendClientMessage(playerid, -1, "You pressed N button!");
return 1;
}
Re: How to use KEY_NO ? -
MatriXgaMer - 12.01.2014
pawn Код:
if(newkeys && KEY_NO)
{
cmd_enter();
return 1;
}
dont know if it is working just test it
Re : How to use KEY_NO ? -
S4t3K - 12.01.2014
@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)
Re: Re : How to use KEY_NO ? -
MatriXgaMer - 12.01.2014
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;
}
Re: Re : How to use KEY_NO ? -
[WA]iRonan - 12.01.2014
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.
Re : How to use KEY_NO ? -
S4t3K - 12.01.2014
Thanks.
Re: Re : How to use KEY_NO ? -
erminpr0 - 12.01.2014
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' (&&) ?