SA-MP Forums Archive
Holding keys - 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: Holding keys (/showthread.php?tid=367917)



Holding keys - CoaPsyFactor - 11.08.2012

Hello,

I want to check is player holding W and S in vehicle, but from some reason it doesn't do what I want.

Here is the code:

pawn Код:
if(HOLDING(KEY_UP | KEY_DOWN) && IsPlayerInAnyVehicle(playerid)){
        Boost[playerid]++;
        printf("%d", Boost[playerid]);
    }
It doesn't print anything in console.


Re: Holding keys - Youarex - 11.08.2012

OnPlayerKeyStateChange does not detect these keys. Read:

https://sampforum.blast.hk/showthread.php?tid=297568
https://sampwiki.blast.hk/wiki/GetPlayerKeys


Re: Holding keys - CoaPsyFactor - 11.08.2012

Thanks, I solved it with OnPlayerUpdate and GetPlayerKeys


Re: Holding keys - [MK]Man_Deep - 11.08.2012

Okay i was gonna help u but NVM