Holding keys
#1

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.
Reply
#2

OnPlayerKeyStateChange does not detect these keys. Read:

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

Thanks, I solved it with OnPlayerUpdate and GetPlayerKeys
Reply
#4

Okay i was gonna help u but NVM
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)