OnPlayerKeyStateChange problem - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerKeyStateChange problem (
/showthread.php?tid=122890)
OnPlayerKeyStateChange problem -
JoeDaDude - 23.01.2010
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys & KEY_JUMP) && !(oldkeys & KEY_JUMP))
{
if (IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_RED, "Message One");
}
}
return 1;
}
If i get in a car, And press Shift, it sends that message,
But it sends that message if i press "S" aswell,
Why?
Re: OnPlayerKeyStateChange problem -
¤Adas¤ - 23.01.2010
Change it to KEY_HANDBRAKE
Re: OnPlayerKeyStateChange problem -
JoeDaDude - 23.01.2010
Now i have to press Space for the message,
I want it for shift
Re: OnPlayerKeyStateChange problem -
Correlli - 23.01.2010
Read carefully the text on
this page.
Re: OnPlayerKeyStateChange problem -
JoeDaDude - 23.01.2010
Quote:
Originally Posted by Don Correlli
Read carefully the text on this page.
|
I have
Re: OnPlayerKeyStateChange problem -
WThieves - 23.01.2010
Quote:
Originally Posted by JoeDaDude
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if ((newkeys & KEY_JUMP) && !(oldkeys & KEY_JUMP)) { if (IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, COLOR_RED, "Message One"); } } return 1; }
If i get in a car, And press Shift, it sends that message,
But it sends that message if i press "S" aswell,
Why?
|
Jump key is shift at yours as well as S so they both work, there isn't any possible option to asset a key on the keyboard but only an ingame assigned key so if you want that go to your options and change SHIFT S or jump in this case to SHIFT only but it'll mean that only you can do it that way, it doesn't change the otherss way.
Re: OnPlayerKeyStateChange problem -
JoeDaDude - 23.01.2010
Im trying to copy rp engine system,
Like /engine or shift