[HELP] OnPlayerKeyStateChange - 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: [HELP] OnPlayerKeyStateChange (
/showthread.php?tid=423373)
[HELP] OnPlayerKeyStateChange -
xXRealLegitXx - 17.03.2013
Fixed.
Re: [HELP] OnPlayerKeyStateChange -
Sinner - 17.03.2013
The check should come after the player pressed the button. You get the message twice because when someone pushes a button the state of the button changes twice (once when it's pressed and once when it's released).
pawn Код:
if(PRESSED(KEY_SOMETHING)) {
if(IsPlayerInAnyVehicle(playerid)) {
// command
}
}
Re: [HELP] OnPlayerKeyStateChange -
xXRealLegitXx - 17.03.2013
Quote:
Originally Posted by Sinner
The check should come after the player pressed the button. You get the message twice because when someone pushes a button the state of the button changes twice (once when it's pressed and once when it's released).
|
Please read the edit.